diff --git a/lib/services/networkManagement2/lib/lib/models/gatewayRoute.js b/lib/services/networkManagement2/lib/lib/models/gatewayRoute.js index 4f2a9526a6..c5f5ded434 100644 --- a/lib/services/networkManagement2/lib/lib/models/gatewayRoute.js +++ b/lib/services/networkManagement2/lib/lib/models/gatewayRoute.js @@ -10,9 +10,12 @@ 'use strict'; +const models = require('./index'); + /** * Gateway routing details * + * @extends models['ProxyOnlyResource'] */ class GatewayRoute { /** @@ -26,6 +29,7 @@ class GatewayRoute { * @member {number} [weight] The route's weight */ constructor() { + super(); } /** diff --git a/lib/services/websiteManagement2/LICENSE.txt b/lib/services/websiteManagement2/LICENSE.txt new file mode 100644 index 0000000000..a70e8cf660 --- /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..dd95909622 --- /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/abnormalTimePeriod.js b/lib/services/websiteManagement2/lib/models/abnormalTimePeriod.js index 2a371f061c..af74f2332a 100644 --- a/lib/services/websiteManagement2/lib/models/abnormalTimePeriod.js +++ b/lib/services/websiteManagement2/lib/models/abnormalTimePeriod.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * Class representing Abnormal Time Period identified in diagnosis * diff --git a/lib/services/websiteManagement2/lib/models/addressResponse.js b/lib/services/websiteManagement2/lib/models/addressResponse.js index e8d64bc744..28dcbfbd00 100644 --- a/lib/services/websiteManagement2/lib/models/addressResponse.js +++ b/lib/services/websiteManagement2/lib/models/addressResponse.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * Describes main public IP address and any extra virtual IPs. * diff --git a/lib/services/websiteManagement2/lib/models/analysisData.js b/lib/services/websiteManagement2/lib/models/analysisData.js index 244cbfcee4..f23e81d09b 100644 --- a/lib/services/websiteManagement2/lib/models/analysisData.js +++ b/lib/services/websiteManagement2/lib/models/analysisData.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * Class Representing Detector Evidence used for analysis * diff --git a/lib/services/websiteManagement2/lib/models/appServiceEnvironment.js b/lib/services/websiteManagement2/lib/models/appServiceEnvironment.js new file mode 100644 index 0000000000..8419104377 --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/appServiceEnvironment.js @@ -0,0 +1,469 @@ +/* + * 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'; + +/** + * Description of an App Service Environment. + * + */ +class AppServiceEnvironment { + /** + * Create a AppServiceEnvironment. + * @member {string} name Name of the App Service Environment. + * @member {string} location Location of the App Service Environment, e.g. + * "West US". + * @member {string} [provisioningState] Provisioning state of the App Service + * Environment. Possible values include: 'Succeeded', 'Failed', 'Canceled', + * 'InProgress', 'Deleting' + * @member {string} [status] Current status of the App Service Environment. + * Possible values include: 'Preparing', 'Ready', 'Scaling', 'Deleting' + * @member {string} [vnetName] Name of the Virtual Network for the App + * Service Environment. + * @member {string} [vnetResourceGroupName] Resource group of the Virtual + * Network. + * @member {string} [vnetSubnetName] Subnet of the Virtual Network. + * @member {object} virtualNetwork Description of the Virtual Network. + * @member {string} [virtualNetwork.id] Resource id of the Virtual Network. + * @member {string} [virtualNetwork.name] Name of the Virtual Network + * (read-only). + * @member {string} [virtualNetwork.type] Resource type of the Virtual + * Network (read-only). + * @member {string} [virtualNetwork.subnet] Subnet within the Virtual + * Network. + * @member {string} [internalLoadBalancingMode] Specifies which endpoints to + * serve internally in the Virtual Network for the App Service Environment. + * Possible values include: 'None', 'Web', 'Publishing' + * @member {string} [multiSize] Front-end VM size, e.g. "Medium", "Large". + * @member {number} [multiRoleCount] Number of front-end instances. + * @member {array} workerPools Description of worker pools with worker size + * IDs, VM sizes, and number of workers in each pool. + * @member {number} [ipsslAddressCount] Number of IP SSL addresses reserved + * for the App Service Environment. + * @member {string} [databaseEdition] Edition of the metadata database for + * the App Service Environment, e.g. "Standard". + * @member {string} [databaseServiceObjective] Service objective of the + * metadata database for the App Service Environment, e.g. "S0". + * @member {number} [upgradeDomains] Number of upgrade domains of the App + * Service Environment. + * @member {string} [subscriptionId] Subscription of the App Service + * Environment. + * @member {string} [dnsSuffix] DNS suffix of the App Service Environment. + * @member {string} [lastAction] Last deployment action on the App Service + * Environment. + * @member {string} [lastActionResult] Result of the last deployment action + * on the App Service Environment. + * @member {string} [allowedMultiSizes] List of comma separated strings + * describing which VM sizes are allowed for front-ends. + * @member {string} [allowedWorkerSizes] List of comma separated strings + * describing which VM sizes are allowed for workers. + * @member {number} [maximumNumberOfMachines] Maximum number of VMs in the + * App Service Environment. + * @member {array} [vipMappings] Description of IP SSL mapping for the App + * Service Environment. + * @member {array} [environmentCapacities] Current total, used, and available + * worker capacities. + * @member {array} [networkAccessControlList] Access control list for + * controlling traffic to the App Service Environment. + * @member {boolean} [environmentIsHealthy] True/false indicating whether the + * App Service Environment is healthy. + * @member {string} [environmentStatus] Detailed message about with results + * of the last check of the App Service Environment. + * @member {string} [resourceGroup] Resource group of the App Service + * Environment. + * @member {number} [frontEndScaleFactor] Scale factor for front-ends. + * @member {number} [defaultFrontEndScaleFactor] Default Scale Factor for + * FrontEnds. + * @member {string} [apiManagementAccountId] API Management Account + * associated with the App Service Environment. + * @member {boolean} [suspended] true if the App Service + * Environment is suspended; otherwise, false. The environment + * can be suspended, e.g. when the management endpoint is no longer available + * (most likely because NSG blocked the incoming traffic). + * @member {boolean} [dynamicCacheEnabled] True/false indicating whether the + * App Service Environment is suspended. The environment can be suspended + * e.g. when the management endpoint is no longer available + * (most likely because NSG blocked the incoming traffic). + * @member {array} [clusterSettings] Custom settings for changing the + * behavior of the App Service Environment. + * @member {array} [userWhitelistedIpRanges] User added ip ranges to + * whitelist on ASE db + * @member {boolean} [hasLinuxWorkers] Flag that displays whether an ASE has + * linux workers or not + * @member {string} [sslCertKeyVaultId] Key Vault ID for ILB App Service + * Environment default SSL certificate + * @member {string} [sslCertKeyVaultSecretName] Key Vault Secret Name for ILB + * App Service Environment default SSL certificate + */ + constructor() { + } + + /** + * Defines the metadata of AppServiceEnvironment + * + * @returns {object} metadata of AppServiceEnvironment + * + */ + mapper() { + return { + required: false, + serializedName: 'AppServiceEnvironment', + type: { + name: 'Composite', + className: 'AppServiceEnvironment', + modelProperties: { + name: { + required: true, + serializedName: 'name', + type: { + name: 'String' + } + }, + location: { + required: true, + serializedName: 'location', + type: { + name: 'String' + } + }, + provisioningState: { + required: false, + readOnly: true, + serializedName: 'provisioningState', + type: { + name: 'Enum', + allowedValues: [ 'Succeeded', 'Failed', 'Canceled', 'InProgress', 'Deleting' ] + } + }, + status: { + required: false, + readOnly: true, + serializedName: 'status', + type: { + name: 'Enum', + allowedValues: [ 'Preparing', 'Ready', 'Scaling', 'Deleting' ] + } + }, + vnetName: { + required: false, + serializedName: 'vnetName', + type: { + name: 'String' + } + }, + vnetResourceGroupName: { + required: false, + serializedName: 'vnetResourceGroupName', + type: { + name: 'String' + } + }, + vnetSubnetName: { + required: false, + serializedName: 'vnetSubnetName', + type: { + name: 'String' + } + }, + virtualNetwork: { + required: true, + serializedName: 'virtualNetwork', + type: { + name: 'Composite', + className: 'VirtualNetworkProfile' + } + }, + internalLoadBalancingMode: { + required: false, + serializedName: 'internalLoadBalancingMode', + type: { + name: 'Enum', + allowedValues: [ 'None', 'Web', 'Publishing' ] + } + }, + multiSize: { + required: false, + serializedName: 'multiSize', + type: { + name: 'String' + } + }, + multiRoleCount: { + required: false, + serializedName: 'multiRoleCount', + type: { + name: 'Number' + } + }, + workerPools: { + required: true, + serializedName: 'workerPools', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'WorkerPoolElementType', + type: { + name: 'Composite', + className: 'WorkerPool' + } + } + } + }, + ipsslAddressCount: { + required: false, + serializedName: 'ipsslAddressCount', + type: { + name: 'Number' + } + }, + databaseEdition: { + required: false, + readOnly: true, + serializedName: 'databaseEdition', + type: { + name: 'String' + } + }, + databaseServiceObjective: { + required: false, + readOnly: true, + serializedName: 'databaseServiceObjective', + type: { + name: 'String' + } + }, + upgradeDomains: { + required: false, + readOnly: true, + serializedName: 'upgradeDomains', + type: { + name: 'Number' + } + }, + subscriptionId: { + required: false, + readOnly: true, + serializedName: 'subscriptionId', + type: { + name: 'String' + } + }, + dnsSuffix: { + required: false, + serializedName: 'dnsSuffix', + type: { + name: 'String' + } + }, + lastAction: { + required: false, + readOnly: true, + serializedName: 'lastAction', + type: { + name: 'String' + } + }, + lastActionResult: { + required: false, + readOnly: true, + serializedName: 'lastActionResult', + type: { + name: 'String' + } + }, + allowedMultiSizes: { + required: false, + readOnly: true, + serializedName: 'allowedMultiSizes', + type: { + name: 'String' + } + }, + allowedWorkerSizes: { + required: false, + readOnly: true, + serializedName: 'allowedWorkerSizes', + type: { + name: 'String' + } + }, + maximumNumberOfMachines: { + required: false, + readOnly: true, + serializedName: 'maximumNumberOfMachines', + type: { + name: 'Number' + } + }, + vipMappings: { + required: false, + readOnly: true, + serializedName: 'vipMappings', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'VirtualIPMappingElementType', + type: { + name: 'Composite', + className: 'VirtualIPMapping' + } + } + } + }, + environmentCapacities: { + required: false, + readOnly: true, + serializedName: 'environmentCapacities', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'StampCapacityElementType', + type: { + name: 'Composite', + className: 'StampCapacity' + } + } + } + }, + networkAccessControlList: { + required: false, + serializedName: 'networkAccessControlList', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'NetworkAccessControlEntryElementType', + type: { + name: 'Composite', + className: 'NetworkAccessControlEntry' + } + } + } + }, + environmentIsHealthy: { + required: false, + readOnly: true, + serializedName: 'environmentIsHealthy', + type: { + name: 'Boolean' + } + }, + environmentStatus: { + required: false, + readOnly: true, + serializedName: 'environmentStatus', + type: { + name: 'String' + } + }, + resourceGroup: { + required: false, + readOnly: true, + serializedName: 'resourceGroup', + type: { + name: 'String' + } + }, + frontEndScaleFactor: { + required: false, + serializedName: 'frontEndScaleFactor', + type: { + name: 'Number' + } + }, + defaultFrontEndScaleFactor: { + required: false, + readOnly: true, + serializedName: 'defaultFrontEndScaleFactor', + type: { + name: 'Number' + } + }, + apiManagementAccountId: { + required: false, + serializedName: 'apiManagementAccountId', + type: { + name: 'String' + } + }, + suspended: { + required: false, + serializedName: 'suspended', + type: { + name: 'Boolean' + } + }, + dynamicCacheEnabled: { + required: false, + serializedName: 'dynamicCacheEnabled', + type: { + name: 'Boolean' + } + }, + clusterSettings: { + required: false, + serializedName: 'clusterSettings', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'NameValuePairElementType', + type: { + name: 'Composite', + className: 'NameValuePair' + } + } + } + }, + userWhitelistedIpRanges: { + required: false, + serializedName: 'userWhitelistedIpRanges', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + hasLinuxWorkers: { + required: false, + serializedName: 'hasLinuxWorkers', + type: { + name: 'Boolean' + } + }, + sslCertKeyVaultId: { + required: false, + serializedName: 'sslCertKeyVaultId', + type: { + name: 'String' + } + }, + sslCertKeyVaultSecretName: { + required: false, + serializedName: 'sslCertKeyVaultSecretName', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = AppServiceEnvironment; diff --git a/lib/services/websiteManagement2/lib/models/appServiceEnvironmentPatchResource.js b/lib/services/websiteManagement2/lib/models/appServiceEnvironmentPatchResource.js new file mode 100644 index 0000000000..ab454a36fc --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/appServiceEnvironmentPatchResource.js @@ -0,0 +1,505 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * ARM resource for a app service enviroment. + * + * @extends models['ProxyOnlyResource'] + */ +class AppServiceEnvironmentPatchResource extends models['ProxyOnlyResource'] { + /** + * Create a AppServiceEnvironmentPatchResource. + * @member {string} appServiceEnvironmentPatchResourceName Name of the App + * Service Environment. + * @member {string} location Location of the App Service Environment, e.g. + * "West US". + * @member {string} [provisioningState] Provisioning state of the App Service + * Environment. Possible values include: 'Succeeded', 'Failed', 'Canceled', + * 'InProgress', 'Deleting' + * @member {string} [status] Current status of the App Service Environment. + * Possible values include: 'Preparing', 'Ready', 'Scaling', 'Deleting' + * @member {string} [vnetName] Name of the Virtual Network for the App + * Service Environment. + * @member {string} [vnetResourceGroupName] Resource group of the Virtual + * Network. + * @member {string} [vnetSubnetName] Subnet of the Virtual Network. + * @member {object} virtualNetwork Description of the Virtual Network. + * @member {string} [virtualNetwork.id] Resource id of the Virtual Network. + * @member {string} [virtualNetwork.name] Name of the Virtual Network + * (read-only). + * @member {string} [virtualNetwork.type] Resource type of the Virtual + * Network (read-only). + * @member {string} [virtualNetwork.subnet] Subnet within the Virtual + * Network. + * @member {string} [internalLoadBalancingMode] Specifies which endpoints to + * serve internally in the Virtual Network for the App Service Environment. + * Possible values include: 'None', 'Web', 'Publishing' + * @member {string} [multiSize] Front-end VM size, e.g. "Medium", "Large". + * @member {number} [multiRoleCount] Number of front-end instances. + * @member {array} workerPools Description of worker pools with worker size + * IDs, VM sizes, and number of workers in each pool. + * @member {number} [ipsslAddressCount] Number of IP SSL addresses reserved + * for the App Service Environment. + * @member {string} [databaseEdition] Edition of the metadata database for + * the App Service Environment, e.g. "Standard". + * @member {string} [databaseServiceObjective] Service objective of the + * metadata database for the App Service Environment, e.g. "S0". + * @member {number} [upgradeDomains] Number of upgrade domains of the App + * Service Environment. + * @member {string} [subscriptionId] Subscription of the App Service + * Environment. + * @member {string} [dnsSuffix] DNS suffix of the App Service Environment. + * @member {string} [lastAction] Last deployment action on the App Service + * Environment. + * @member {string} [lastActionResult] Result of the last deployment action + * on the App Service Environment. + * @member {string} [allowedMultiSizes] List of comma separated strings + * describing which VM sizes are allowed for front-ends. + * @member {string} [allowedWorkerSizes] List of comma separated strings + * describing which VM sizes are allowed for workers. + * @member {number} [maximumNumberOfMachines] Maximum number of VMs in the + * App Service Environment. + * @member {array} [vipMappings] Description of IP SSL mapping for the App + * Service Environment. + * @member {array} [environmentCapacities] Current total, used, and available + * worker capacities. + * @member {array} [networkAccessControlList] Access control list for + * controlling traffic to the App Service Environment. + * @member {boolean} [environmentIsHealthy] True/false indicating whether the + * App Service Environment is healthy. + * @member {string} [environmentStatus] Detailed message about with results + * of the last check of the App Service Environment. + * @member {string} [resourceGroup] Resource group of the App Service + * Environment. + * @member {number} [frontEndScaleFactor] Scale factor for front-ends. + * @member {number} [defaultFrontEndScaleFactor] Default Scale Factor for + * FrontEnds. + * @member {string} [apiManagementAccountId] API Management Account + * associated with the App Service Environment. + * @member {boolean} [suspended] true if the App Service + * Environment is suspended; otherwise, false. The environment + * can be suspended, e.g. when the management endpoint is no longer available + * (most likely because NSG blocked the incoming traffic). + * @member {boolean} [dynamicCacheEnabled] True/false indicating whether the + * App Service Environment is suspended. The environment can be suspended + * e.g. when the management endpoint is no longer available + * (most likely because NSG blocked the incoming traffic). + * @member {array} [clusterSettings] Custom settings for changing the + * behavior of the App Service Environment. + * @member {array} [userWhitelistedIpRanges] User added ip ranges to + * whitelist on ASE db + * @member {boolean} [hasLinuxWorkers] Flag that displays whether an ASE has + * linux workers or not + * @member {string} [sslCertKeyVaultId] Key Vault ID for ILB App Service + * Environment default SSL certificate + * @member {string} [sslCertKeyVaultSecretName] Key Vault Secret Name for ILB + * App Service Environment default SSL certificate + */ + constructor() { + super(); + } + + /** + * Defines the metadata of AppServiceEnvironmentPatchResource + * + * @returns {object} metadata of AppServiceEnvironmentPatchResource + * + */ + mapper() { + return { + required: false, + serializedName: 'AppServiceEnvironmentPatchResource', + type: { + name: 'Composite', + className: 'AppServiceEnvironmentPatchResource', + 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' + } + }, + appServiceEnvironmentPatchResourceName: { + required: true, + serializedName: 'properties.name', + type: { + name: 'String' + } + }, + location: { + required: true, + serializedName: 'properties.location', + type: { + name: 'String' + } + }, + provisioningState: { + required: false, + readOnly: true, + serializedName: 'properties.provisioningState', + type: { + name: 'Enum', + allowedValues: [ 'Succeeded', 'Failed', 'Canceled', 'InProgress', 'Deleting' ] + } + }, + status: { + required: false, + readOnly: true, + serializedName: 'properties.status', + type: { + name: 'Enum', + allowedValues: [ 'Preparing', 'Ready', 'Scaling', 'Deleting' ] + } + }, + vnetName: { + required: false, + serializedName: 'properties.vnetName', + type: { + name: 'String' + } + }, + vnetResourceGroupName: { + required: false, + serializedName: 'properties.vnetResourceGroupName', + type: { + name: 'String' + } + }, + vnetSubnetName: { + required: false, + serializedName: 'properties.vnetSubnetName', + type: { + name: 'String' + } + }, + virtualNetwork: { + required: true, + serializedName: 'properties.virtualNetwork', + type: { + name: 'Composite', + className: 'VirtualNetworkProfile' + } + }, + internalLoadBalancingMode: { + required: false, + serializedName: 'properties.internalLoadBalancingMode', + type: { + name: 'Enum', + allowedValues: [ 'None', 'Web', 'Publishing' ] + } + }, + multiSize: { + required: false, + serializedName: 'properties.multiSize', + type: { + name: 'String' + } + }, + multiRoleCount: { + required: false, + serializedName: 'properties.multiRoleCount', + type: { + name: 'Number' + } + }, + workerPools: { + required: true, + serializedName: 'properties.workerPools', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'WorkerPoolElementType', + type: { + name: 'Composite', + className: 'WorkerPool' + } + } + } + }, + ipsslAddressCount: { + required: false, + serializedName: 'properties.ipsslAddressCount', + type: { + name: 'Number' + } + }, + databaseEdition: { + required: false, + readOnly: true, + serializedName: 'properties.databaseEdition', + type: { + name: 'String' + } + }, + databaseServiceObjective: { + required: false, + readOnly: true, + serializedName: 'properties.databaseServiceObjective', + type: { + name: 'String' + } + }, + upgradeDomains: { + required: false, + readOnly: true, + serializedName: 'properties.upgradeDomains', + type: { + name: 'Number' + } + }, + subscriptionId: { + required: false, + readOnly: true, + serializedName: 'properties.subscriptionId', + type: { + name: 'String' + } + }, + dnsSuffix: { + required: false, + serializedName: 'properties.dnsSuffix', + type: { + name: 'String' + } + }, + lastAction: { + required: false, + readOnly: true, + serializedName: 'properties.lastAction', + type: { + name: 'String' + } + }, + lastActionResult: { + required: false, + readOnly: true, + serializedName: 'properties.lastActionResult', + type: { + name: 'String' + } + }, + allowedMultiSizes: { + required: false, + readOnly: true, + serializedName: 'properties.allowedMultiSizes', + type: { + name: 'String' + } + }, + allowedWorkerSizes: { + required: false, + readOnly: true, + serializedName: 'properties.allowedWorkerSizes', + type: { + name: 'String' + } + }, + maximumNumberOfMachines: { + required: false, + readOnly: true, + serializedName: 'properties.maximumNumberOfMachines', + type: { + name: 'Number' + } + }, + vipMappings: { + required: false, + readOnly: true, + serializedName: 'properties.vipMappings', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'VirtualIPMappingElementType', + type: { + name: 'Composite', + className: 'VirtualIPMapping' + } + } + } + }, + environmentCapacities: { + required: false, + readOnly: true, + serializedName: 'properties.environmentCapacities', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'StampCapacityElementType', + type: { + name: 'Composite', + className: 'StampCapacity' + } + } + } + }, + networkAccessControlList: { + required: false, + serializedName: 'properties.networkAccessControlList', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'NetworkAccessControlEntryElementType', + type: { + name: 'Composite', + className: 'NetworkAccessControlEntry' + } + } + } + }, + environmentIsHealthy: { + required: false, + readOnly: true, + serializedName: 'properties.environmentIsHealthy', + type: { + name: 'Boolean' + } + }, + environmentStatus: { + required: false, + readOnly: true, + serializedName: 'properties.environmentStatus', + type: { + name: 'String' + } + }, + resourceGroup: { + required: false, + readOnly: true, + serializedName: 'properties.resourceGroup', + type: { + name: 'String' + } + }, + frontEndScaleFactor: { + required: false, + serializedName: 'properties.frontEndScaleFactor', + type: { + name: 'Number' + } + }, + defaultFrontEndScaleFactor: { + required: false, + readOnly: true, + serializedName: 'properties.defaultFrontEndScaleFactor', + type: { + name: 'Number' + } + }, + apiManagementAccountId: { + required: false, + serializedName: 'properties.apiManagementAccountId', + type: { + name: 'String' + } + }, + suspended: { + required: false, + serializedName: 'properties.suspended', + type: { + name: 'Boolean' + } + }, + dynamicCacheEnabled: { + required: false, + serializedName: 'properties.dynamicCacheEnabled', + type: { + name: 'Boolean' + } + }, + clusterSettings: { + required: false, + serializedName: 'properties.clusterSettings', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'NameValuePairElementType', + type: { + name: 'Composite', + className: 'NameValuePair' + } + } + } + }, + userWhitelistedIpRanges: { + required: false, + serializedName: 'properties.userWhitelistedIpRanges', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + hasLinuxWorkers: { + required: false, + serializedName: 'properties.hasLinuxWorkers', + type: { + name: 'Boolean' + } + }, + sslCertKeyVaultId: { + required: false, + serializedName: 'properties.sslCertKeyVaultId', + type: { + name: 'String' + } + }, + sslCertKeyVaultSecretName: { + required: false, + serializedName: 'properties.sslCertKeyVaultSecretName', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = AppServiceEnvironmentPatchResource; diff --git a/lib/services/websiteManagement2/lib/models/appServiceEnvironmentResource.js b/lib/services/websiteManagement2/lib/models/appServiceEnvironmentResource.js new file mode 100644 index 0000000000..462a7c2f8b --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/appServiceEnvironmentResource.js @@ -0,0 +1,526 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * App Service Environment ARM resource. + * + * @extends models['Resource'] + */ +class AppServiceEnvironmentResource extends models['Resource'] { + /** + * Create a AppServiceEnvironmentResource. + * @member {string} appServiceEnvironmentResourceName Name of the App Service + * Environment. + * @member {string} appServiceEnvironmentResourceLocation Location of the App + * Service Environment, e.g. "West US". + * @member {string} [provisioningState] Provisioning state of the App Service + * Environment. Possible values include: 'Succeeded', 'Failed', 'Canceled', + * 'InProgress', 'Deleting' + * @member {string} [status] Current status of the App Service Environment. + * Possible values include: 'Preparing', 'Ready', 'Scaling', 'Deleting' + * @member {string} [vnetName] Name of the Virtual Network for the App + * Service Environment. + * @member {string} [vnetResourceGroupName] Resource group of the Virtual + * Network. + * @member {string} [vnetSubnetName] Subnet of the Virtual Network. + * @member {object} virtualNetwork Description of the Virtual Network. + * @member {string} [virtualNetwork.id] Resource id of the Virtual Network. + * @member {string} [virtualNetwork.name] Name of the Virtual Network + * (read-only). + * @member {string} [virtualNetwork.type] Resource type of the Virtual + * Network (read-only). + * @member {string} [virtualNetwork.subnet] Subnet within the Virtual + * Network. + * @member {string} [internalLoadBalancingMode] Specifies which endpoints to + * serve internally in the Virtual Network for the App Service Environment. + * Possible values include: 'None', 'Web', 'Publishing' + * @member {string} [multiSize] Front-end VM size, e.g. "Medium", "Large". + * @member {number} [multiRoleCount] Number of front-end instances. + * @member {array} workerPools Description of worker pools with worker size + * IDs, VM sizes, and number of workers in each pool. + * @member {number} [ipsslAddressCount] Number of IP SSL addresses reserved + * for the App Service Environment. + * @member {string} [databaseEdition] Edition of the metadata database for + * the App Service Environment, e.g. "Standard". + * @member {string} [databaseServiceObjective] Service objective of the + * metadata database for the App Service Environment, e.g. "S0". + * @member {number} [upgradeDomains] Number of upgrade domains of the App + * Service Environment. + * @member {string} [subscriptionId] Subscription of the App Service + * Environment. + * @member {string} [dnsSuffix] DNS suffix of the App Service Environment. + * @member {string} [lastAction] Last deployment action on the App Service + * Environment. + * @member {string} [lastActionResult] Result of the last deployment action + * on the App Service Environment. + * @member {string} [allowedMultiSizes] List of comma separated strings + * describing which VM sizes are allowed for front-ends. + * @member {string} [allowedWorkerSizes] List of comma separated strings + * describing which VM sizes are allowed for workers. + * @member {number} [maximumNumberOfMachines] Maximum number of VMs in the + * App Service Environment. + * @member {array} [vipMappings] Description of IP SSL mapping for the App + * Service Environment. + * @member {array} [environmentCapacities] Current total, used, and available + * worker capacities. + * @member {array} [networkAccessControlList] Access control list for + * controlling traffic to the App Service Environment. + * @member {boolean} [environmentIsHealthy] True/false indicating whether the + * App Service Environment is healthy. + * @member {string} [environmentStatus] Detailed message about with results + * of the last check of the App Service Environment. + * @member {string} [resourceGroup] Resource group of the App Service + * Environment. + * @member {number} [frontEndScaleFactor] Scale factor for front-ends. + * @member {number} [defaultFrontEndScaleFactor] Default Scale Factor for + * FrontEnds. + * @member {string} [apiManagementAccountId] API Management Account + * associated with the App Service Environment. + * @member {boolean} [suspended] true if the App Service + * Environment is suspended; otherwise, false. The environment + * can be suspended, e.g. when the management endpoint is no longer available + * (most likely because NSG blocked the incoming traffic). + * @member {boolean} [dynamicCacheEnabled] True/false indicating whether the + * App Service Environment is suspended. The environment can be suspended + * e.g. when the management endpoint is no longer available + * (most likely because NSG blocked the incoming traffic). + * @member {array} [clusterSettings] Custom settings for changing the + * behavior of the App Service Environment. + * @member {array} [userWhitelistedIpRanges] User added ip ranges to + * whitelist on ASE db + * @member {boolean} [hasLinuxWorkers] Flag that displays whether an ASE has + * linux workers or not + * @member {string} [sslCertKeyVaultId] Key Vault ID for ILB App Service + * Environment default SSL certificate + * @member {string} [sslCertKeyVaultSecretName] Key Vault Secret Name for ILB + * App Service Environment default SSL certificate + */ + constructor() { + super(); + } + + /** + * Defines the metadata of AppServiceEnvironmentResource + * + * @returns {object} metadata of AppServiceEnvironmentResource + * + */ + mapper() { + return { + required: false, + serializedName: 'AppServiceEnvironmentResource', + type: { + name: 'Composite', + className: 'AppServiceEnvironmentResource', + 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' + } + }, + location: { + required: true, + serializedName: 'location', + type: { + name: 'String' + } + }, + type: { + required: false, + readOnly: true, + serializedName: 'type', + type: { + name: 'String' + } + }, + tags: { + required: false, + serializedName: 'tags', + type: { + name: 'Dictionary', + value: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + appServiceEnvironmentResourceName: { + required: true, + serializedName: 'properties.name', + type: { + name: 'String' + } + }, + appServiceEnvironmentResourceLocation: { + required: true, + serializedName: 'properties.location', + type: { + name: 'String' + } + }, + provisioningState: { + required: false, + readOnly: true, + serializedName: 'properties.provisioningState', + type: { + name: 'Enum', + allowedValues: [ 'Succeeded', 'Failed', 'Canceled', 'InProgress', 'Deleting' ] + } + }, + status: { + required: false, + readOnly: true, + serializedName: 'properties.status', + type: { + name: 'Enum', + allowedValues: [ 'Preparing', 'Ready', 'Scaling', 'Deleting' ] + } + }, + vnetName: { + required: false, + serializedName: 'properties.vnetName', + type: { + name: 'String' + } + }, + vnetResourceGroupName: { + required: false, + serializedName: 'properties.vnetResourceGroupName', + type: { + name: 'String' + } + }, + vnetSubnetName: { + required: false, + serializedName: 'properties.vnetSubnetName', + type: { + name: 'String' + } + }, + virtualNetwork: { + required: true, + serializedName: 'properties.virtualNetwork', + type: { + name: 'Composite', + className: 'VirtualNetworkProfile' + } + }, + internalLoadBalancingMode: { + required: false, + serializedName: 'properties.internalLoadBalancingMode', + type: { + name: 'Enum', + allowedValues: [ 'None', 'Web', 'Publishing' ] + } + }, + multiSize: { + required: false, + serializedName: 'properties.multiSize', + type: { + name: 'String' + } + }, + multiRoleCount: { + required: false, + serializedName: 'properties.multiRoleCount', + type: { + name: 'Number' + } + }, + workerPools: { + required: true, + serializedName: 'properties.workerPools', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'WorkerPoolElementType', + type: { + name: 'Composite', + className: 'WorkerPool' + } + } + } + }, + ipsslAddressCount: { + required: false, + serializedName: 'properties.ipsslAddressCount', + type: { + name: 'Number' + } + }, + databaseEdition: { + required: false, + readOnly: true, + serializedName: 'properties.databaseEdition', + type: { + name: 'String' + } + }, + databaseServiceObjective: { + required: false, + readOnly: true, + serializedName: 'properties.databaseServiceObjective', + type: { + name: 'String' + } + }, + upgradeDomains: { + required: false, + readOnly: true, + serializedName: 'properties.upgradeDomains', + type: { + name: 'Number' + } + }, + subscriptionId: { + required: false, + readOnly: true, + serializedName: 'properties.subscriptionId', + type: { + name: 'String' + } + }, + dnsSuffix: { + required: false, + serializedName: 'properties.dnsSuffix', + type: { + name: 'String' + } + }, + lastAction: { + required: false, + readOnly: true, + serializedName: 'properties.lastAction', + type: { + name: 'String' + } + }, + lastActionResult: { + required: false, + readOnly: true, + serializedName: 'properties.lastActionResult', + type: { + name: 'String' + } + }, + allowedMultiSizes: { + required: false, + readOnly: true, + serializedName: 'properties.allowedMultiSizes', + type: { + name: 'String' + } + }, + allowedWorkerSizes: { + required: false, + readOnly: true, + serializedName: 'properties.allowedWorkerSizes', + type: { + name: 'String' + } + }, + maximumNumberOfMachines: { + required: false, + readOnly: true, + serializedName: 'properties.maximumNumberOfMachines', + type: { + name: 'Number' + } + }, + vipMappings: { + required: false, + readOnly: true, + serializedName: 'properties.vipMappings', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'VirtualIPMappingElementType', + type: { + name: 'Composite', + className: 'VirtualIPMapping' + } + } + } + }, + environmentCapacities: { + required: false, + readOnly: true, + serializedName: 'properties.environmentCapacities', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'StampCapacityElementType', + type: { + name: 'Composite', + className: 'StampCapacity' + } + } + } + }, + networkAccessControlList: { + required: false, + serializedName: 'properties.networkAccessControlList', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'NetworkAccessControlEntryElementType', + type: { + name: 'Composite', + className: 'NetworkAccessControlEntry' + } + } + } + }, + environmentIsHealthy: { + required: false, + readOnly: true, + serializedName: 'properties.environmentIsHealthy', + type: { + name: 'Boolean' + } + }, + environmentStatus: { + required: false, + readOnly: true, + serializedName: 'properties.environmentStatus', + type: { + name: 'String' + } + }, + resourceGroup: { + required: false, + readOnly: true, + serializedName: 'properties.resourceGroup', + type: { + name: 'String' + } + }, + frontEndScaleFactor: { + required: false, + serializedName: 'properties.frontEndScaleFactor', + type: { + name: 'Number' + } + }, + defaultFrontEndScaleFactor: { + required: false, + readOnly: true, + serializedName: 'properties.defaultFrontEndScaleFactor', + type: { + name: 'Number' + } + }, + apiManagementAccountId: { + required: false, + serializedName: 'properties.apiManagementAccountId', + type: { + name: 'String' + } + }, + suspended: { + required: false, + serializedName: 'properties.suspended', + type: { + name: 'Boolean' + } + }, + dynamicCacheEnabled: { + required: false, + serializedName: 'properties.dynamicCacheEnabled', + type: { + name: 'Boolean' + } + }, + clusterSettings: { + required: false, + serializedName: 'properties.clusterSettings', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'NameValuePairElementType', + type: { + name: 'Composite', + className: 'NameValuePair' + } + } + } + }, + userWhitelistedIpRanges: { + required: false, + serializedName: 'properties.userWhitelistedIpRanges', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + hasLinuxWorkers: { + required: false, + serializedName: 'properties.hasLinuxWorkers', + type: { + name: 'Boolean' + } + }, + sslCertKeyVaultId: { + required: false, + serializedName: 'properties.sslCertKeyVaultId', + type: { + name: 'String' + } + }, + sslCertKeyVaultSecretName: { + required: false, + serializedName: 'properties.sslCertKeyVaultSecretName', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = AppServiceEnvironmentResource; diff --git a/lib/services/websiteManagement2/lib/models/appServicePlan.js b/lib/services/websiteManagement2/lib/models/appServicePlan.js new file mode 100644 index 0000000000..6c77c375b2 --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/appServicePlan.js @@ -0,0 +1,318 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * App Service plan. + * + * @extends models['Resource'] + */ +class AppServicePlan extends models['Resource'] { + /** + * Create a AppServicePlan. + * @member {string} [workerTierName] Target worker tier assigned to the App + * Service plan. + * @member {string} [status] App Service plan status. Possible values + * include: 'Ready', 'Pending', 'Creating' + * @member {string} [subscription] App Service plan subscription. + * @member {string} [adminSiteName] App Service plan administration site. + * @member {object} [hostingEnvironmentProfile] Specification for the App + * Service Environment to use for the App Service plan. + * @member {string} [hostingEnvironmentProfile.id] Resource ID of the App + * Service Environment. + * @member {string} [hostingEnvironmentProfile.name] Name of the App Service + * Environment. + * @member {string} [hostingEnvironmentProfile.type] Resource type of the App + * Service Environment. + * @member {number} [maximumNumberOfWorkers] Maximum number of instances that + * can be assigned to this App Service plan. + * @member {string} [geoRegion] Geographical location for the App Service + * plan. + * @member {boolean} [perSiteScaling] If true, apps assigned to + * this App Service plan can be scaled independently. + * If false, apps assigned to this App Service plan will scale + * to all instances of the plan. Default value: false . + * @member {number} [numberOfSites] Number of apps assigned to this App + * Service plan. + * @member {boolean} [isSpot] If true, this App Service Plan + * owns spot instances. + * @member {date} [spotExpirationTime] The time when the server farm expires. + * Valid only if it is a spot server farm. + * @member {date} [freeOfferExpirationTime] The time when the server farm + * free offer expires. + * @member {string} [resourceGroup] Resource group of the App Service plan. + * @member {boolean} [reserved] If Linux app service plan true, + * false otherwise. Default value: false . + * @member {boolean} [isXenon] Obsolete: If Hyper-V container app service + * plan true, false otherwise. Default value: false + * . + * @member {boolean} [hyperV] If Hyper-V container app service plan + * true, false otherwise. Default value: false . + * @member {number} [targetWorkerCount] Scaling worker count. + * @member {number} [targetWorkerSizeId] Scaling worker size ID. + * @member {string} [provisioningState] Provisioning state of the App Service + * Environment. Possible values include: 'Succeeded', 'Failed', 'Canceled', + * 'InProgress', 'Deleting' + * @member {object} [sku] + * @member {string} [sku.name] Name of the resource SKU. + * @member {string} [sku.tier] Service tier of the resource SKU. + * @member {string} [sku.size] Size specifier of the resource SKU. + * @member {string} [sku.family] Family code of the resource SKU. + * @member {number} [sku.capacity] Current number of instances assigned to + * the resource. + * @member {object} [sku.skuCapacity] Min, max, and default scale values of + * the SKU. + * @member {number} [sku.skuCapacity.minimum] Minimum number of workers for + * this App Service plan SKU. + * @member {number} [sku.skuCapacity.maximum] Maximum number of workers for + * this App Service plan SKU. + * @member {number} [sku.skuCapacity.default] Default number of workers for + * this App Service plan SKU. + * @member {string} [sku.skuCapacity.scaleType] Available scale + * configurations for an App Service plan. + * @member {array} [sku.locations] Locations of the SKU. + * @member {array} [sku.capabilities] Capabilities of the SKU, e.g., is + * traffic manager enabled? + */ + constructor() { + super(); + } + + /** + * Defines the metadata of AppServicePlan + * + * @returns {object} metadata of AppServicePlan + * + */ + mapper() { + return { + required: false, + serializedName: 'AppServicePlan', + type: { + name: 'Composite', + className: 'AppServicePlan', + 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' + } + }, + location: { + required: true, + serializedName: 'location', + type: { + name: 'String' + } + }, + type: { + required: false, + readOnly: true, + serializedName: 'type', + type: { + name: 'String' + } + }, + tags: { + required: false, + serializedName: 'tags', + type: { + name: 'Dictionary', + value: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + workerTierName: { + required: false, + serializedName: 'properties.workerTierName', + type: { + name: 'String' + } + }, + status: { + required: false, + readOnly: true, + serializedName: 'properties.status', + type: { + name: 'Enum', + allowedValues: [ 'Ready', 'Pending', 'Creating' ] + } + }, + subscription: { + required: false, + readOnly: true, + serializedName: 'properties.subscription', + type: { + name: 'String' + } + }, + adminSiteName: { + required: false, + serializedName: 'properties.adminSiteName', + type: { + name: 'String' + } + }, + hostingEnvironmentProfile: { + required: false, + serializedName: 'properties.hostingEnvironmentProfile', + type: { + name: 'Composite', + className: 'HostingEnvironmentProfile' + } + }, + maximumNumberOfWorkers: { + required: false, + readOnly: true, + serializedName: 'properties.maximumNumberOfWorkers', + type: { + name: 'Number' + } + }, + geoRegion: { + required: false, + readOnly: true, + serializedName: 'properties.geoRegion', + type: { + name: 'String' + } + }, + perSiteScaling: { + required: false, + serializedName: 'properties.perSiteScaling', + defaultValue: false, + type: { + name: 'Boolean' + } + }, + numberOfSites: { + required: false, + readOnly: true, + serializedName: 'properties.numberOfSites', + type: { + name: 'Number' + } + }, + isSpot: { + required: false, + serializedName: 'properties.isSpot', + type: { + name: 'Boolean' + } + }, + spotExpirationTime: { + required: false, + serializedName: 'properties.spotExpirationTime', + type: { + name: 'DateTime' + } + }, + freeOfferExpirationTime: { + required: false, + serializedName: 'properties.freeOfferExpirationTime', + type: { + name: 'DateTime' + } + }, + resourceGroup: { + required: false, + readOnly: true, + serializedName: 'properties.resourceGroup', + type: { + name: 'String' + } + }, + reserved: { + required: false, + serializedName: 'properties.reserved', + defaultValue: false, + type: { + name: 'Boolean' + } + }, + isXenon: { + required: false, + serializedName: 'properties.isXenon', + defaultValue: false, + type: { + name: 'Boolean' + } + }, + hyperV: { + required: false, + serializedName: 'properties.hyperV', + defaultValue: false, + type: { + name: 'Boolean' + } + }, + targetWorkerCount: { + required: false, + serializedName: 'properties.targetWorkerCount', + type: { + name: 'Number' + } + }, + targetWorkerSizeId: { + required: false, + serializedName: 'properties.targetWorkerSizeId', + type: { + name: 'Number' + } + }, + provisioningState: { + required: false, + readOnly: true, + serializedName: 'properties.provisioningState', + type: { + name: 'Enum', + allowedValues: [ 'Succeeded', 'Failed', 'Canceled', 'InProgress', 'Deleting' ] + } + }, + sku: { + required: false, + serializedName: 'sku', + type: { + name: 'Composite', + className: 'SkuDescription' + } + } + } + } + }; + } +} + +module.exports = AppServicePlan; diff --git a/lib/services/websiteManagement2/lib/models/appServicePlanCollection.js b/lib/services/websiteManagement2/lib/models/appServicePlanCollection.js new file mode 100644 index 0000000000..74827eafd6 --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/appServicePlanCollection.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 App Service plans. + */ +class AppServicePlanCollection extends Array { + /** + * Create a AppServicePlanCollection. + * @member {string} [nextLink] Link to next page of resources. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of AppServicePlanCollection + * + * @returns {object} metadata of AppServicePlanCollection + * + */ + mapper() { + return { + required: false, + serializedName: 'AppServicePlanCollection', + type: { + name: 'Composite', + className: 'AppServicePlanCollection', + modelProperties: { + value: { + required: true, + serializedName: '', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'AppServicePlanElementType', + type: { + name: 'Composite', + className: 'AppServicePlan' + } + } + } + }, + nextLink: { + required: false, + readOnly: true, + serializedName: 'nextLink', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = AppServicePlanCollection; diff --git a/lib/services/websiteManagement2/lib/models/appServicePlanPatchResource.js b/lib/services/websiteManagement2/lib/models/appServicePlanPatchResource.js new file mode 100644 index 0000000000..fadfdd4068 --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/appServicePlanPatchResource.js @@ -0,0 +1,269 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * ARM resource for a app service plan. + * + * @extends models['ProxyOnlyResource'] + */ +class AppServicePlanPatchResource extends models['ProxyOnlyResource'] { + /** + * Create a AppServicePlanPatchResource. + * @member {string} [workerTierName] Target worker tier assigned to the App + * Service plan. + * @member {string} [status] App Service plan status. Possible values + * include: 'Ready', 'Pending', 'Creating' + * @member {string} [subscription] App Service plan subscription. + * @member {string} [adminSiteName] App Service plan administration site. + * @member {object} [hostingEnvironmentProfile] Specification for the App + * Service Environment to use for the App Service plan. + * @member {string} [hostingEnvironmentProfile.id] Resource ID of the App + * Service Environment. + * @member {string} [hostingEnvironmentProfile.name] Name of the App Service + * Environment. + * @member {string} [hostingEnvironmentProfile.type] Resource type of the App + * Service Environment. + * @member {number} [maximumNumberOfWorkers] Maximum number of instances that + * can be assigned to this App Service plan. + * @member {string} [geoRegion] Geographical location for the App Service + * plan. + * @member {boolean} [perSiteScaling] If true, apps assigned to + * this App Service plan can be scaled independently. + * If false, apps assigned to this App Service plan will scale + * to all instances of the plan. Default value: false . + * @member {number} [numberOfSites] Number of apps assigned to this App + * Service plan. + * @member {boolean} [isSpot] If true, this App Service Plan + * owns spot instances. + * @member {date} [spotExpirationTime] The time when the server farm expires. + * Valid only if it is a spot server farm. + * @member {date} [freeOfferExpirationTime] The time when the server farm + * free offer expires. + * @member {string} [resourceGroup] Resource group of the App Service plan. + * @member {boolean} [reserved] If Linux app service plan true, + * false otherwise. Default value: false . + * @member {boolean} [isXenon] Obsolete: If Hyper-V container app service + * plan true, false otherwise. Default value: false + * . + * @member {boolean} [hyperV] If Hyper-V container app service plan + * true, false otherwise. Default value: false . + * @member {number} [targetWorkerCount] Scaling worker count. + * @member {number} [targetWorkerSizeId] Scaling worker size ID. + * @member {string} [provisioningState] Provisioning state of the App Service + * Environment. Possible values include: 'Succeeded', 'Failed', 'Canceled', + * 'InProgress', 'Deleting' + */ + constructor() { + super(); + } + + /** + * Defines the metadata of AppServicePlanPatchResource + * + * @returns {object} metadata of AppServicePlanPatchResource + * + */ + mapper() { + return { + required: false, + serializedName: 'AppServicePlanPatchResource', + type: { + name: 'Composite', + className: 'AppServicePlanPatchResource', + 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' + } + }, + workerTierName: { + required: false, + serializedName: 'properties.workerTierName', + type: { + name: 'String' + } + }, + status: { + required: false, + readOnly: true, + serializedName: 'properties.status', + type: { + name: 'Enum', + allowedValues: [ 'Ready', 'Pending', 'Creating' ] + } + }, + subscription: { + required: false, + readOnly: true, + serializedName: 'properties.subscription', + type: { + name: 'String' + } + }, + adminSiteName: { + required: false, + serializedName: 'properties.adminSiteName', + type: { + name: 'String' + } + }, + hostingEnvironmentProfile: { + required: false, + serializedName: 'properties.hostingEnvironmentProfile', + type: { + name: 'Composite', + className: 'HostingEnvironmentProfile' + } + }, + maximumNumberOfWorkers: { + required: false, + readOnly: true, + serializedName: 'properties.maximumNumberOfWorkers', + type: { + name: 'Number' + } + }, + geoRegion: { + required: false, + readOnly: true, + serializedName: 'properties.geoRegion', + type: { + name: 'String' + } + }, + perSiteScaling: { + required: false, + serializedName: 'properties.perSiteScaling', + defaultValue: false, + type: { + name: 'Boolean' + } + }, + numberOfSites: { + required: false, + readOnly: true, + serializedName: 'properties.numberOfSites', + type: { + name: 'Number' + } + }, + isSpot: { + required: false, + serializedName: 'properties.isSpot', + type: { + name: 'Boolean' + } + }, + spotExpirationTime: { + required: false, + serializedName: 'properties.spotExpirationTime', + type: { + name: 'DateTime' + } + }, + freeOfferExpirationTime: { + required: false, + serializedName: 'properties.freeOfferExpirationTime', + type: { + name: 'DateTime' + } + }, + resourceGroup: { + required: false, + readOnly: true, + serializedName: 'properties.resourceGroup', + type: { + name: 'String' + } + }, + reserved: { + required: false, + serializedName: 'properties.reserved', + defaultValue: false, + type: { + name: 'Boolean' + } + }, + isXenon: { + required: false, + serializedName: 'properties.isXenon', + defaultValue: false, + type: { + name: 'Boolean' + } + }, + hyperV: { + required: false, + serializedName: 'properties.hyperV', + defaultValue: false, + type: { + name: 'Boolean' + } + }, + targetWorkerCount: { + required: false, + serializedName: 'properties.targetWorkerCount', + type: { + name: 'Number' + } + }, + targetWorkerSizeId: { + required: false, + serializedName: 'properties.targetWorkerSizeId', + type: { + name: 'Number' + } + }, + provisioningState: { + required: false, + readOnly: true, + serializedName: 'properties.provisioningState', + type: { + name: 'Enum', + allowedValues: [ 'Succeeded', 'Failed', 'Canceled', 'InProgress', 'Deleting' ] + } + } + } + } + }; + } +} + +module.exports = AppServicePlanPatchResource; diff --git a/lib/services/websiteManagement2/lib/models/applicationLogsConfig.js b/lib/services/websiteManagement2/lib/models/applicationLogsConfig.js index f807ba5142..ab1e59ff5f 100644 --- a/lib/services/websiteManagement2/lib/models/applicationLogsConfig.js +++ b/lib/services/websiteManagement2/lib/models/applicationLogsConfig.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * Application logs configuration. * diff --git a/lib/services/websiteManagement2/lib/models/applicationStack.js b/lib/services/websiteManagement2/lib/models/applicationStack.js index 0a52694422..50974c2600 100644 --- a/lib/services/websiteManagement2/lib/models/applicationStack.js +++ b/lib/services/websiteManagement2/lib/models/applicationStack.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * Application stack. * diff --git a/lib/services/websiteManagement2/lib/models/autoHealActions.js b/lib/services/websiteManagement2/lib/models/autoHealActions.js index c88cabffef..87cba99f34 100644 --- a/lib/services/websiteManagement2/lib/models/autoHealActions.js +++ b/lib/services/websiteManagement2/lib/models/autoHealActions.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * Actions which to take by the auto-heal module when a rule is triggered. * diff --git a/lib/services/websiteManagement2/lib/models/autoHealRules.js b/lib/services/websiteManagement2/lib/models/autoHealRules.js index 345b953e39..d2975a1396 100644 --- a/lib/services/websiteManagement2/lib/models/autoHealRules.js +++ b/lib/services/websiteManagement2/lib/models/autoHealRules.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * Rules that can be defined for auto-heal. * diff --git a/lib/services/websiteManagement2/lib/models/autoHealTriggers.js b/lib/services/websiteManagement2/lib/models/autoHealTriggers.js index 7d60dca06e..f14f8dd067 100644 --- a/lib/services/websiteManagement2/lib/models/autoHealTriggers.js +++ b/lib/services/websiteManagement2/lib/models/autoHealTriggers.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * Triggers for auto-heal. * diff --git a/lib/services/websiteManagement2/lib/models/azureStorageInfoValue.js b/lib/services/websiteManagement2/lib/models/azureStorageInfoValue.js new file mode 100644 index 0000000000..e30422f824 --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/azureStorageInfoValue.js @@ -0,0 +1,99 @@ +/* + * 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'; + +/** + * Azure Files or Blob Storage access information value for dictionary storage. + * + */ +class AzureStorageInfoValue { + /** + * Create a AzureStorageInfoValue. + * @member {string} [type] Type of storage. Possible values include: + * 'AzureFiles', 'AzureBlob' + * @member {string} [accountName] Name of the storage account. + * @member {string} [shareName] Name of the file share (container name, for + * Blob storage). + * @member {string} [accessKey] Access key for the storage account. + * @member {string} [mountPath] Path to mount the storage within the site's + * runtime environment. + * @member {string} [state] State of the storage account. Possible values + * include: 'Ok', 'InvalidCredentials', 'InvalidShare' + */ + constructor() { + } + + /** + * Defines the metadata of AzureStorageInfoValue + * + * @returns {object} metadata of AzureStorageInfoValue + * + */ + mapper() { + return { + required: false, + serializedName: 'AzureStorageInfoValue', + type: { + name: 'Composite', + className: 'AzureStorageInfoValue', + modelProperties: { + type: { + required: false, + serializedName: 'type', + type: { + name: 'Enum', + allowedValues: [ 'AzureFiles', 'AzureBlob' ] + } + }, + accountName: { + required: false, + serializedName: 'accountName', + type: { + name: 'String' + } + }, + shareName: { + required: false, + serializedName: 'shareName', + type: { + name: 'String' + } + }, + accessKey: { + required: false, + serializedName: 'accessKey', + type: { + name: 'String' + } + }, + mountPath: { + required: false, + serializedName: 'mountPath', + type: { + name: 'String' + } + }, + state: { + required: false, + readOnly: true, + serializedName: 'state', + type: { + name: 'Enum', + allowedValues: [ 'Ok', 'InvalidCredentials', 'InvalidShare' ] + } + } + } + } + }; + } +} + +module.exports = AzureStorageInfoValue; diff --git a/lib/services/websiteManagement2/lib/models/azureStoragePropertyDictionaryResource.js b/lib/services/websiteManagement2/lib/models/azureStoragePropertyDictionaryResource.js new file mode 100644 index 0000000000..0b1b19dc61 --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/azureStoragePropertyDictionaryResource.js @@ -0,0 +1,95 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * AzureStorageInfo dictionary resource. + * + * @extends models['ProxyOnlyResource'] + */ +class AzureStoragePropertyDictionaryResource extends models['ProxyOnlyResource'] { + /** + * Create a AzureStoragePropertyDictionaryResource. + * @member {object} [properties] Azure storage accounts. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of AzureStoragePropertyDictionaryResource + * + * @returns {object} metadata of AzureStoragePropertyDictionaryResource + * + */ + mapper() { + return { + required: false, + serializedName: 'AzureStoragePropertyDictionaryResource', + type: { + name: 'Composite', + className: 'AzureStoragePropertyDictionaryResource', + 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' + } + }, + properties: { + required: false, + serializedName: 'properties', + type: { + name: 'Dictionary', + value: { + required: false, + serializedName: 'AzureStorageInfoValueElementType', + type: { + name: 'Composite', + className: 'AzureStorageInfoValue' + } + } + } + } + } + } + }; + } +} + +module.exports = AzureStoragePropertyDictionaryResource; diff --git a/lib/services/websiteManagement2/lib/models/backupRequest.js b/lib/services/websiteManagement2/lib/models/backupRequest.js new file mode 100644 index 0000000000..d2d1195789 --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/backupRequest.js @@ -0,0 +1,147 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Description of a backup which will be performed. + * + * @extends models['ProxyOnlyResource'] + */ +class BackupRequest extends models['ProxyOnlyResource'] { + /** + * Create a BackupRequest. + * @member {string} [backupName] Name of the backup. + * @member {boolean} [enabled] True if the backup schedule is enabled (must + * be included in that case), false if the backup schedule should be + * disabled. + * @member {string} storageAccountUrl SAS URL to the container. + * @member {object} [backupSchedule] Schedule for the backup if it is + * executed periodically. + * @member {number} [backupSchedule.frequencyInterval] How often the backup + * should be executed (e.g. for weekly backup, this should be set to 7 and + * FrequencyUnit should be set to Day) + * @member {string} [backupSchedule.frequencyUnit] The unit of time for how + * often the backup should be executed (e.g. for weekly backup, this should + * be set to Day and FrequencyInterval should be set to 7). Possible values + * include: 'Day', 'Hour' + * @member {boolean} [backupSchedule.keepAtLeastOneBackup] True if the + * retention policy should always keep at least one backup in the storage + * account, regardless how old it is; false otherwise. + * @member {number} [backupSchedule.retentionPeriodInDays] After how many + * days backups should be deleted. + * @member {date} [backupSchedule.startTime] When the schedule should start + * working. + * @member {date} [backupSchedule.lastExecutionTime] Last time when this + * schedule was triggered. + * @member {array} [databases] Databases included in the backup. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of BackupRequest + * + * @returns {object} metadata of BackupRequest + * + */ + mapper() { + return { + required: false, + serializedName: 'BackupRequest', + type: { + name: 'Composite', + className: 'BackupRequest', + 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' + } + }, + backupName: { + required: false, + serializedName: 'properties.backupName', + type: { + name: 'String' + } + }, + enabled: { + required: false, + serializedName: 'properties.enabled', + type: { + name: 'Boolean' + } + }, + storageAccountUrl: { + required: true, + serializedName: 'properties.storageAccountUrl', + type: { + name: 'String' + } + }, + backupSchedule: { + required: false, + serializedName: 'properties.backupSchedule', + type: { + name: 'Composite', + className: 'BackupSchedule' + } + }, + databases: { + required: false, + serializedName: 'properties.databases', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'DatabaseBackupSettingElementType', + type: { + name: 'Composite', + className: 'DatabaseBackupSetting' + } + } + } + } + } + } + }; + } +} + +module.exports = BackupRequest; diff --git a/lib/services/websiteManagement2/lib/models/certificate.js b/lib/services/websiteManagement2/lib/models/certificate.js new file mode 100644 index 0000000000..f7b9f4da55 --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/certificate.js @@ -0,0 +1,288 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * SSL certificate for an app. + * + * @extends models['Resource'] + */ +class Certificate extends models['Resource'] { + /** + * Create a Certificate. + * @member {string} [friendlyName] Friendly name of the certificate. + * @member {string} [subjectName] Subject name of the certificate. + * @member {array} [hostNames] Host names the certificate applies to. + * @member {buffer} [pfxBlob] Pfx blob. + * @member {string} [siteName] App name. + * @member {string} [selfLink] Self link. + * @member {string} [issuer] Certificate issuer. + * @member {date} [issueDate] Certificate issue Date. + * @member {date} [expirationDate] Certificate expriration date. + * @member {string} password Certificate password. + * @member {string} [thumbprint] Certificate thumbprint. + * @member {boolean} [valid] Is the certificate valid?. + * @member {buffer} [cerBlob] Raw bytes of .cer file + * @member {string} [publicKeyHash] Public key hash. + * @member {object} [hostingEnvironmentProfile] Specification for the App + * Service Environment to use for the certificate. + * @member {string} [hostingEnvironmentProfile.id] Resource ID of the App + * Service Environment. + * @member {string} [hostingEnvironmentProfile.name] Name of the App Service + * Environment. + * @member {string} [hostingEnvironmentProfile.type] Resource type of the App + * Service Environment. + * @member {string} [keyVaultId] Key Vault Csm resource Id. + * @member {string} [keyVaultSecretName] Key Vault secret name. + * @member {string} [keyVaultSecretStatus] Status of the Key Vault secret. + * Possible values include: 'Initialized', 'WaitingOnCertificateOrder', + * 'Succeeded', 'CertificateOrderFailed', 'OperationNotPermittedOnKeyVault', + * 'AzureServiceUnauthorizedToAccessKeyVault', 'KeyVaultDoesNotExist', + * 'KeyVaultSecretDoesNotExist', 'UnknownError', 'ExternalPrivateKey', + * 'Unknown' + * @member {string} [serverFarmId] Resource ID of the associated App Service + * plan, formatted as: + * "/subscriptions/{subscriptionID}/resourceGroups/{groupName}/providers/Microsoft.Web/serverfarms/{appServicePlanName}". + */ + constructor() { + super(); + } + + /** + * Defines the metadata of Certificate + * + * @returns {object} metadata of Certificate + * + */ + mapper() { + return { + required: false, + serializedName: 'Certificate', + type: { + name: 'Composite', + className: 'Certificate', + 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' + } + }, + location: { + required: true, + serializedName: 'location', + type: { + name: 'String' + } + }, + type: { + required: false, + readOnly: true, + serializedName: 'type', + type: { + name: 'String' + } + }, + tags: { + required: false, + serializedName: 'tags', + type: { + name: 'Dictionary', + value: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + friendlyName: { + required: false, + readOnly: true, + serializedName: 'properties.friendlyName', + type: { + name: 'String' + } + }, + subjectName: { + required: false, + readOnly: true, + serializedName: 'properties.subjectName', + type: { + name: 'String' + } + }, + hostNames: { + required: false, + serializedName: 'properties.hostNames', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + pfxBlob: { + required: false, + serializedName: 'properties.pfxBlob', + type: { + name: 'ByteArray' + } + }, + siteName: { + required: false, + readOnly: true, + serializedName: 'properties.siteName', + type: { + name: 'String' + } + }, + selfLink: { + required: false, + readOnly: true, + serializedName: 'properties.selfLink', + type: { + name: 'String' + } + }, + issuer: { + required: false, + readOnly: true, + serializedName: 'properties.issuer', + type: { + name: 'String' + } + }, + issueDate: { + required: false, + readOnly: true, + serializedName: 'properties.issueDate', + type: { + name: 'DateTime' + } + }, + expirationDate: { + required: false, + readOnly: true, + serializedName: 'properties.expirationDate', + type: { + name: 'DateTime' + } + }, + password: { + required: true, + serializedName: 'properties.password', + type: { + name: 'String' + } + }, + thumbprint: { + required: false, + readOnly: true, + serializedName: 'properties.thumbprint', + type: { + name: 'String' + } + }, + valid: { + required: false, + readOnly: true, + serializedName: 'properties.valid', + type: { + name: 'Boolean' + } + }, + cerBlob: { + required: false, + readOnly: true, + serializedName: 'properties.cerBlob', + type: { + name: 'ByteArray' + } + }, + publicKeyHash: { + required: false, + readOnly: true, + serializedName: 'properties.publicKeyHash', + type: { + name: 'String' + } + }, + hostingEnvironmentProfile: { + required: false, + readOnly: true, + serializedName: 'properties.hostingEnvironmentProfile', + type: { + name: 'Composite', + className: 'HostingEnvironmentProfile' + } + }, + keyVaultId: { + required: false, + serializedName: 'properties.keyVaultId', + type: { + name: 'String' + } + }, + keyVaultSecretName: { + required: false, + serializedName: 'properties.keyVaultSecretName', + type: { + name: 'String' + } + }, + keyVaultSecretStatus: { + required: false, + readOnly: true, + serializedName: 'properties.keyVaultSecretStatus', + type: { + name: 'Enum', + allowedValues: [ 'Initialized', 'WaitingOnCertificateOrder', 'Succeeded', 'CertificateOrderFailed', 'OperationNotPermittedOnKeyVault', 'AzureServiceUnauthorizedToAccessKeyVault', 'KeyVaultDoesNotExist', 'KeyVaultSecretDoesNotExist', 'UnknownError', 'ExternalPrivateKey', 'Unknown' ] + } + }, + serverFarmId: { + required: false, + serializedName: 'properties.serverFarmId', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = Certificate; diff --git a/lib/services/websiteManagement2/lib/models/certificateOrderAction.js b/lib/services/websiteManagement2/lib/models/certificateOrderAction.js new file mode 100644 index 0000000000..123fb2ad46 --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/certificateOrderAction.js @@ -0,0 +1,104 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Certificate order action. + * + * @extends models['ProxyOnlyResource'] + */ +class CertificateOrderAction extends models['ProxyOnlyResource'] { + /** + * Create a CertificateOrderAction. + * @member {string} [actionType] Action type. Possible values include: + * 'CertificateIssued', 'CertificateOrderCanceled', + * 'CertificateOrderCreated', 'CertificateRevoked', + * 'DomainValidationComplete', 'FraudDetected', 'OrgNameChange', + * 'OrgValidationComplete', 'SanDrop', 'FraudCleared', 'CertificateExpired', + * 'CertificateExpirationWarning', 'FraudDocumentationRequired', 'Unknown' + * @member {date} [createdAt] Time at which the certificate action was + * performed. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of CertificateOrderAction + * + * @returns {object} metadata of CertificateOrderAction + * + */ + mapper() { + return { + required: false, + serializedName: 'CertificateOrderAction', + type: { + name: 'Composite', + className: 'CertificateOrderAction', + 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' + } + }, + actionType: { + required: false, + readOnly: true, + serializedName: 'properties.actionType', + type: { + name: 'Enum', + allowedValues: [ 'CertificateIssued', 'CertificateOrderCanceled', 'CertificateOrderCreated', 'CertificateRevoked', 'DomainValidationComplete', 'FraudDetected', 'OrgNameChange', 'OrgValidationComplete', 'SanDrop', 'FraudCleared', 'CertificateExpired', 'CertificateExpirationWarning', 'FraudDocumentationRequired', 'Unknown' ] + } + }, + createdAt: { + required: false, + readOnly: true, + serializedName: 'properties.createdAt', + type: { + name: 'DateTime' + } + } + } + } + }; + } +} + +module.exports = CertificateOrderAction; diff --git a/lib/services/websiteManagement2/lib/models/certificatePatchResource.js b/lib/services/websiteManagement2/lib/models/certificatePatchResource.js new file mode 100644 index 0000000000..708ccf5cf0 --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/certificatePatchResource.js @@ -0,0 +1,267 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * ARM resource for a certificate. + * + * @extends models['ProxyOnlyResource'] + */ +class CertificatePatchResource extends models['ProxyOnlyResource'] { + /** + * Create a CertificatePatchResource. + * @member {string} [friendlyName] Friendly name of the certificate. + * @member {string} [subjectName] Subject name of the certificate. + * @member {array} [hostNames] Host names the certificate applies to. + * @member {buffer} [pfxBlob] Pfx blob. + * @member {string} [siteName] App name. + * @member {string} [selfLink] Self link. + * @member {string} [issuer] Certificate issuer. + * @member {date} [issueDate] Certificate issue Date. + * @member {date} [expirationDate] Certificate expriration date. + * @member {string} password Certificate password. + * @member {string} [thumbprint] Certificate thumbprint. + * @member {boolean} [valid] Is the certificate valid?. + * @member {buffer} [cerBlob] Raw bytes of .cer file + * @member {string} [publicKeyHash] Public key hash. + * @member {object} [hostingEnvironmentProfile] Specification for the App + * Service Environment to use for the certificate. + * @member {string} [hostingEnvironmentProfile.id] Resource ID of the App + * Service Environment. + * @member {string} [hostingEnvironmentProfile.name] Name of the App Service + * Environment. + * @member {string} [hostingEnvironmentProfile.type] Resource type of the App + * Service Environment. + * @member {string} [keyVaultId] Key Vault Csm resource Id. + * @member {string} [keyVaultSecretName] Key Vault secret name. + * @member {string} [keyVaultSecretStatus] Status of the Key Vault secret. + * Possible values include: 'Initialized', 'WaitingOnCertificateOrder', + * 'Succeeded', 'CertificateOrderFailed', 'OperationNotPermittedOnKeyVault', + * 'AzureServiceUnauthorizedToAccessKeyVault', 'KeyVaultDoesNotExist', + * 'KeyVaultSecretDoesNotExist', 'UnknownError', 'ExternalPrivateKey', + * 'Unknown' + * @member {string} [serverFarmId] Resource ID of the associated App Service + * plan, formatted as: + * "/subscriptions/{subscriptionID}/resourceGroups/{groupName}/providers/Microsoft.Web/serverfarms/{appServicePlanName}". + */ + constructor() { + super(); + } + + /** + * Defines the metadata of CertificatePatchResource + * + * @returns {object} metadata of CertificatePatchResource + * + */ + mapper() { + return { + required: false, + serializedName: 'CertificatePatchResource', + type: { + name: 'Composite', + className: 'CertificatePatchResource', + 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' + } + }, + friendlyName: { + required: false, + readOnly: true, + serializedName: 'properties.friendlyName', + type: { + name: 'String' + } + }, + subjectName: { + required: false, + readOnly: true, + serializedName: 'properties.subjectName', + type: { + name: 'String' + } + }, + hostNames: { + required: false, + serializedName: 'properties.hostNames', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + pfxBlob: { + required: false, + serializedName: 'properties.pfxBlob', + type: { + name: 'ByteArray' + } + }, + siteName: { + required: false, + readOnly: true, + serializedName: 'properties.siteName', + type: { + name: 'String' + } + }, + selfLink: { + required: false, + readOnly: true, + serializedName: 'properties.selfLink', + type: { + name: 'String' + } + }, + issuer: { + required: false, + readOnly: true, + serializedName: 'properties.issuer', + type: { + name: 'String' + } + }, + issueDate: { + required: false, + readOnly: true, + serializedName: 'properties.issueDate', + type: { + name: 'DateTime' + } + }, + expirationDate: { + required: false, + readOnly: true, + serializedName: 'properties.expirationDate', + type: { + name: 'DateTime' + } + }, + password: { + required: true, + serializedName: 'properties.password', + type: { + name: 'String' + } + }, + thumbprint: { + required: false, + readOnly: true, + serializedName: 'properties.thumbprint', + type: { + name: 'String' + } + }, + valid: { + required: false, + readOnly: true, + serializedName: 'properties.valid', + type: { + name: 'Boolean' + } + }, + cerBlob: { + required: false, + readOnly: true, + serializedName: 'properties.cerBlob', + type: { + name: 'ByteArray' + } + }, + publicKeyHash: { + required: false, + readOnly: true, + serializedName: 'properties.publicKeyHash', + type: { + name: 'String' + } + }, + hostingEnvironmentProfile: { + required: false, + readOnly: true, + serializedName: 'properties.hostingEnvironmentProfile', + type: { + name: 'Composite', + className: 'HostingEnvironmentProfile' + } + }, + keyVaultId: { + required: false, + serializedName: 'properties.keyVaultId', + type: { + name: 'String' + } + }, + keyVaultSecretName: { + required: false, + serializedName: 'properties.keyVaultSecretName', + type: { + name: 'String' + } + }, + keyVaultSecretStatus: { + required: false, + readOnly: true, + serializedName: 'properties.keyVaultSecretStatus', + type: { + name: 'Enum', + allowedValues: [ 'Initialized', 'WaitingOnCertificateOrder', 'Succeeded', 'CertificateOrderFailed', 'OperationNotPermittedOnKeyVault', 'AzureServiceUnauthorizedToAccessKeyVault', 'KeyVaultDoesNotExist', 'KeyVaultSecretDoesNotExist', 'UnknownError', 'ExternalPrivateKey', 'Unknown' ] + } + }, + serverFarmId: { + required: false, + serializedName: 'properties.serverFarmId', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = CertificatePatchResource; diff --git a/lib/services/websiteManagement2/lib/models/cloningInfo.js b/lib/services/websiteManagement2/lib/models/cloningInfo.js new file mode 100644 index 0000000000..971b705122 --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/cloningInfo.js @@ -0,0 +1,150 @@ +/* + * 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'; + +/** + * Information needed for cloning operation. + * + */ +class CloningInfo { + /** + * Create a CloningInfo. + * @member {uuid} [correlationId] Correlation ID of cloning operation. This + * ID ties multiple cloning operations + * together to use the same snapshot. + * @member {boolean} [overwrite] true to overwrite destination + * app; otherwise, false. + * @member {boolean} [cloneCustomHostNames] true to clone custom + * hostnames from source app; otherwise, false. + * @member {boolean} [cloneSourceControl] true to clone source + * control from source app; otherwise, false. + * @member {string} sourceWebAppId ARM resource ID of the source app. App + * resource ID is of the form + * /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName} + * for production slots and + * /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/slots/{slotName} + * for other slots. + * @member {string} [hostingEnvironment] App Service Environment. + * @member {object} [appSettingsOverrides] Application setting overrides for + * cloned app. If specified, these settings override the settings cloned + * from source app. Otherwise, application settings from source app are + * retained. + * @member {boolean} [configureLoadBalancing] true to configure + * load balancing for source and destination app. + * @member {string} [trafficManagerProfileId] ARM resource ID of the Traffic + * Manager profile to use, if it exists. Traffic Manager resource ID is of + * the form + * /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/trafficManagerProfiles/{profileName}. + * @member {string} [trafficManagerProfileName] Name of Traffic Manager + * profile to create. This is only needed if Traffic Manager profile does not + * already exist. + */ + constructor() { + } + + /** + * Defines the metadata of CloningInfo + * + * @returns {object} metadata of CloningInfo + * + */ + mapper() { + return { + required: false, + serializedName: 'CloningInfo', + type: { + name: 'Composite', + className: 'CloningInfo', + modelProperties: { + correlationId: { + required: false, + serializedName: 'correlationId', + type: { + name: 'String' + } + }, + overwrite: { + required: false, + serializedName: 'overwrite', + type: { + name: 'Boolean' + } + }, + cloneCustomHostNames: { + required: false, + serializedName: 'cloneCustomHostNames', + type: { + name: 'Boolean' + } + }, + cloneSourceControl: { + required: false, + serializedName: 'cloneSourceControl', + type: { + name: 'Boolean' + } + }, + sourceWebAppId: { + required: true, + serializedName: 'sourceWebAppId', + type: { + name: 'String' + } + }, + hostingEnvironment: { + required: false, + serializedName: 'hostingEnvironment', + type: { + name: 'String' + } + }, + appSettingsOverrides: { + required: false, + serializedName: 'appSettingsOverrides', + type: { + name: 'Dictionary', + value: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + configureLoadBalancing: { + required: false, + serializedName: 'configureLoadBalancing', + type: { + name: 'Boolean' + } + }, + trafficManagerProfileId: { + required: false, + serializedName: 'trafficManagerProfileId', + type: { + name: 'String' + } + }, + trafficManagerProfileName: { + required: false, + serializedName: 'trafficManagerProfileName', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = CloningInfo; diff --git a/lib/services/websiteManagement2/lib/models/contact.js b/lib/services/websiteManagement2/lib/models/contact.js index c2d29b5130..d566aebb48 100644 --- a/lib/services/websiteManagement2/lib/models/contact.js +++ b/lib/services/websiteManagement2/lib/models/contact.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * Contact information for domain registration. If 'Domain Privacy' option is * not selected then the contact information is made publicly available through diff --git a/lib/services/websiteManagement2/lib/models/continuousWebJob.js b/lib/services/websiteManagement2/lib/models/continuousWebJob.js new file mode 100644 index 0000000000..7ae4000f49 --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/continuousWebJob.js @@ -0,0 +1,170 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Continuous Web Job Information. + * + * @extends models['ProxyOnlyResource'] + */ +class ContinuousWebJob extends models['ProxyOnlyResource'] { + /** + * Create a ContinuousWebJob. + * @member {string} [status] Job status. Possible values include: + * 'Initializing', 'Starting', 'Running', 'PendingRestart', 'Stopped' + * @member {string} [detailedStatus] Detailed status. + * @member {string} [logUrl] Log URL. + * @member {string} [runCommand] Run command. + * @member {string} [url] Job URL. + * @member {string} [extraInfoUrl] Extra Info URL. + * @member {string} [webJobType] Job type. Possible values include: + * 'Continuous', 'Triggered' + * @member {string} [error] Error information. + * @member {boolean} [usingSdk] Using SDK? + * @member {object} [settings] Job settings. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of ContinuousWebJob + * + * @returns {object} metadata of ContinuousWebJob + * + */ + mapper() { + return { + required: false, + serializedName: 'ContinuousWebJob', + type: { + name: 'Composite', + className: 'ContinuousWebJob', + 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' + } + }, + status: { + required: false, + serializedName: 'properties.status', + type: { + name: 'Enum', + allowedValues: [ 'Initializing', 'Starting', 'Running', 'PendingRestart', 'Stopped' ] + } + }, + detailedStatus: { + required: false, + serializedName: 'properties.detailed_status', + type: { + name: 'String' + } + }, + logUrl: { + required: false, + serializedName: 'properties.log_url', + type: { + name: 'String' + } + }, + runCommand: { + required: false, + serializedName: 'properties.run_command', + type: { + name: 'String' + } + }, + url: { + required: false, + serializedName: 'properties.url', + type: { + name: 'String' + } + }, + extraInfoUrl: { + required: false, + serializedName: 'properties.extra_info_url', + type: { + name: 'String' + } + }, + webJobType: { + required: false, + serializedName: 'properties.web_job_type', + type: { + name: 'Enum', + allowedValues: [ 'Continuous', 'Triggered' ] + } + }, + error: { + required: false, + serializedName: 'properties.error', + type: { + name: 'String' + } + }, + usingSdk: { + required: false, + serializedName: 'properties.using_sdk', + type: { + name: 'Boolean' + } + }, + settings: { + required: false, + serializedName: 'properties.settings', + type: { + name: 'Dictionary', + value: { + required: false, + serializedName: 'ObjectElementType', + type: { + name: 'Object' + } + } + } + } + } + } + }; + } +} + +module.exports = ContinuousWebJob; diff --git a/lib/services/websiteManagement2/lib/models/continuousWebJobCollection.js b/lib/services/websiteManagement2/lib/models/continuousWebJobCollection.js new file mode 100644 index 0000000000..5d82a581b7 --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/continuousWebJobCollection.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 Kudu continuous web job information elements. + */ +class ContinuousWebJobCollection extends Array { + /** + * Create a ContinuousWebJobCollection. + * @member {string} [nextLink] Link to next page of resources. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of ContinuousWebJobCollection + * + * @returns {object} metadata of ContinuousWebJobCollection + * + */ + mapper() { + return { + required: false, + serializedName: 'ContinuousWebJobCollection', + type: { + name: 'Composite', + className: 'ContinuousWebJobCollection', + modelProperties: { + value: { + required: true, + serializedName: '', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ContinuousWebJobElementType', + type: { + name: 'Composite', + className: 'ContinuousWebJob' + } + } + } + }, + nextLink: { + required: false, + readOnly: true, + serializedName: 'nextLink', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ContinuousWebJobCollection; diff --git a/lib/services/websiteManagement2/lib/models/csmOperationDescription.js b/lib/services/websiteManagement2/lib/models/csmOperationDescription.js new file mode 100644 index 0000000000..e22042e62d --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/csmOperationDescription.js @@ -0,0 +1,85 @@ +/* + * 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'; + +/** + * Description of an operation available for Microsoft.Web resource provider. + * + */ +class CsmOperationDescription { + /** + * Create a CsmOperationDescription. + * @member {string} [name] + * @member {object} [display] + * @member {string} [display.provider] + * @member {string} [display.resource] + * @member {string} [display.operation] + * @member {string} [display.description] + * @member {string} [origin] + * @member {object} [properties] + * @member {object} [properties.serviceSpecification] + * @member {array} [properties.serviceSpecification.metricSpecifications] + * @member {array} [properties.serviceSpecification.logSpecifications] + */ + constructor() { + } + + /** + * Defines the metadata of CsmOperationDescription + * + * @returns {object} metadata of CsmOperationDescription + * + */ + mapper() { + return { + required: false, + serializedName: 'CsmOperationDescription', + type: { + name: 'Composite', + className: 'CsmOperationDescription', + modelProperties: { + name: { + required: false, + serializedName: 'name', + type: { + name: 'String' + } + }, + display: { + required: false, + serializedName: 'display', + type: { + name: 'Composite', + className: 'CsmOperationDisplay' + } + }, + origin: { + required: false, + serializedName: 'origin', + type: { + name: 'String' + } + }, + properties: { + required: false, + serializedName: 'properties', + type: { + name: 'Composite', + className: 'CsmOperationDescriptionProperties' + } + } + } + } + }; + } +} + +module.exports = CsmOperationDescription; diff --git a/lib/services/websiteManagement2/lib/models/csmOperationDescriptionProperties.js b/lib/services/websiteManagement2/lib/models/csmOperationDescriptionProperties.js new file mode 100644 index 0000000000..af0b006db8 --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/csmOperationDescriptionProperties.js @@ -0,0 +1,55 @@ +/* + * 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'; + +/** + * Properties available for a Microsoft.Web resource provider operation. + * + */ +class CsmOperationDescriptionProperties { + /** + * Create a CsmOperationDescriptionProperties. + * @member {object} [serviceSpecification] + * @member {array} [serviceSpecification.metricSpecifications] + * @member {array} [serviceSpecification.logSpecifications] + */ + constructor() { + } + + /** + * Defines the metadata of CsmOperationDescriptionProperties + * + * @returns {object} metadata of CsmOperationDescriptionProperties + * + */ + mapper() { + return { + required: false, + serializedName: 'CsmOperationDescriptionProperties', + type: { + name: 'Composite', + className: 'CsmOperationDescriptionProperties', + modelProperties: { + serviceSpecification: { + required: false, + serializedName: 'serviceSpecification', + type: { + name: 'Composite', + className: 'ServiceSpecification' + } + } + } + } + }; + } +} + +module.exports = CsmOperationDescriptionProperties; diff --git a/lib/services/websiteManagement2/lib/models/csmPublishingProfileOptions.js b/lib/services/websiteManagement2/lib/models/csmPublishingProfileOptions.js index 1311235ff5..2ff11f2d9c 100644 --- a/lib/services/websiteManagement2/lib/models/csmPublishingProfileOptions.js +++ b/lib/services/websiteManagement2/lib/models/csmPublishingProfileOptions.js @@ -21,6 +21,8 @@ class CsmPublishingProfileOptions { * FileZilla3 * WebDeploy -- default * Ftp. Possible values include: 'FileZilla3', 'WebDeploy', 'Ftp' + * @member {boolean} [includeDisasterRecoveryEndpoints] Include the + * DisasterRecover endpoint if true */ constructor() { } @@ -45,6 +47,13 @@ class CsmPublishingProfileOptions { type: { name: 'String' } + }, + includeDisasterRecoveryEndpoints: { + required: false, + serializedName: 'includeDisasterRecoveryEndpoints', + type: { + name: 'Boolean' + } } } } diff --git a/lib/services/websiteManagement2/lib/models/csmUsageQuota.js b/lib/services/websiteManagement2/lib/models/csmUsageQuota.js index 9d8687b3bc..6a7322c0d3 100644 --- a/lib/services/websiteManagement2/lib/models/csmUsageQuota.js +++ b/lib/services/websiteManagement2/lib/models/csmUsageQuota.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * Usage of the quota resource. * diff --git a/lib/services/websiteManagement2/lib/models/dataSource.js b/lib/services/websiteManagement2/lib/models/dataSource.js index 1e4d2a6438..480579c108 100644 --- a/lib/services/websiteManagement2/lib/models/dataSource.js +++ b/lib/services/websiteManagement2/lib/models/dataSource.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * Class representing data source used by the detectors * diff --git a/lib/services/websiteManagement2/lib/models/dataTableResponseObject.js b/lib/services/websiteManagement2/lib/models/dataTableResponseObject.js index 9b1b335eb2..5120ad3d04 100644 --- a/lib/services/websiteManagement2/lib/models/dataTableResponseObject.js +++ b/lib/services/websiteManagement2/lib/models/dataTableResponseObject.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * Data Table which defines columns and raw row values * diff --git a/lib/services/websiteManagement2/lib/models/defaultErrorResponse.js b/lib/services/websiteManagement2/lib/models/defaultErrorResponse.js index 7626a48a16..5a7ecbca5a 100644 --- a/lib/services/websiteManagement2/lib/models/defaultErrorResponse.js +++ b/lib/services/websiteManagement2/lib/models/defaultErrorResponse.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * App Service error response. * diff --git a/lib/services/websiteManagement2/lib/models/defaultErrorResponseError.js b/lib/services/websiteManagement2/lib/models/defaultErrorResponseError.js index db22658770..53e7b42b06 100644 --- a/lib/services/websiteManagement2/lib/models/defaultErrorResponseError.js +++ b/lib/services/websiteManagement2/lib/models/defaultErrorResponseError.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * Error model. * diff --git a/lib/services/websiteManagement2/lib/models/deletedSite.js b/lib/services/websiteManagement2/lib/models/deletedSite.js new file mode 100644 index 0000000000..3015110612 --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/deletedSite.js @@ -0,0 +1,143 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * A deleted app. + * + * @extends models['ProxyOnlyResource'] + */ +class DeletedSite extends models['ProxyOnlyResource'] { + /** + * Create a DeletedSite. + * @member {number} [deletedSiteId] Numeric id for the deleted site + * @member {string} [deletedTimestamp] Time in UTC when the app was deleted. + * @member {string} [subscription] Subscription containing the deleted site + * @member {string} [resourceGroup] ResourceGroup that contained the deleted + * site + * @member {string} [deletedSiteName] Name of the deleted site + * @member {string} [slot] Slot of the deleted site + * @member {string} [deletedSiteKind] Kind of site that was deleted + */ + constructor() { + super(); + } + + /** + * Defines the metadata of DeletedSite + * + * @returns {object} metadata of DeletedSite + * + */ + mapper() { + return { + required: false, + serializedName: 'DeletedSite', + type: { + name: 'Composite', + className: 'DeletedSite', + 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' + } + }, + deletedSiteId: { + required: false, + readOnly: true, + serializedName: 'properties.deletedSiteId', + type: { + name: 'Number' + } + }, + deletedTimestamp: { + required: false, + readOnly: true, + serializedName: 'properties.deletedTimestamp', + type: { + name: 'String' + } + }, + subscription: { + required: false, + readOnly: true, + serializedName: 'properties.subscription', + type: { + name: 'String' + } + }, + resourceGroup: { + required: false, + readOnly: true, + serializedName: 'properties.resourceGroup', + type: { + name: 'String' + } + }, + deletedSiteName: { + required: false, + readOnly: true, + serializedName: 'properties.deletedSiteName', + type: { + name: 'String' + } + }, + slot: { + required: false, + readOnly: true, + serializedName: 'properties.slot', + type: { + name: 'String' + } + }, + deletedSiteKind: { + required: false, + readOnly: true, + serializedName: 'properties.kind', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = DeletedSite; diff --git a/lib/services/websiteManagement2/lib/models/deployment.js b/lib/services/websiteManagement2/lib/models/deployment.js new file mode 100644 index 0000000000..f8fdc08349 --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/deployment.js @@ -0,0 +1,152 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * User crendentials used for publishing activity. + * + * @extends models['ProxyOnlyResource'] + */ +class Deployment extends models['ProxyOnlyResource'] { + /** + * Create a Deployment. + * @member {number} [status] Deployment status. + * @member {string} [message] Details about deployment status. + * @member {string} [author] Who authored the deployment. + * @member {string} [deployer] Who performed the deployment. + * @member {string} [authorEmail] Author email. + * @member {date} [startTime] Start time. + * @member {date} [endTime] End time. + * @member {boolean} [active] True if deployment is currently active, false + * if completed and null if not started. + * @member {string} [details] Details on deployment. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of Deployment + * + * @returns {object} metadata of Deployment + * + */ + mapper() { + return { + required: false, + serializedName: 'Deployment', + type: { + name: 'Composite', + className: 'Deployment', + 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' + } + }, + status: { + required: false, + serializedName: 'properties.status', + type: { + name: 'Number' + } + }, + message: { + required: false, + serializedName: 'properties.message', + type: { + name: 'String' + } + }, + author: { + required: false, + serializedName: 'properties.author', + type: { + name: 'String' + } + }, + deployer: { + required: false, + serializedName: 'properties.deployer', + type: { + name: 'String' + } + }, + authorEmail: { + required: false, + serializedName: 'properties.author_email', + type: { + name: 'String' + } + }, + startTime: { + required: false, + serializedName: 'properties.start_time', + type: { + name: 'DateTime' + } + }, + endTime: { + required: false, + serializedName: 'properties.end_time', + type: { + name: 'DateTime' + } + }, + active: { + required: false, + serializedName: 'properties.active', + type: { + name: 'Boolean' + } + }, + details: { + required: false, + serializedName: 'properties.details', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = Deployment; diff --git a/lib/services/websiteManagement2/lib/models/deploymentLocations.js b/lib/services/websiteManagement2/lib/models/deploymentLocations.js index ad15f8aec8..04d37df313 100644 --- a/lib/services/websiteManagement2/lib/models/deploymentLocations.js +++ b/lib/services/websiteManagement2/lib/models/deploymentLocations.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * List of available locations (regions or App Service Environments) for * deployment of App Service resources. diff --git a/lib/services/websiteManagement2/lib/models/detectorAbnormalTimePeriod.js b/lib/services/websiteManagement2/lib/models/detectorAbnormalTimePeriod.js index 4d97fd6c60..2080fbf6f4 100644 --- a/lib/services/websiteManagement2/lib/models/detectorAbnormalTimePeriod.js +++ b/lib/services/websiteManagement2/lib/models/detectorAbnormalTimePeriod.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * Class representing Abnormal Time Period detected. * diff --git a/lib/services/websiteManagement2/lib/models/diagnosticData.js b/lib/services/websiteManagement2/lib/models/diagnosticData.js index f3b0662a2e..515871b8d6 100644 --- a/lib/services/websiteManagement2/lib/models/diagnosticData.js +++ b/lib/services/websiteManagement2/lib/models/diagnosticData.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * Set of data with rendering instructions * diff --git a/lib/services/websiteManagement2/lib/models/diagnosticMetricSet.js b/lib/services/websiteManagement2/lib/models/diagnosticMetricSet.js index dec74d0fc2..f7cdef2b06 100644 --- a/lib/services/websiteManagement2/lib/models/diagnosticMetricSet.js +++ b/lib/services/websiteManagement2/lib/models/diagnosticMetricSet.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * Class representing Diagnostic Metric information * diff --git a/lib/services/websiteManagement2/lib/models/errorEntity.js b/lib/services/websiteManagement2/lib/models/errorEntity.js index 7fe76aef2e..36492b145d 100644 --- a/lib/services/websiteManagement2/lib/models/errorEntity.js +++ b/lib/services/websiteManagement2/lib/models/errorEntity.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * Body of the error response returned from the API. * diff --git a/lib/services/websiteManagement2/lib/models/experiments.js b/lib/services/websiteManagement2/lib/models/experiments.js index cf40478e30..3dd1828dcd 100644 --- a/lib/services/websiteManagement2/lib/models/experiments.js +++ b/lib/services/websiteManagement2/lib/models/experiments.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * Routing rules in production experiments. * diff --git a/lib/services/websiteManagement2/lib/models/functionEnvelope.js b/lib/services/websiteManagement2/lib/models/functionEnvelope.js new file mode 100644 index 0000000000..de01948153 --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/functionEnvelope.js @@ -0,0 +1,159 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Web Job Information. + * + * @extends models['ProxyOnlyResource'] + */ +class FunctionEnvelope extends models['ProxyOnlyResource'] { + /** + * Create a FunctionEnvelope. + * @member {string} [functionAppId] Function App ID. + * @member {string} [scriptRootPathHref] Script root path URI. + * @member {string} [scriptHref] Script URI. + * @member {string} [configHref] Config URI. + * @member {string} [secretsFileHref] Secrets file URI. + * @member {string} [href] Function URI. + * @member {object} [config] Config information. + * @member {object} [files] File list. + * @member {string} [testData] Test data used when testing via the Azure + * Portal. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of FunctionEnvelope + * + * @returns {object} metadata of FunctionEnvelope + * + */ + mapper() { + return { + required: false, + serializedName: 'FunctionEnvelope', + type: { + name: 'Composite', + className: 'FunctionEnvelope', + 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' + } + }, + functionAppId: { + required: false, + serializedName: 'properties.function_app_id', + type: { + name: 'String' + } + }, + scriptRootPathHref: { + required: false, + serializedName: 'properties.script_root_path_href', + type: { + name: 'String' + } + }, + scriptHref: { + required: false, + serializedName: 'properties.script_href', + type: { + name: 'String' + } + }, + configHref: { + required: false, + serializedName: 'properties.config_href', + type: { + name: 'String' + } + }, + secretsFileHref: { + required: false, + serializedName: 'properties.secrets_file_href', + type: { + name: 'String' + } + }, + href: { + required: false, + serializedName: 'properties.href', + type: { + name: 'String' + } + }, + config: { + required: false, + serializedName: 'properties.config', + type: { + name: 'Object' + } + }, + files: { + required: false, + serializedName: 'properties.files', + type: { + name: 'Dictionary', + value: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + testData: { + required: false, + serializedName: 'properties.test_data', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = FunctionEnvelope; diff --git a/lib/services/websiteManagement2/lib/models/functionSecrets.js b/lib/services/websiteManagement2/lib/models/functionSecrets.js new file mode 100644 index 0000000000..89769cbd49 --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/functionSecrets.js @@ -0,0 +1,95 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Function secrets. + * + * @extends models['ProxyOnlyResource'] + */ +class FunctionSecrets extends models['ProxyOnlyResource'] { + /** + * Create a FunctionSecrets. + * @member {string} [key] Secret key. + * @member {string} [triggerUrl] Trigger URL. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of FunctionSecrets + * + * @returns {object} metadata of FunctionSecrets + * + */ + mapper() { + return { + required: false, + serializedName: 'FunctionSecrets', + type: { + name: 'Composite', + className: 'FunctionSecrets', + 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' + } + }, + key: { + required: false, + serializedName: 'properties.key', + type: { + name: 'String' + } + }, + triggerUrl: { + required: false, + serializedName: 'properties.trigger_url', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = FunctionSecrets; diff --git a/lib/services/websiteManagement2/lib/models/geoRegion.js b/lib/services/websiteManagement2/lib/models/geoRegion.js new file mode 100644 index 0000000000..6488f76da4 --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/geoRegion.js @@ -0,0 +1,97 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Geographical region. + * + * @extends models['ProxyOnlyResource'] + */ +class GeoRegion extends models['ProxyOnlyResource'] { + /** + * Create a GeoRegion. + * @member {string} [description] Region description. + * @member {string} [displayName] Display name for region. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of GeoRegion + * + * @returns {object} metadata of GeoRegion + * + */ + mapper() { + return { + required: false, + serializedName: 'GeoRegion', + type: { + name: 'Composite', + className: 'GeoRegion', + 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' + } + }, + description: { + required: false, + readOnly: true, + serializedName: 'properties.description', + type: { + name: 'String' + } + }, + displayName: { + required: false, + readOnly: true, + serializedName: 'properties.displayName', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = GeoRegion; diff --git a/lib/services/websiteManagement2/lib/models/globalCsmSkuDescription.js b/lib/services/websiteManagement2/lib/models/globalCsmSkuDescription.js index 4e36a7f290..a2c77faba9 100644 --- a/lib/services/websiteManagement2/lib/models/globalCsmSkuDescription.js +++ b/lib/services/websiteManagement2/lib/models/globalCsmSkuDescription.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * A Global SKU Description. * diff --git a/lib/services/websiteManagement2/lib/models/handlerMapping.js b/lib/services/websiteManagement2/lib/models/handlerMapping.js new file mode 100644 index 0000000000..ee5dc87e3b --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/handlerMapping.js @@ -0,0 +1,74 @@ +/* + * 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 IIS handler mappings used to define which handler processes HTTP + * requests with certain extension. + * For example, it is used to configure php-cgi.exe process to handle all HTTP + * requests with *.php extension. + * + */ +class HandlerMapping { + /** + * Create a HandlerMapping. + * @member {string} [extension] Requests with this extension will be handled + * using the specified FastCGI application. + * @member {string} [scriptProcessor] The absolute path to the FastCGI + * application. + * @member {string} [argumentsProperty] Command-line arguments to be passed + * to the script processor. + */ + constructor() { + } + + /** + * Defines the metadata of HandlerMapping + * + * @returns {object} metadata of HandlerMapping + * + */ + mapper() { + return { + required: false, + serializedName: 'HandlerMapping', + type: { + name: 'Composite', + className: 'HandlerMapping', + modelProperties: { + extension: { + required: false, + serializedName: 'extension', + type: { + name: 'String' + } + }, + scriptProcessor: { + required: false, + serializedName: 'scriptProcessor', + type: { + name: 'String' + } + }, + argumentsProperty: { + required: false, + serializedName: 'arguments', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = HandlerMapping; diff --git a/lib/services/websiteManagement2/lib/models/httpLogsConfig.js b/lib/services/websiteManagement2/lib/models/httpLogsConfig.js index 2636ecd1ff..36309201ef 100644 --- a/lib/services/websiteManagement2/lib/models/httpLogsConfig.js +++ b/lib/services/websiteManagement2/lib/models/httpLogsConfig.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * Http logs configuration. * diff --git a/lib/services/websiteManagement2/lib/models/index.d.ts b/lib/services/websiteManagement2/lib/models/index.d.ts new file mode 100644 index 0000000000..972848d73d --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/index.d.ts @@ -0,0 +1,7602 @@ +/* + * 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. + */ + +import { BaseResource } from 'ms-rest-azure'; +import { CloudError } from 'ms-rest-azure'; +import * as moment from 'moment'; + +export { BaseResource } from 'ms-rest-azure'; +export { CloudError } from 'ms-rest-azure'; + + +/** + * @class + * Initializes a new instance of the AppServiceCertificate class. + * @constructor + * Key Vault container for a certificate that is purchased through Azure. + * + * @member {string} [keyVaultId] Key Vault resource Id. + * @member {string} [keyVaultSecretName] Key Vault secret name. + * @member {string} [provisioningState] Status of the Key Vault secret. + * Possible values include: 'Initialized', 'WaitingOnCertificateOrder', + * 'Succeeded', 'CertificateOrderFailed', 'OperationNotPermittedOnKeyVault', + * 'AzureServiceUnauthorizedToAccessKeyVault', 'KeyVaultDoesNotExist', + * 'KeyVaultSecretDoesNotExist', 'UnknownError', 'ExternalPrivateKey', + * 'Unknown' + */ +export interface AppServiceCertificate { + keyVaultId?: string; + keyVaultSecretName?: string; + readonly provisioningState?: string; +} + +/** + * @class + * Initializes a new instance of the Resource class. + * @constructor + * Azure resource. This resource is tracked in Azure Resource Manager + * + * @member {string} [id] Resource Id. + * @member {string} [name] Resource Name. + * @member {string} [kind] Kind of resource. + * @member {string} location Resource Location. + * @member {string} [type] Resource type. + * @member {object} [tags] Resource tags. + */ +export interface Resource extends BaseResource { + readonly id?: string; + readonly name?: string; + kind?: string; + location: string; + readonly type?: string; + tags?: { [propertyName: string]: string }; +} + +/** + * @class + * Initializes a new instance of the AppServiceCertificateResource class. + * @constructor + * Key Vault container ARM resource for a certificate that is purchased through + * Azure. + * + * @member {string} [keyVaultId] Key Vault resource Id. + * @member {string} [keyVaultSecretName] Key Vault secret name. + * @member {string} [provisioningState] Status of the Key Vault secret. + * Possible values include: 'Initialized', 'WaitingOnCertificateOrder', + * 'Succeeded', 'CertificateOrderFailed', 'OperationNotPermittedOnKeyVault', + * 'AzureServiceUnauthorizedToAccessKeyVault', 'KeyVaultDoesNotExist', + * 'KeyVaultSecretDoesNotExist', 'UnknownError', 'ExternalPrivateKey', + * 'Unknown' + */ +export interface AppServiceCertificateResource extends Resource { + keyVaultId?: string; + keyVaultSecretName?: string; + readonly provisioningState?: string; +} + +/** + * @class + * Initializes a new instance of the CertificateDetails class. + * @constructor + * SSL certificate details. + * + * @member {number} [version] Certificate Version. + * @member {string} [serialNumber] Certificate Serial Number. + * @member {string} [thumbprint] Certificate Thumbprint. + * @member {string} [subject] Certificate Subject. + * @member {date} [notBefore] Date Certificate is valid from. + * @member {date} [notAfter] Date Certificate is valid to. + * @member {string} [signatureAlgorithm] Certificate Signature algorithm. + * @member {string} [issuer] Certificate Issuer. + * @member {string} [rawData] Raw certificate data. + */ +export interface CertificateDetails { + readonly version?: number; + readonly serialNumber?: string; + readonly thumbprint?: string; + readonly subject?: string; + readonly notBefore?: Date; + readonly notAfter?: Date; + readonly signatureAlgorithm?: string; + readonly issuer?: string; + readonly rawData?: string; +} + +/** + * @class + * Initializes a new instance of the AppServiceCertificateOrder class. + * @constructor + * SSL certificate purchase order. + * + * @member {object} [certificates] State of the Key Vault secret. + * @member {string} [distinguishedName] Certificate distinguished name. + * @member {string} [domainVerificationToken] Domain verification token. + * @member {number} [validityInYears] Duration in years (must be between 1 and + * 3). Default value: 1 . + * @member {number} [keySize] Certificate key size. Default value: 2048 . + * @member {string} productType Certificate product type. Possible values + * include: 'StandardDomainValidatedSsl', 'StandardDomainValidatedWildCardSsl' + * @member {boolean} [autoRenew] true if the certificate should be + * automatically renewed when it expires; otherwise, false. + * Default value: true . + * @member {string} [provisioningState] Status of certificate order. Possible + * values include: 'Succeeded', 'Failed', 'Canceled', 'InProgress', 'Deleting' + * @member {string} [status] Current order status. Possible values include: + * 'Pendingissuance', 'Issued', 'Revoked', 'Canceled', 'Denied', + * 'Pendingrevocation', 'PendingRekey', 'Unused', 'Expired', 'NotSubmitted' + * @member {object} [signedCertificate] Signed certificate. + * @member {number} [signedCertificate.version] Certificate Version. + * @member {string} [signedCertificate.serialNumber] Certificate Serial Number. + * @member {string} [signedCertificate.thumbprint] Certificate Thumbprint. + * @member {string} [signedCertificate.subject] Certificate Subject. + * @member {date} [signedCertificate.notBefore] Date Certificate is valid from. + * @member {date} [signedCertificate.notAfter] Date Certificate is valid to. + * @member {string} [signedCertificate.signatureAlgorithm] Certificate + * Signature algorithm. + * @member {string} [signedCertificate.issuer] Certificate Issuer. + * @member {string} [signedCertificate.rawData] Raw certificate data. + * @member {string} [csr] Last CSR that was created for this order. + * @member {object} [intermediate] Intermediate certificate. + * @member {number} [intermediate.version] Certificate Version. + * @member {string} [intermediate.serialNumber] Certificate Serial Number. + * @member {string} [intermediate.thumbprint] Certificate Thumbprint. + * @member {string} [intermediate.subject] Certificate Subject. + * @member {date} [intermediate.notBefore] Date Certificate is valid from. + * @member {date} [intermediate.notAfter] Date Certificate is valid to. + * @member {string} [intermediate.signatureAlgorithm] Certificate Signature + * algorithm. + * @member {string} [intermediate.issuer] Certificate Issuer. + * @member {string} [intermediate.rawData] Raw certificate data. + * @member {object} [root] Root certificate. + * @member {number} [root.version] Certificate Version. + * @member {string} [root.serialNumber] Certificate Serial Number. + * @member {string} [root.thumbprint] Certificate Thumbprint. + * @member {string} [root.subject] Certificate Subject. + * @member {date} [root.notBefore] Date Certificate is valid from. + * @member {date} [root.notAfter] Date Certificate is valid to. + * @member {string} [root.signatureAlgorithm] Certificate Signature algorithm. + * @member {string} [root.issuer] Certificate Issuer. + * @member {string} [root.rawData] Raw certificate data. + * @member {string} [serialNumber] Current serial number of the certificate. + * @member {date} [lastCertificateIssuanceTime] Certificate last issuance time. + * @member {date} [expirationTime] Certificate expiration time. + * @member {boolean} [isPrivateKeyExternal] true if private key is + * external; otherwise, false. + * @member {array} [appServiceCertificateNotRenewableReasons] Reasons why App + * Service Certificate is not renewable at the current moment. + * @member {date} [nextAutoRenewalTimeStamp] Time stamp when the certificate + * would be auto renewed next + */ +export interface AppServiceCertificateOrder extends Resource { + certificates?: { [propertyName: string]: AppServiceCertificate }; + distinguishedName?: string; + readonly domainVerificationToken?: string; + validityInYears?: number; + keySize?: number; + productType: string; + autoRenew?: boolean; + readonly provisioningState?: string; + readonly status?: string; + readonly signedCertificate?: CertificateDetails; + csr?: string; + readonly intermediate?: CertificateDetails; + readonly root?: CertificateDetails; + readonly serialNumber?: string; + readonly lastCertificateIssuanceTime?: Date; + readonly expirationTime?: Date; + readonly isPrivateKeyExternal?: boolean; + readonly appServiceCertificateNotRenewableReasons?: string[]; + readonly nextAutoRenewalTimeStamp?: Date; +} + +/** + * @class + * Initializes a new instance of the ProxyOnlyResource class. + * @constructor + * Azure proxy only resource. This resource is not tracked by Azure Resource + * Manager. + * + * @member {string} [id] Resource Id. + * @member {string} [name] Resource Name. + * @member {string} [kind] Kind of resource. + * @member {string} [type] Resource type. + */ +export interface ProxyOnlyResource extends BaseResource { + readonly id?: string; + readonly name?: string; + kind?: string; + readonly type?: string; +} + +/** + * @class + * Initializes a new instance of the AppServiceCertificateOrderPatchResource class. + * @constructor + * ARM resource for a certificate order that is purchased through Azure. + * + * @member {object} [certificates] State of the Key Vault secret. + * @member {string} [distinguishedName] Certificate distinguished name. + * @member {string} [domainVerificationToken] Domain verification token. + * @member {number} [validityInYears] Duration in years (must be between 1 and + * 3). Default value: 1 . + * @member {number} [keySize] Certificate key size. Default value: 2048 . + * @member {string} productType Certificate product type. Possible values + * include: 'StandardDomainValidatedSsl', 'StandardDomainValidatedWildCardSsl' + * @member {boolean} [autoRenew] true if the certificate should be + * automatically renewed when it expires; otherwise, false. + * Default value: true . + * @member {string} [provisioningState] Status of certificate order. Possible + * values include: 'Succeeded', 'Failed', 'Canceled', 'InProgress', 'Deleting' + * @member {string} [status] Current order status. Possible values include: + * 'Pendingissuance', 'Issued', 'Revoked', 'Canceled', 'Denied', + * 'Pendingrevocation', 'PendingRekey', 'Unused', 'Expired', 'NotSubmitted' + * @member {object} [signedCertificate] Signed certificate. + * @member {number} [signedCertificate.version] Certificate Version. + * @member {string} [signedCertificate.serialNumber] Certificate Serial Number. + * @member {string} [signedCertificate.thumbprint] Certificate Thumbprint. + * @member {string} [signedCertificate.subject] Certificate Subject. + * @member {date} [signedCertificate.notBefore] Date Certificate is valid from. + * @member {date} [signedCertificate.notAfter] Date Certificate is valid to. + * @member {string} [signedCertificate.signatureAlgorithm] Certificate + * Signature algorithm. + * @member {string} [signedCertificate.issuer] Certificate Issuer. + * @member {string} [signedCertificate.rawData] Raw certificate data. + * @member {string} [csr] Last CSR that was created for this order. + * @member {object} [intermediate] Intermediate certificate. + * @member {number} [intermediate.version] Certificate Version. + * @member {string} [intermediate.serialNumber] Certificate Serial Number. + * @member {string} [intermediate.thumbprint] Certificate Thumbprint. + * @member {string} [intermediate.subject] Certificate Subject. + * @member {date} [intermediate.notBefore] Date Certificate is valid from. + * @member {date} [intermediate.notAfter] Date Certificate is valid to. + * @member {string} [intermediate.signatureAlgorithm] Certificate Signature + * algorithm. + * @member {string} [intermediate.issuer] Certificate Issuer. + * @member {string} [intermediate.rawData] Raw certificate data. + * @member {object} [root] Root certificate. + * @member {number} [root.version] Certificate Version. + * @member {string} [root.serialNumber] Certificate Serial Number. + * @member {string} [root.thumbprint] Certificate Thumbprint. + * @member {string} [root.subject] Certificate Subject. + * @member {date} [root.notBefore] Date Certificate is valid from. + * @member {date} [root.notAfter] Date Certificate is valid to. + * @member {string} [root.signatureAlgorithm] Certificate Signature algorithm. + * @member {string} [root.issuer] Certificate Issuer. + * @member {string} [root.rawData] Raw certificate data. + * @member {string} [serialNumber] Current serial number of the certificate. + * @member {date} [lastCertificateIssuanceTime] Certificate last issuance time. + * @member {date} [expirationTime] Certificate expiration time. + * @member {boolean} [isPrivateKeyExternal] true if private key is + * external; otherwise, false. + * @member {array} [appServiceCertificateNotRenewableReasons] Reasons why App + * Service Certificate is not renewable at the current moment. + * @member {date} [nextAutoRenewalTimeStamp] Time stamp when the certificate + * would be auto renewed next + */ +export interface AppServiceCertificateOrderPatchResource extends ProxyOnlyResource { + certificates?: { [propertyName: string]: AppServiceCertificate }; + distinguishedName?: string; + readonly domainVerificationToken?: string; + validityInYears?: number; + keySize?: number; + productType: string; + autoRenew?: boolean; + readonly provisioningState?: string; + readonly status?: string; + readonly signedCertificate?: CertificateDetails; + csr?: string; + readonly intermediate?: CertificateDetails; + readonly root?: CertificateDetails; + readonly serialNumber?: string; + readonly lastCertificateIssuanceTime?: Date; + readonly expirationTime?: Date; + readonly isPrivateKeyExternal?: boolean; + readonly appServiceCertificateNotRenewableReasons?: string[]; + readonly nextAutoRenewalTimeStamp?: Date; +} + +/** + * @class + * Initializes a new instance of the AppServiceCertificatePatchResource class. + * @constructor + * Key Vault container ARM resource for a certificate that is purchased through + * Azure. + * + * @member {string} [keyVaultId] Key Vault resource Id. + * @member {string} [keyVaultSecretName] Key Vault secret name. + * @member {string} [provisioningState] Status of the Key Vault secret. + * Possible values include: 'Initialized', 'WaitingOnCertificateOrder', + * 'Succeeded', 'CertificateOrderFailed', 'OperationNotPermittedOnKeyVault', + * 'AzureServiceUnauthorizedToAccessKeyVault', 'KeyVaultDoesNotExist', + * 'KeyVaultSecretDoesNotExist', 'UnknownError', 'ExternalPrivateKey', + * 'Unknown' + */ +export interface AppServiceCertificatePatchResource extends ProxyOnlyResource { + keyVaultId?: string; + keyVaultSecretName?: string; + readonly provisioningState?: string; +} + +/** + * @class + * Initializes a new instance of the CertificateEmail class. + * @constructor + * SSL certificate email. + * + * @member {string} [emailId] Email id. + * @member {date} [timeStamp] Time stamp. + */ +export interface CertificateEmail extends ProxyOnlyResource { + emailId?: string; + timeStamp?: Date; +} + +/** + * @class + * Initializes a new instance of the CertificateOrderAction class. + * @constructor + * Certificate order action. + * + * @member {string} [actionType] Action type. Possible values include: + * 'CertificateIssued', 'CertificateOrderCanceled', 'CertificateOrderCreated', + * 'CertificateRevoked', 'DomainValidationComplete', 'FraudDetected', + * 'OrgNameChange', 'OrgValidationComplete', 'SanDrop', 'FraudCleared', + * 'CertificateExpired', 'CertificateExpirationWarning', + * 'FraudDocumentationRequired', 'Unknown' + * @member {date} [createdAt] Time at which the certificate action was + * performed. + */ +export interface CertificateOrderAction extends ProxyOnlyResource { + readonly actionType?: string; + readonly createdAt?: Date; +} + +/** + * @class + * Initializes a new instance of the ReissueCertificateOrderRequest class. + * @constructor + * Class representing certificate reissue request. + * + * @member {number} [keySize] Certificate Key Size. + * @member {number} [delayExistingRevokeInHours] Delay in hours to revoke + * existing certificate after the new certificate is issued. + * @member {string} [csr] Csr to be used for re-key operation. + * @member {boolean} [isPrivateKeyExternal] Should we change the ASC type (from + * managed private key to external private key and vice versa). + */ +export interface ReissueCertificateOrderRequest extends ProxyOnlyResource { + keySize?: number; + delayExistingRevokeInHours?: number; + csr?: string; + isPrivateKeyExternal?: boolean; +} + +/** + * @class + * Initializes a new instance of the RenewCertificateOrderRequest class. + * @constructor + * Class representing certificate renew request. + * + * @member {number} [keySize] Certificate Key Size. + * @member {string} [csr] Csr to be used for re-key operation. + * @member {boolean} [isPrivateKeyExternal] Should we change the ASC type (from + * managed private key to external private key and vice versa). + */ +export interface RenewCertificateOrderRequest extends ProxyOnlyResource { + keySize?: number; + csr?: string; + isPrivateKeyExternal?: boolean; +} + +/** + * @class + * Initializes a new instance of the SiteSeal class. + * @constructor + * Site seal + * + * @member {string} html HTML snippet + */ +export interface SiteSeal { + html: string; +} + +/** + * @class + * Initializes a new instance of the SiteSealRequest class. + * @constructor + * Site seal request. + * + * @member {boolean} [lightTheme] If true use the light color + * theme for site seal; otherwise, use the default color theme. + * @member {string} [locale] Locale of site seal. + */ +export interface SiteSealRequest { + lightTheme?: boolean; + locale?: string; +} + +/** + * @class + * Initializes a new instance of the VnetRoute class. + * @constructor + * Virtual Network route contract used to pass routing information for a + * Virtual Network. + * + * @member {string} [startAddress] The starting address for this route. This + * may also include a CIDR notation, in which case the end address must not be + * specified. + * @member {string} [endAddress] The ending address for this route. If the + * start address is specified in CIDR notation, this must be omitted. + * @member {string} [routeType] The type of route this is: + * DEFAULT - By default, every app has routes to the local address ranges + * specified by RFC1918 + * INHERITED - Routes inherited from the real Virtual Network routes + * STATIC - Static route set on the app only + * + * These values will be used for syncing an app's routes with those from a + * Virtual Network. Possible values include: 'DEFAULT', 'INHERITED', 'STATIC' + */ +export interface VnetRoute extends ProxyOnlyResource { + startAddress?: string; + endAddress?: string; + routeType?: string; +} + +/** + * @class + * Initializes a new instance of the VnetInfo class. + * @constructor + * Virtual Network information contract. + * + * @member {string} [vnetResourceId] The Virtual Network's resource ID. + * @member {string} [certThumbprint] The client certificate thumbprint. + * @member {buffer} [certBlob] A certificate file (.cer) blob containing the + * public key of the private key used to authenticate a + * Point-To-Site VPN connection. + * @member {array} [routes] The routes that this Virtual Network connection + * uses. + * @member {boolean} [resyncRequired] true if a resync is + * required; otherwise, false. + * @member {string} [dnsServers] DNS servers to be used by this Virtual + * Network. This should be a comma-separated list of IP addresses. + */ +export interface VnetInfo extends ProxyOnlyResource { + vnetResourceId?: string; + readonly certThumbprint?: string; + certBlob?: Buffer; + readonly routes?: VnetRoute[]; + readonly resyncRequired?: boolean; + dnsServers?: string; +} + +/** + * @class + * Initializes a new instance of the VnetGateway class. + * @constructor + * The Virtual Network gateway contract. This is used to give the Virtual + * Network gateway access to the VPN package. + * + * @member {string} [vnetName] The Virtual Network name. + * @member {string} vpnPackageUri The URI where the VPN package can be + * downloaded. + */ +export interface VnetGateway extends ProxyOnlyResource { + vnetName?: string; + vpnPackageUri: string; +} + +/** + * @class + * Initializes a new instance of the User class. + * @constructor + * User crendentials used for publishing activity. + * + * @member {string} publishingUserName Username used for publishing. + * @member {string} [publishingPassword] Password used for publishing. + * @member {string} [publishingPasswordHash] Password hash used for publishing. + * @member {string} [publishingPasswordHashSalt] Password hash salt used for + * publishing. + * @member {string} [scmUri] Url of SCM site. + */ +export interface User extends ProxyOnlyResource { + publishingUserName: string; + publishingPassword?: string; + publishingPasswordHash?: string; + publishingPasswordHashSalt?: string; + scmUri?: string; +} + +/** + * @class + * Initializes a new instance of the Snapshot class. + * @constructor + * A snapshot of an app. + * + * @member {string} [time] The time the snapshot was taken. + */ +export interface Snapshot extends ProxyOnlyResource { + readonly time?: string; +} + +/** + * @class + * Initializes a new instance of the ResourceMetricAvailability class. + * @constructor + * Metrics availability and retention. + * + * @member {string} [timeGrain] Time grain . + * @member {string} [retention] Retention period for the current time grain. + */ +export interface ResourceMetricAvailability { + readonly timeGrain?: string; + readonly retention?: string; +} + +/** + * @class + * Initializes a new instance of the ResourceMetricDefinition class. + * @constructor + * Metadata for the metrics. + * + * @member {string} [unit] Unit of the metric. + * @member {string} [primaryAggregationType] Primary aggregation type. + * @member {array} [metricAvailabilities] List of time grains supported for the + * metric together with retention period. + * @member {string} [resourceUri] Resource URI. + * @member {object} [properties] Resource metric definition properties. + */ +export interface ResourceMetricDefinition extends ProxyOnlyResource { + readonly unit?: string; + readonly primaryAggregationType?: string; + readonly metricAvailabilities?: ResourceMetricAvailability[]; + readonly resourceUri?: string; + readonly properties?: { [propertyName: string]: string }; +} + +/** + * @class + * Initializes a new instance of the PushSettings class. + * @constructor + * Push settings for the App. + * + * @member {boolean} isPushEnabled Gets or sets a flag indicating whether the + * Push endpoint is enabled. + * @member {string} [tagWhitelistJson] Gets or sets a JSON string containing a + * list of tags that are whitelisted for use by the push registration endpoint. + * @member {string} [tagsRequiringAuth] Gets or sets a JSON string containing a + * list of tags that require user authentication to be used in the push + * registration endpoint. + * Tags can consist of alphanumeric characters and the following: + * '_', '@', '#', '.', ':', '-'. + * Validation should be performed at the PushRequestHandler. + * @member {string} [dynamicTagsJson] Gets or sets a JSON string containing a + * list of dynamic tags that will be evaluated from user claims in the push + * registration endpoint. + */ +export interface PushSettings extends ProxyOnlyResource { + isPushEnabled: boolean; + tagWhitelistJson?: string; + tagsRequiringAuth?: string; + dynamicTagsJson?: string; +} + +/** + * @class + * Initializes a new instance of the Identifier class. + * @constructor + * A domain specific resource identifier. + * + * @member {string} [identifierId] String representation of the identity. + */ +export interface Identifier extends ProxyOnlyResource { + identifierId?: string; +} + +/** + * @class + * Initializes a new instance of the HybridConnectionKey class. + * @constructor + * Hybrid Connection key contract. This has the send key name and value for a + * Hybrid Connection. + * + * @member {string} [sendKeyName] The name of the send key. + * @member {string} [sendKeyValue] The value of the send key. + */ +export interface HybridConnectionKey extends ProxyOnlyResource { + readonly sendKeyName?: string; + readonly sendKeyValue?: string; +} + +/** + * @class + * Initializes a new instance of the HybridConnection class. + * @constructor + * Hybrid Connection contract. This is used to configure a Hybrid Connection. + * + * @member {string} [serviceBusNamespace] The name of the Service Bus + * namespace. + * @member {string} [relayName] The name of the Service Bus relay. + * @member {string} [relayArmUri] The ARM URI to the Service Bus relay. + * @member {string} [hostname] The hostname of the endpoint. + * @member {number} [port] The port of the endpoint. + * @member {string} [sendKeyName] The name of the Service Bus key which has + * Send permissions. This is used to authenticate to Service Bus. + * @member {string} [sendKeyValue] The value of the Service Bus key. This is + * used to authenticate to Service Bus. In ARM this key will not be returned + * normally, use the POST /listKeys API instead. + * @member {string} [serviceBusSuffix] The suffix for the service bus endpoint. + * By default this is .servicebus.windows.net + */ +export interface HybridConnection extends ProxyOnlyResource { + serviceBusNamespace?: string; + relayName?: string; + relayArmUri?: string; + hostname?: string; + port?: number; + sendKeyName?: string; + sendKeyValue?: string; + serviceBusSuffix?: string; +} + +/** + * @class + * Initializes a new instance of the DeletedSite class. + * @constructor + * A deleted app. + * + * @member {number} [deletedSiteId] Numeric id for the deleted site + * @member {string} [deletedTimestamp] Time in UTC when the app was deleted. + * @member {string} [subscription] Subscription containing the deleted site + * @member {string} [resourceGroup] ResourceGroup that contained the deleted + * site + * @member {string} [deletedSiteName] Name of the deleted site + * @member {string} [slot] Slot of the deleted site + * @member {string} [deletedSiteKind] Kind of site that was deleted + */ +export interface DeletedSite extends ProxyOnlyResource { + readonly deletedSiteId?: number; + readonly deletedTimestamp?: string; + readonly subscription?: string; + readonly resourceGroup?: string; + readonly deletedSiteName?: string; + readonly slot?: string; + readonly deletedSiteKind?: string; +} + +/** + * @class + * Initializes a new instance of the ManagedServiceIdentity class. + * @constructor + * Managed service identity. + * + * @member {string} [type] Type of managed service identity. Possible values + * include: 'SystemAssigned', 'UserAssigned' + * @member {string} [tenantId] Tenant of managed service identity. + * @member {string} [principalId] Principal Id of managed service identity. + * @member {array} [identityIds] Array of UserAssigned managed service + * identities. + */ +export interface ManagedServiceIdentity { + type?: string; + readonly tenantId?: string; + readonly principalId?: string; + identityIds?: string[]; +} + +/** + * @class + * Initializes a new instance of the SlotSwapStatus class. + * @constructor + * The status of the last successfull slot swap operation. + * + * @member {date} [timestampUtc] The time the last successful slot swap + * completed. + * @member {string} [sourceSlotName] The source slot of the last swap + * operation. + * @member {string} [destinationSlotName] The destination slot of the last swap + * operation. + */ +export interface SlotSwapStatus { + readonly timestampUtc?: Date; + readonly sourceSlotName?: string; + readonly destinationSlotName?: string; +} + +/** + * @class + * Initializes a new instance of the CloningInfo class. + * @constructor + * Information needed for cloning operation. + * + * @member {uuid} [correlationId] Correlation ID of cloning operation. This ID + * ties multiple cloning operations + * together to use the same snapshot. + * @member {boolean} [overwrite] true to overwrite destination + * app; otherwise, false. + * @member {boolean} [cloneCustomHostNames] true to clone custom + * hostnames from source app; otherwise, false. + * @member {boolean} [cloneSourceControl] true to clone source + * control from source app; otherwise, false. + * @member {string} sourceWebAppId ARM resource ID of the source app. App + * resource ID is of the form + * /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName} + * for production slots and + * /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/slots/{slotName} + * for other slots. + * @member {string} [hostingEnvironment] App Service Environment. + * @member {object} [appSettingsOverrides] Application setting overrides for + * cloned app. If specified, these settings override the settings cloned + * from source app. Otherwise, application settings from source app are + * retained. + * @member {boolean} [configureLoadBalancing] true to configure + * load balancing for source and destination app. + * @member {string} [trafficManagerProfileId] ARM resource ID of the Traffic + * Manager profile to use, if it exists. Traffic Manager resource ID is of the + * form + * /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/trafficManagerProfiles/{profileName}. + * @member {string} [trafficManagerProfileName] Name of Traffic Manager profile + * to create. This is only needed if Traffic Manager profile does not already + * exist. + */ +export interface CloningInfo { + correlationId?: string; + overwrite?: boolean; + cloneCustomHostNames?: boolean; + cloneSourceControl?: boolean; + sourceWebAppId: string; + hostingEnvironment?: string; + appSettingsOverrides?: { [propertyName: string]: string }; + configureLoadBalancing?: boolean; + trafficManagerProfileId?: string; + trafficManagerProfileName?: string; +} + +/** + * @class + * Initializes a new instance of the HostingEnvironmentProfile class. + * @constructor + * Specification for an App Service Environment to use for this resource. + * + * @member {string} [id] Resource ID of the App Service Environment. + * @member {string} [name] Name of the App Service Environment. + * @member {string} [type] Resource type of the App Service Environment. + */ +export interface HostingEnvironmentProfile { + id?: string; + readonly name?: string; + readonly type?: string; +} + +/** + * @class + * Initializes a new instance of the IpSecurityRestriction class. + * @constructor + * IP security restriction on an app. + * + * @member {string} ipAddress IP address the security restriction is valid for. + * It can be in form of pure ipv4 address (required SubnetMask property) or + * CIDR notation such as ipv4/mask (leading bit match). For CIDR, + * SubnetMask property must not be specified. + * @member {string} [subnetMask] Subnet mask for the range of IP addresses the + * restriction is valid for. + * @member {string} [action] Allow or Deny access for this IP range. + * @member {string} [tag] Defines what this IP filter will be used for. This is + * to support IP filtering on proxies. Possible values include: 'Default', + * 'XffProxy' + * @member {number} [priority] Priority of IP restriction rule. + * @member {string} [name] IP restriction rule name. + * @member {string} [description] IP restriction rule description. + */ +export interface IpSecurityRestriction { + ipAddress: string; + subnetMask?: string; + action?: string; + tag?: string; + priority?: number; + name?: string; + description?: string; +} + +/** + * @class + * Initializes a new instance of the ApiDefinitionInfo class. + * @constructor + * Information about the formal API definition for the app. + * + * @member {string} [url] The URL of the API definition. + */ +export interface ApiDefinitionInfo { + url?: string; +} + +/** + * @class + * Initializes a new instance of the CorsSettings class. + * @constructor + * Cross-Origin Resource Sharing (CORS) settings for the app. + * + * @member {array} [allowedOrigins] Gets or sets the list of origins that + * should be allowed to make cross-origin + * calls (for example: http://example.com:12345). Use "*" to allow all. + */ +export interface CorsSettings { + allowedOrigins?: string[]; +} + +/** + * @class + * Initializes a new instance of the AutoHealCustomAction class. + * @constructor + * Custom action to be executed + * when an auto heal rule is triggered. + * + * @member {string} [exe] Executable to be run. + * @member {string} [parameters] Parameters for the executable. + */ +export interface AutoHealCustomAction { + exe?: string; + parameters?: string; +} + +/** + * @class + * Initializes a new instance of the AutoHealActions class. + * @constructor + * Actions which to take by the auto-heal module when a rule is triggered. + * + * @member {string} [actionType] Predefined action to be taken. Possible values + * include: 'Recycle', 'LogEvent', 'CustomAction' + * @member {object} [customAction] Custom action to be taken. + * @member {string} [customAction.exe] Executable to be run. + * @member {string} [customAction.parameters] Parameters for the executable. + * @member {string} [minProcessExecutionTime] Minimum time the process must + * execute + * before taking the action + */ +export interface AutoHealActions { + actionType?: string; + customAction?: AutoHealCustomAction; + minProcessExecutionTime?: string; +} + +/** + * @class + * Initializes a new instance of the SlowRequestsBasedTrigger class. + * @constructor + * Trigger based on request execution time. + * + * @member {string} [timeTaken] Time taken. + * @member {number} [count] Request Count. + * @member {string} [timeInterval] Time interval. + */ +export interface SlowRequestsBasedTrigger { + timeTaken?: string; + count?: number; + timeInterval?: string; +} + +/** + * @class + * Initializes a new instance of the StatusCodesBasedTrigger class. + * @constructor + * Trigger based on status code. + * + * @member {number} [status] HTTP status code. + * @member {number} [subStatus] Request Sub Status. + * @member {number} [win32Status] Win32 error code. + * @member {number} [count] Request Count. + * @member {string} [timeInterval] Time interval. + */ +export interface StatusCodesBasedTrigger { + status?: number; + subStatus?: number; + win32Status?: number; + count?: number; + timeInterval?: string; +} + +/** + * @class + * Initializes a new instance of the RequestsBasedTrigger class. + * @constructor + * Trigger based on total requests. + * + * @member {number} [count] Request Count. + * @member {string} [timeInterval] Time interval. + */ +export interface RequestsBasedTrigger { + count?: number; + timeInterval?: string; +} + +/** + * @class + * Initializes a new instance of the AutoHealTriggers class. + * @constructor + * Triggers for auto-heal. + * + * @member {object} [requests] A rule based on total requests. + * @member {number} [requests.count] Request Count. + * @member {string} [requests.timeInterval] Time interval. + * @member {number} [privateBytesInKB] A rule based on private bytes. + * @member {array} [statusCodes] A rule based on status codes. + * @member {object} [slowRequests] A rule based on request execution time. + * @member {string} [slowRequests.timeTaken] Time taken. + * @member {number} [slowRequests.count] Request Count. + * @member {string} [slowRequests.timeInterval] Time interval. + */ +export interface AutoHealTriggers { + requests?: RequestsBasedTrigger; + privateBytesInKB?: number; + statusCodes?: StatusCodesBasedTrigger[]; + slowRequests?: SlowRequestsBasedTrigger; +} + +/** + * @class + * Initializes a new instance of the AutoHealRules class. + * @constructor + * Rules that can be defined for auto-heal. + * + * @member {object} [triggers] Conditions that describe when to execute the + * auto-heal actions. + * @member {object} [triggers.requests] A rule based on total requests. + * @member {number} [triggers.requests.count] Request Count. + * @member {string} [triggers.requests.timeInterval] Time interval. + * @member {number} [triggers.privateBytesInKB] A rule based on private bytes. + * @member {array} [triggers.statusCodes] A rule based on status codes. + * @member {object} [triggers.slowRequests] A rule based on request execution + * time. + * @member {string} [triggers.slowRequests.timeTaken] Time taken. + * @member {number} [triggers.slowRequests.count] Request Count. + * @member {string} [triggers.slowRequests.timeInterval] Time interval. + * @member {object} [actions] Actions to be executed when a rule is triggered. + * @member {string} [actions.actionType] Predefined action to be taken. + * Possible values include: 'Recycle', 'LogEvent', 'CustomAction' + * @member {object} [actions.customAction] Custom action to be taken. + * @member {string} [actions.customAction.exe] Executable to be run. + * @member {string} [actions.customAction.parameters] Parameters for the + * executable. + * @member {string} [actions.minProcessExecutionTime] Minimum time the process + * must execute + * before taking the action + */ +export interface AutoHealRules { + triggers?: AutoHealTriggers; + actions?: AutoHealActions; +} + +/** + * @class + * Initializes a new instance of the SiteLimits class. + * @constructor + * Metric limits set on an app. + * + * @member {number} [maxPercentageCpu] Maximum allowed CPU usage percentage. + * @member {number} [maxMemoryInMb] Maximum allowed memory usage in MB. + * @member {number} [maxDiskSizeInMb] Maximum allowed disk size usage in MB. + */ +export interface SiteLimits { + maxPercentageCpu?: number; + maxMemoryInMb?: number; + maxDiskSizeInMb?: number; +} + +/** + * @class + * Initializes a new instance of the RampUpRule class. + * @constructor + * Routing rules for ramp up testing. This rule allows to redirect static + * traffic % to a slot or to gradually change routing % based on performance. + * + * @member {string} [actionHostName] Hostname of a slot to which the traffic + * will be redirected if decided to. E.g. myapp-stage.azurewebsites.net. + * @member {number} [reroutePercentage] Percentage of the traffic which will be + * redirected to ActionHostName. + * @member {number} [changeStep] In auto ramp up scenario this is the step to + * to add/remove from ReroutePercentage until it reaches + * MinReroutePercentage or MaxReroutePercentage. Site + * metrics are checked every N minutes specificed in + * ChangeIntervalInMinutes. + * Custom decision algorithm can be provided in TiPCallback site extension + * which URL can be specified in ChangeDecisionCallbackUrl. + * @member {number} [changeIntervalInMinutes] Specifies interval in mimuntes to + * reevaluate ReroutePercentage. + * @member {number} [minReroutePercentage] Specifies lower boundary above which + * ReroutePercentage will stay. + * @member {number} [maxReroutePercentage] Specifies upper boundary below which + * ReroutePercentage will stay. + * @member {string} [changeDecisionCallbackUrl] Custom decision algorithm can + * be provided in TiPCallback site extension which URL can be specified. See + * TiPCallback site extension for the scaffold and contracts. + * https://www.siteextensions.net/packages/TiPCallback/ + * @member {string} [name] Name of the routing rule. The recommended name would + * be to point to the slot which will receive the traffic in the experiment. + */ +export interface RampUpRule { + actionHostName?: string; + reroutePercentage?: number; + changeStep?: number; + changeIntervalInMinutes?: number; + minReroutePercentage?: number; + maxReroutePercentage?: number; + changeDecisionCallbackUrl?: string; + name?: string; +} + +/** + * @class + * Initializes a new instance of the Experiments class. + * @constructor + * Routing rules in production experiments. + * + * @member {array} [rampUpRules] List of ramp-up rules. + */ +export interface Experiments { + rampUpRules?: RampUpRule[]; +} + +/** + * @class + * Initializes a new instance of the VirtualDirectory class. + * @constructor + * Directory for virtual application. + * + * @member {string} [virtualPath] Path to virtual application. + * @member {string} [physicalPath] Physical path. + */ +export interface VirtualDirectory { + virtualPath?: string; + physicalPath?: string; +} + +/** + * @class + * Initializes a new instance of the VirtualApplication class. + * @constructor + * Virtual application in an app. + * + * @member {string} [virtualPath] Virtual path. + * @member {string} [physicalPath] Physical path. + * @member {boolean} [preloadEnabled] true if preloading is + * enabled; otherwise, false. + * @member {array} [virtualDirectories] Virtual directories for virtual + * application. + */ +export interface VirtualApplication { + virtualPath?: string; + physicalPath?: string; + preloadEnabled?: boolean; + virtualDirectories?: VirtualDirectory[]; +} + +/** + * @class + * Initializes a new instance of the HandlerMapping class. + * @constructor + * The IIS handler mappings used to define which handler processes HTTP + * requests with certain extension. + * For example, it is used to configure php-cgi.exe process to handle all HTTP + * requests with *.php extension. + * + * @member {string} [extension] Requests with this extension will be handled + * using the specified FastCGI application. + * @member {string} [scriptProcessor] The absolute path to the FastCGI + * application. + * @member {string} [argumentsProperty] Command-line arguments to be passed to + * the script processor. + */ +export interface HandlerMapping { + extension?: string; + scriptProcessor?: string; + argumentsProperty?: string; +} + +/** + * @class + * Initializes a new instance of the SiteMachineKey class. + * @constructor + * MachineKey of an app. + * + * @member {string} [validation] MachineKey validation. + * @member {string} [validationKey] Validation key. + * @member {string} [decryption] Algorithm used for decryption. + * @member {string} [decryptionKey] Decryption key. + */ +export interface SiteMachineKey { + validation?: string; + validationKey?: string; + decryption?: string; + decryptionKey?: string; +} + +/** + * @class + * Initializes a new instance of the ConnStringInfo class. + * @constructor + * Database connection string information. + * + * @member {string} [name] Name of connection string. + * @member {string} [connectionString] Connection string value. + * @member {string} [type] Type of database. Possible values include: 'MySql', + * 'SQLServer', 'SQLAzure', 'Custom', 'NotificationHub', 'ServiceBus', + * 'EventHub', 'ApiHub', 'DocDb', 'RedisCache', 'PostgreSQL' + */ +export interface ConnStringInfo { + name?: string; + connectionString?: string; + type?: string; +} + +/** + * @class + * Initializes a new instance of the AzureStorageInfoValue class. + * @constructor + * Azure Files or Blob Storage access information value for dictionary storage. + * + * @member {string} [type] Type of storage. Possible values include: + * 'AzureFiles', 'AzureBlob' + * @member {string} [accountName] Name of the storage account. + * @member {string} [shareName] Name of the file share (container name, for + * Blob storage). + * @member {string} [accessKey] Access key for the storage account. + * @member {string} [mountPath] Path to mount the storage within the site's + * runtime environment. + * @member {string} [state] State of the storage account. Possible values + * include: 'Ok', 'InvalidCredentials', 'InvalidShare' + */ +export interface AzureStorageInfoValue { + type?: string; + accountName?: string; + shareName?: string; + accessKey?: string; + mountPath?: string; + readonly state?: string; +} + +/** + * @class + * Initializes a new instance of the NameValuePair class. + * @constructor + * Name value pair. + * + * @member {string} [name] Pair name. + * @member {string} [value] Pair value. + */ +export interface NameValuePair { + name?: string; + value?: string; +} + +/** + * @class + * Initializes a new instance of the SiteConfig class. + * @constructor + * Configuration of an App Service app. + * + * @member {number} [numberOfWorkers] Number of workers. + * @member {array} [defaultDocuments] Default documents. + * @member {string} [netFrameworkVersion] .NET Framework version. Default + * value: 'v4.6' . + * @member {string} [phpVersion] Version of PHP. + * @member {string} [pythonVersion] Version of Python. + * @member {string} [nodeVersion] Version of Node.js. + * @member {string} [linuxFxVersion] Linux App Framework and version + * @member {string} [windowsFxVersion] Xenon App Framework and version + * @member {boolean} [requestTracingEnabled] true if request + * tracing is enabled; otherwise, false. + * @member {date} [requestTracingExpirationTime] Request tracing expiration + * time. + * @member {boolean} [remoteDebuggingEnabled] true if remote + * debugging is enabled; otherwise, false. + * @member {string} [remoteDebuggingVersion] Remote debugging version. + * @member {boolean} [httpLoggingEnabled] true if HTTP logging is + * enabled; otherwise, false. + * @member {number} [logsDirectorySizeLimit] HTTP logs directory size limit. + * @member {boolean} [detailedErrorLoggingEnabled] true if + * detailed error logging is enabled; otherwise, false. + * @member {string} [publishingUsername] Publishing user name. + * @member {array} [appSettings] Application settings. + * @member {object} [azureStorageAccounts] User-provided Azure storage + * accounts. + * @member {array} [connectionStrings] Connection strings. + * @member {object} [machineKey] Site MachineKey. + * @member {string} [machineKey.validation] MachineKey validation. + * @member {string} [machineKey.validationKey] Validation key. + * @member {string} [machineKey.decryption] Algorithm used for decryption. + * @member {string} [machineKey.decryptionKey] Decryption key. + * @member {array} [handlerMappings] Handler mappings. + * @member {string} [documentRoot] Document root. + * @member {string} [scmType] SCM type. Possible values include: 'None', + * 'Dropbox', 'Tfs', 'LocalGit', 'GitHub', 'CodePlexGit', 'CodePlexHg', + * 'BitbucketGit', 'BitbucketHg', 'ExternalGit', 'ExternalHg', 'OneDrive', + * 'VSO' + * @member {boolean} [use32BitWorkerProcess] true to use 32-bit + * worker process; otherwise, false. + * @member {boolean} [webSocketsEnabled] true if WebSocket is + * enabled; otherwise, false. + * @member {boolean} [alwaysOn] true if Always On is enabled; + * otherwise, false. + * @member {string} [javaVersion] Java version. + * @member {string} [javaContainer] Java container. + * @member {string} [javaContainerVersion] Java container version. + * @member {string} [appCommandLine] App command line to launch. + * @member {string} [managedPipelineMode] Managed pipeline mode. Possible + * values include: 'Integrated', 'Classic' + * @member {array} [virtualApplications] Virtual applications. + * @member {string} [loadBalancing] Site load balancing. Possible values + * include: 'WeightedRoundRobin', 'LeastRequests', 'LeastResponseTime', + * 'WeightedTotalTraffic', 'RequestHash' + * @member {object} [experiments] This is work around for polymophic types. + * @member {array} [experiments.rampUpRules] List of ramp-up rules. + * @member {object} [limits] Site limits. + * @member {number} [limits.maxPercentageCpu] Maximum allowed CPU usage + * percentage. + * @member {number} [limits.maxMemoryInMb] Maximum allowed memory usage in MB. + * @member {number} [limits.maxDiskSizeInMb] Maximum allowed disk size usage in + * MB. + * @member {boolean} [autoHealEnabled] true if Auto Heal is + * enabled; otherwise, false. + * @member {object} [autoHealRules] Auto Heal rules. + * @member {object} [autoHealRules.triggers] Conditions that describe when to + * execute the auto-heal actions. + * @member {object} [autoHealRules.triggers.requests] A rule based on total + * requests. + * @member {number} [autoHealRules.triggers.requests.count] Request Count. + * @member {string} [autoHealRules.triggers.requests.timeInterval] Time + * interval. + * @member {number} [autoHealRules.triggers.privateBytesInKB] A rule based on + * private bytes. + * @member {array} [autoHealRules.triggers.statusCodes] A rule based on status + * codes. + * @member {object} [autoHealRules.triggers.slowRequests] A rule based on + * request execution time. + * @member {string} [autoHealRules.triggers.slowRequests.timeTaken] Time taken. + * @member {number} [autoHealRules.triggers.slowRequests.count] Request Count. + * @member {string} [autoHealRules.triggers.slowRequests.timeInterval] Time + * interval. + * @member {object} [autoHealRules.actions] Actions to be executed when a rule + * is triggered. + * @member {string} [autoHealRules.actions.actionType] Predefined action to be + * taken. Possible values include: 'Recycle', 'LogEvent', 'CustomAction' + * @member {object} [autoHealRules.actions.customAction] Custom action to be + * taken. + * @member {string} [autoHealRules.actions.customAction.exe] Executable to be + * run. + * @member {string} [autoHealRules.actions.customAction.parameters] Parameters + * for the executable. + * @member {string} [autoHealRules.actions.minProcessExecutionTime] Minimum + * time the process must execute + * before taking the action + * @member {string} [tracingOptions] Tracing options. + * @member {string} [vnetName] Virtual Network name. + * @member {object} [cors] Cross-Origin Resource Sharing (CORS) settings. + * @member {array} [cors.allowedOrigins] Gets or sets the list of origins that + * should be allowed to make cross-origin + * calls (for example: http://example.com:12345). Use "*" to allow all. + * @member {object} [push] Push endpoint settings. + * @member {boolean} [push.isPushEnabled] Gets or sets a flag indicating + * whether the Push endpoint is enabled. + * @member {string} [push.tagWhitelistJson] Gets or sets a JSON string + * containing a list of tags that are whitelisted for use by the push + * registration endpoint. + * @member {string} [push.tagsRequiringAuth] Gets or sets a JSON string + * containing a list of tags that require user authentication to be used in the + * push registration endpoint. + * Tags can consist of alphanumeric characters and the following: + * '_', '@', '#', '.', ':', '-'. + * Validation should be performed at the PushRequestHandler. + * @member {string} [push.dynamicTagsJson] Gets or sets a JSON string + * containing a list of dynamic tags that will be evaluated from user claims in + * the push registration endpoint. + * @member {object} [apiDefinition] Information about the formal API definition + * for the app. + * @member {string} [apiDefinition.url] The URL of the API definition. + * @member {string} [autoSwapSlotName] Auto-swap slot name. + * @member {boolean} [localMySqlEnabled] true to enable local + * MySQL; otherwise, false. Default value: false . + * @member {number} [managedServiceIdentityId] Managed Service Identity Id + * @member {number} [xManagedServiceIdentityId] Explicit Managed Service + * Identity Id + * @member {array} [ipSecurityRestrictions] IP security restrictions. + * @member {boolean} [http20Enabled] Http20Enabled: configures a web site to + * allow clients to connect over http2.0. Default value: true . + * @member {string} [minTlsVersion] MinTlsVersion: configures the minimum + * version of TLS required for SSL requests. Possible values include: '1.0', + * '1.1', '1.2' + * @member {string} [ftpsState] State of FTP / FTPS service. Possible values + * include: 'AllAllowed', 'FtpsOnly', 'Disabled' + * @member {number} [reservedInstanceCount] Number of reserved instances. + * This setting only applies to the Consumption Plan + */ +export interface SiteConfig { + numberOfWorkers?: number; + defaultDocuments?: string[]; + netFrameworkVersion?: string; + phpVersion?: string; + pythonVersion?: string; + nodeVersion?: string; + linuxFxVersion?: string; + windowsFxVersion?: string; + requestTracingEnabled?: boolean; + requestTracingExpirationTime?: Date; + remoteDebuggingEnabled?: boolean; + remoteDebuggingVersion?: string; + httpLoggingEnabled?: boolean; + logsDirectorySizeLimit?: number; + detailedErrorLoggingEnabled?: boolean; + publishingUsername?: string; + appSettings?: NameValuePair[]; + azureStorageAccounts?: { [propertyName: string]: AzureStorageInfoValue }; + connectionStrings?: ConnStringInfo[]; + readonly machineKey?: SiteMachineKey; + handlerMappings?: HandlerMapping[]; + documentRoot?: string; + scmType?: string; + use32BitWorkerProcess?: boolean; + webSocketsEnabled?: boolean; + alwaysOn?: boolean; + javaVersion?: string; + javaContainer?: string; + javaContainerVersion?: string; + appCommandLine?: string; + managedPipelineMode?: string; + virtualApplications?: VirtualApplication[]; + loadBalancing?: string; + experiments?: Experiments; + limits?: SiteLimits; + autoHealEnabled?: boolean; + autoHealRules?: AutoHealRules; + tracingOptions?: string; + vnetName?: string; + cors?: CorsSettings; + push?: PushSettings; + apiDefinition?: ApiDefinitionInfo; + autoSwapSlotName?: string; + localMySqlEnabled?: boolean; + managedServiceIdentityId?: number; + xManagedServiceIdentityId?: number; + ipSecurityRestrictions?: IpSecurityRestriction[]; + http20Enabled?: boolean; + minTlsVersion?: string; + ftpsState?: string; + reservedInstanceCount?: number; +} + +/** + * @class + * Initializes a new instance of the HostNameSslState class. + * @constructor + * SSL-enabled hostname. + * + * @member {string} [name] Hostname. + * @member {string} [sslState] SSL type. Possible values include: 'Disabled', + * 'SniEnabled', 'IpBasedEnabled' + * @member {string} [virtualIP] Virtual IP address assigned to the hostname if + * IP based SSL is enabled. + * @member {string} [thumbprint] SSL certificate thumbprint. + * @member {boolean} [toUpdate] Set to true to update existing + * hostname. + * @member {string} [hostType] Indicates whether the hostname is a standard or + * repository hostname. Possible values include: 'Standard', 'Repository' + */ +export interface HostNameSslState { + name?: string; + sslState?: string; + virtualIP?: string; + thumbprint?: string; + toUpdate?: boolean; + hostType?: string; +} + +/** + * @class + * Initializes a new instance of the Site class. + * @constructor + * A web app, a mobile app backend, or an API app. + * + * @member {string} [state] Current state of the app. + * @member {array} [hostNames] Hostnames associated with the app. + * @member {string} [repositorySiteName] Name of the repository site. + * @member {string} [usageState] State indicating whether the app has exceeded + * its quota usage. Read-only. Possible values include: 'Normal', 'Exceeded' + * @member {boolean} [enabled] true if the app is enabled; + * otherwise, false. Setting this value to false disables the app + * (takes the app offline). + * @member {array} [enabledHostNames] Enabled hostnames for the app.Hostnames + * need to be assigned (see HostNames) AND enabled. Otherwise, + * the app is not served on those hostnames. + * @member {string} [availabilityState] Management information availability + * state for the app. Possible values include: 'Normal', 'Limited', + * 'DisasterRecoveryMode' + * @member {array} [hostNameSslStates] Hostname SSL states are used to manage + * the SSL bindings for app's hostnames. + * @member {string} [serverFarmId] Resource ID of the associated App Service + * plan, formatted as: + * "/subscriptions/{subscriptionID}/resourceGroups/{groupName}/providers/Microsoft.Web/serverfarms/{appServicePlanName}". + * @member {boolean} [reserved] true if reserved; otherwise, + * false. Default value: false . + * @member {boolean} [isXenon] Obsolete: Hyper-V sandbox. Default value: false + * . + * @member {boolean} [hyperV] Hyper-V sandbox. Default value: false . + * @member {date} [lastModifiedTimeUtc] Last time the app was modified, in UTC. + * Read-only. + * @member {object} [siteConfig] Configuration of the app. + * @member {number} [siteConfig.numberOfWorkers] Number of workers. + * @member {array} [siteConfig.defaultDocuments] Default documents. + * @member {string} [siteConfig.netFrameworkVersion] .NET Framework version. + * @member {string} [siteConfig.phpVersion] Version of PHP. + * @member {string} [siteConfig.pythonVersion] Version of Python. + * @member {string} [siteConfig.nodeVersion] Version of Node.js. + * @member {string} [siteConfig.linuxFxVersion] Linux App Framework and version + * @member {string} [siteConfig.windowsFxVersion] Xenon App Framework and + * version + * @member {boolean} [siteConfig.requestTracingEnabled] true if + * request tracing is enabled; otherwise, false. + * @member {date} [siteConfig.requestTracingExpirationTime] Request tracing + * expiration time. + * @member {boolean} [siteConfig.remoteDebuggingEnabled] true if + * remote debugging is enabled; otherwise, false. + * @member {string} [siteConfig.remoteDebuggingVersion] Remote debugging + * version. + * @member {boolean} [siteConfig.httpLoggingEnabled] true if HTTP + * logging is enabled; otherwise, false. + * @member {number} [siteConfig.logsDirectorySizeLimit] HTTP logs directory + * size limit. + * @member {boolean} [siteConfig.detailedErrorLoggingEnabled] true + * if detailed error logging is enabled; otherwise, false. + * @member {string} [siteConfig.publishingUsername] Publishing user name. + * @member {array} [siteConfig.appSettings] Application settings. + * @member {object} [siteConfig.azureStorageAccounts] User-provided Azure + * storage accounts. + * @member {array} [siteConfig.connectionStrings] Connection strings. + * @member {object} [siteConfig.machineKey] Site MachineKey. + * @member {string} [siteConfig.machineKey.validation] MachineKey validation. + * @member {string} [siteConfig.machineKey.validationKey] Validation key. + * @member {string} [siteConfig.machineKey.decryption] Algorithm used for + * decryption. + * @member {string} [siteConfig.machineKey.decryptionKey] Decryption key. + * @member {array} [siteConfig.handlerMappings] Handler mappings. + * @member {string} [siteConfig.documentRoot] Document root. + * @member {string} [siteConfig.scmType] SCM type. Possible values include: + * 'None', 'Dropbox', 'Tfs', 'LocalGit', 'GitHub', 'CodePlexGit', 'CodePlexHg', + * 'BitbucketGit', 'BitbucketHg', 'ExternalGit', 'ExternalHg', 'OneDrive', + * 'VSO' + * @member {boolean} [siteConfig.use32BitWorkerProcess] true to + * use 32-bit worker process; otherwise, false. + * @member {boolean} [siteConfig.webSocketsEnabled] true if + * WebSocket is enabled; otherwise, false. + * @member {boolean} [siteConfig.alwaysOn] true if Always On is + * enabled; otherwise, false. + * @member {string} [siteConfig.javaVersion] Java version. + * @member {string} [siteConfig.javaContainer] Java container. + * @member {string} [siteConfig.javaContainerVersion] Java container version. + * @member {string} [siteConfig.appCommandLine] App command line to launch. + * @member {string} [siteConfig.managedPipelineMode] Managed pipeline mode. + * Possible values include: 'Integrated', 'Classic' + * @member {array} [siteConfig.virtualApplications] Virtual applications. + * @member {string} [siteConfig.loadBalancing] Site load balancing. Possible + * values include: 'WeightedRoundRobin', 'LeastRequests', 'LeastResponseTime', + * 'WeightedTotalTraffic', 'RequestHash' + * @member {object} [siteConfig.experiments] This is work around for polymophic + * types. + * @member {array} [siteConfig.experiments.rampUpRules] List of ramp-up rules. + * @member {object} [siteConfig.limits] Site limits. + * @member {number} [siteConfig.limits.maxPercentageCpu] Maximum allowed CPU + * usage percentage. + * @member {number} [siteConfig.limits.maxMemoryInMb] Maximum allowed memory + * usage in MB. + * @member {number} [siteConfig.limits.maxDiskSizeInMb] Maximum allowed disk + * size usage in MB. + * @member {boolean} [siteConfig.autoHealEnabled] true if Auto + * Heal is enabled; otherwise, false. + * @member {object} [siteConfig.autoHealRules] Auto Heal rules. + * @member {object} [siteConfig.autoHealRules.triggers] Conditions that + * describe when to execute the auto-heal actions. + * @member {object} [siteConfig.autoHealRules.triggers.requests] A rule based + * on total requests. + * @member {number} [siteConfig.autoHealRules.triggers.requests.count] Request + * Count. + * @member {string} [siteConfig.autoHealRules.triggers.requests.timeInterval] + * Time interval. + * @member {number} [siteConfig.autoHealRules.triggers.privateBytesInKB] A rule + * based on private bytes. + * @member {array} [siteConfig.autoHealRules.triggers.statusCodes] A rule based + * on status codes. + * @member {object} [siteConfig.autoHealRules.triggers.slowRequests] A rule + * based on request execution time. + * @member {string} [siteConfig.autoHealRules.triggers.slowRequests.timeTaken] + * Time taken. + * @member {number} [siteConfig.autoHealRules.triggers.slowRequests.count] + * Request Count. + * @member {string} + * [siteConfig.autoHealRules.triggers.slowRequests.timeInterval] Time interval. + * @member {object} [siteConfig.autoHealRules.actions] Actions to be executed + * when a rule is triggered. + * @member {string} [siteConfig.autoHealRules.actions.actionType] Predefined + * action to be taken. Possible values include: 'Recycle', 'LogEvent', + * 'CustomAction' + * @member {object} [siteConfig.autoHealRules.actions.customAction] Custom + * action to be taken. + * @member {string} [siteConfig.autoHealRules.actions.customAction.exe] + * Executable to be run. + * @member {string} [siteConfig.autoHealRules.actions.customAction.parameters] + * Parameters for the executable. + * @member {string} [siteConfig.autoHealRules.actions.minProcessExecutionTime] + * Minimum time the process must execute + * before taking the action + * @member {string} [siteConfig.tracingOptions] Tracing options. + * @member {string} [siteConfig.vnetName] Virtual Network name. + * @member {object} [siteConfig.cors] Cross-Origin Resource Sharing (CORS) + * settings. + * @member {array} [siteConfig.cors.allowedOrigins] Gets or sets the list of + * origins that should be allowed to make cross-origin + * calls (for example: http://example.com:12345). Use "*" to allow all. + * @member {object} [siteConfig.push] Push endpoint settings. + * @member {boolean} [siteConfig.push.isPushEnabled] Gets or sets a flag + * indicating whether the Push endpoint is enabled. + * @member {string} [siteConfig.push.tagWhitelistJson] Gets or sets a JSON + * string containing a list of tags that are whitelisted for use by the push + * registration endpoint. + * @member {string} [siteConfig.push.tagsRequiringAuth] Gets or sets a JSON + * string containing a list of tags that require user authentication to be used + * in the push registration endpoint. + * Tags can consist of alphanumeric characters and the following: + * '_', '@', '#', '.', ':', '-'. + * Validation should be performed at the PushRequestHandler. + * @member {string} [siteConfig.push.dynamicTagsJson] Gets or sets a JSON + * string containing a list of dynamic tags that will be evaluated from user + * claims in the push registration endpoint. + * @member {object} [siteConfig.apiDefinition] Information about the formal API + * definition for the app. + * @member {string} [siteConfig.apiDefinition.url] The URL of the API + * definition. + * @member {string} [siteConfig.autoSwapSlotName] Auto-swap slot name. + * @member {boolean} [siteConfig.localMySqlEnabled] true to enable + * local MySQL; otherwise, false. + * @member {number} [siteConfig.managedServiceIdentityId] Managed Service + * Identity Id + * @member {number} [siteConfig.xManagedServiceIdentityId] Explicit Managed + * Service Identity Id + * @member {array} [siteConfig.ipSecurityRestrictions] IP security + * restrictions. + * @member {boolean} [siteConfig.http20Enabled] Http20Enabled: configures a web + * site to allow clients to connect over http2.0 + * @member {string} [siteConfig.minTlsVersion] MinTlsVersion: configures the + * minimum version of TLS required for SSL requests. Possible values include: + * '1.0', '1.1', '1.2' + * @member {string} [siteConfig.ftpsState] State of FTP / FTPS service. + * Possible values include: 'AllAllowed', 'FtpsOnly', 'Disabled' + * @member {number} [siteConfig.reservedInstanceCount] Number of reserved + * instances. + * This setting only applies to the Consumption Plan + * @member {array} [trafficManagerHostNames] Azure Traffic Manager hostnames + * associated with the app. Read-only. + * @member {boolean} [scmSiteAlsoStopped] true to stop SCM (KUDU) + * site when the app is stopped; otherwise, false. The default is + * false. Default value: false . + * @member {string} [targetSwapSlot] Specifies which deployment slot this app + * will swap into. Read-only. + * @member {object} [hostingEnvironmentProfile] App Service Environment to use + * for the app. + * @member {string} [hostingEnvironmentProfile.id] Resource ID of the App + * Service Environment. + * @member {string} [hostingEnvironmentProfile.name] Name of the App Service + * Environment. + * @member {string} [hostingEnvironmentProfile.type] Resource type of the App + * Service Environment. + * @member {boolean} [clientAffinityEnabled] true to enable client + * affinity; false to stop sending session affinity cookies, which + * route client requests in the same session to the same instance. Default is + * true. + * @member {boolean} [clientCertEnabled] true to enable client + * certificate authentication (TLS mutual authentication); otherwise, + * false. Default is false. + * @member {boolean} [hostNamesDisabled] true to disable the + * public hostnames of the app; otherwise, false. + * If true, the app is only accessible via API management process. + * @member {string} [outboundIpAddresses] List of IP addresses that the app + * uses for outbound connections (e.g. database access). Includes VIPs from + * tenants that site can be hosted with current settings. Read-only. + * @member {string} [possibleOutboundIpAddresses] List of IP addresses that the + * app uses for outbound connections (e.g. database access). Includes VIPs from + * all tenants. Read-only. + * @member {number} [containerSize] Size of the function container. + * @member {number} [dailyMemoryTimeQuota] Maximum allowed daily memory-time + * quota (applicable on dynamic apps only). + * @member {date} [suspendedTill] App suspended till in case memory-time quota + * is exceeded. + * @member {number} [maxNumberOfWorkers] Maximum number of workers. + * This only applies to Functions container. + * @member {object} [cloningInfo] If specified during app creation, the app is + * cloned from a source app. + * @member {uuid} [cloningInfo.correlationId] Correlation ID of cloning + * operation. This ID ties multiple cloning operations + * together to use the same snapshot. + * @member {boolean} [cloningInfo.overwrite] true to overwrite + * destination app; otherwise, false. + * @member {boolean} [cloningInfo.cloneCustomHostNames] true to + * clone custom hostnames from source app; otherwise, false. + * @member {boolean} [cloningInfo.cloneSourceControl] true to + * clone source control from source app; otherwise, false. + * @member {string} [cloningInfo.sourceWebAppId] ARM resource ID of the source + * app. App resource ID is of the form + * /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName} + * for production slots and + * /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/slots/{slotName} + * for other slots. + * @member {string} [cloningInfo.hostingEnvironment] App Service Environment. + * @member {object} [cloningInfo.appSettingsOverrides] Application setting + * overrides for cloned app. If specified, these settings override the settings + * cloned + * from source app. Otherwise, application settings from source app are + * retained. + * @member {boolean} [cloningInfo.configureLoadBalancing] true to + * configure load balancing for source and destination app. + * @member {string} [cloningInfo.trafficManagerProfileId] ARM resource ID of + * the Traffic Manager profile to use, if it exists. Traffic Manager resource + * ID is of the form + * /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/trafficManagerProfiles/{profileName}. + * @member {string} [cloningInfo.trafficManagerProfileName] Name of Traffic + * Manager profile to create. This is only needed if Traffic Manager profile + * does not already exist. + * @member {string} [resourceGroup] Name of the resource group the app belongs + * to. Read-only. + * @member {boolean} [isDefaultContainer] true if the app is a + * default container; otherwise, false. + * @member {string} [defaultHostName] Default hostname of the app. Read-only. + * @member {object} [slotSwapStatus] Status of the last deployment slot swap + * operation. + * @member {date} [slotSwapStatus.timestampUtc] The time the last successful + * slot swap completed. + * @member {string} [slotSwapStatus.sourceSlotName] The source slot of the last + * swap operation. + * @member {string} [slotSwapStatus.destinationSlotName] The destination slot + * of the last swap operation. + * @member {boolean} [httpsOnly] HttpsOnly: configures a web site to accept + * only https requests. Issues redirect for + * http requests + * @member {object} [identity] + * @member {string} [identity.type] Type of managed service identity. Possible + * values include: 'SystemAssigned', 'UserAssigned' + * @member {string} [identity.tenantId] Tenant of managed service identity. + * @member {string} [identity.principalId] Principal Id of managed service + * identity. + * @member {array} [identity.identityIds] Array of UserAssigned managed service + * identities. + */ +export interface Site extends Resource { + readonly state?: string; + readonly hostNames?: string[]; + readonly repositorySiteName?: string; + readonly usageState?: string; + enabled?: boolean; + readonly enabledHostNames?: string[]; + readonly availabilityState?: string; + hostNameSslStates?: HostNameSslState[]; + serverFarmId?: string; + reserved?: boolean; + isXenon?: boolean; + hyperV?: boolean; + readonly lastModifiedTimeUtc?: Date; + siteConfig?: SiteConfig; + readonly trafficManagerHostNames?: string[]; + scmSiteAlsoStopped?: boolean; + readonly targetSwapSlot?: string; + hostingEnvironmentProfile?: HostingEnvironmentProfile; + clientAffinityEnabled?: boolean; + clientCertEnabled?: boolean; + hostNamesDisabled?: boolean; + readonly outboundIpAddresses?: string; + readonly possibleOutboundIpAddresses?: string; + containerSize?: number; + dailyMemoryTimeQuota?: number; + readonly suspendedTill?: Date; + readonly maxNumberOfWorkers?: number; + cloningInfo?: CloningInfo; + readonly resourceGroup?: string; + readonly isDefaultContainer?: boolean; + readonly defaultHostName?: string; + readonly slotSwapStatus?: SlotSwapStatus; + httpsOnly?: boolean; + identity?: ManagedServiceIdentity; +} + +/** + * @class + * Initializes a new instance of the Capability class. + * @constructor + * Describes the capabilities/features allowed for a specific SKU. + * + * @member {string} [name] Name of the SKU capability. + * @member {string} [value] Value of the SKU capability. + * @member {string} [reason] Reason of the SKU capability. + */ +export interface Capability { + name?: string; + value?: string; + reason?: string; +} + +/** + * @class + * Initializes a new instance of the SkuCapacity class. + * @constructor + * Description of the App Service plan scale options. + * + * @member {number} [minimum] Minimum number of workers for this App Service + * plan SKU. + * @member {number} [maximum] Maximum number of workers for this App Service + * plan SKU. + * @member {number} [default] Default number of workers for this App Service + * plan SKU. + * @member {string} [scaleType] Available scale configurations for an App + * Service plan. + */ +export interface SkuCapacity { + minimum?: number; + maximum?: number; + default?: number; + scaleType?: string; +} + +/** + * @class + * Initializes a new instance of the SkuDescription class. + * @constructor + * Description of a SKU for a scalable resource. + * + * @member {string} [name] Name of the resource SKU. + * @member {string} [tier] Service tier of the resource SKU. + * @member {string} [size] Size specifier of the resource SKU. + * @member {string} [family] Family code of the resource SKU. + * @member {number} [capacity] Current number of instances assigned to the + * resource. + * @member {object} [skuCapacity] Min, max, and default scale values of the + * SKU. + * @member {number} [skuCapacity.minimum] Minimum number of workers for this + * App Service plan SKU. + * @member {number} [skuCapacity.maximum] Maximum number of workers for this + * App Service plan SKU. + * @member {number} [skuCapacity.default] Default number of workers for this + * App Service plan SKU. + * @member {string} [skuCapacity.scaleType] Available scale configurations for + * an App Service plan. + * @member {array} [locations] Locations of the SKU. + * @member {array} [capabilities] Capabilities of the SKU, e.g., is traffic + * manager enabled? + */ +export interface SkuDescription { + name?: string; + tier?: string; + size?: string; + family?: string; + capacity?: number; + skuCapacity?: SkuCapacity; + locations?: string[]; + capabilities?: Capability[]; +} + +/** + * @class + * Initializes a new instance of the AppServicePlan class. + * @constructor + * App Service plan. + * + * @member {string} [workerTierName] Target worker tier assigned to the App + * Service plan. + * @member {string} [status] App Service plan status. Possible values include: + * 'Ready', 'Pending', 'Creating' + * @member {string} [subscription] App Service plan subscription. + * @member {string} [adminSiteName] App Service plan administration site. + * @member {object} [hostingEnvironmentProfile] Specification for the App + * Service Environment to use for the App Service plan. + * @member {string} [hostingEnvironmentProfile.id] Resource ID of the App + * Service Environment. + * @member {string} [hostingEnvironmentProfile.name] Name of the App Service + * Environment. + * @member {string} [hostingEnvironmentProfile.type] Resource type of the App + * Service Environment. + * @member {number} [maximumNumberOfWorkers] Maximum number of instances that + * can be assigned to this App Service plan. + * @member {string} [geoRegion] Geographical location for the App Service plan. + * @member {boolean} [perSiteScaling] If true, apps assigned to + * this App Service plan can be scaled independently. + * If false, apps assigned to this App Service plan will scale to + * all instances of the plan. Default value: false . + * @member {number} [numberOfSites] Number of apps assigned to this App Service + * plan. + * @member {boolean} [isSpot] If true, this App Service Plan owns + * spot instances. + * @member {date} [spotExpirationTime] The time when the server farm expires. + * Valid only if it is a spot server farm. + * @member {date} [freeOfferExpirationTime] The time when the server farm free + * offer expires. + * @member {string} [resourceGroup] Resource group of the App Service plan. + * @member {boolean} [reserved] If Linux app service plan true, + * false otherwise. Default value: false . + * @member {boolean} [isXenon] Obsolete: If Hyper-V container app service plan + * true, false otherwise. Default value: false . + * @member {boolean} [hyperV] If Hyper-V container app service plan + * true, false otherwise. Default value: false . + * @member {number} [targetWorkerCount] Scaling worker count. + * @member {number} [targetWorkerSizeId] Scaling worker size ID. + * @member {string} [provisioningState] Provisioning state of the App Service + * Environment. Possible values include: 'Succeeded', 'Failed', 'Canceled', + * 'InProgress', 'Deleting' + * @member {object} [sku] + * @member {string} [sku.name] Name of the resource SKU. + * @member {string} [sku.tier] Service tier of the resource SKU. + * @member {string} [sku.size] Size specifier of the resource SKU. + * @member {string} [sku.family] Family code of the resource SKU. + * @member {number} [sku.capacity] Current number of instances assigned to the + * resource. + * @member {object} [sku.skuCapacity] Min, max, and default scale values of the + * SKU. + * @member {number} [sku.skuCapacity.minimum] Minimum number of workers for + * this App Service plan SKU. + * @member {number} [sku.skuCapacity.maximum] Maximum number of workers for + * this App Service plan SKU. + * @member {number} [sku.skuCapacity.default] Default number of workers for + * this App Service plan SKU. + * @member {string} [sku.skuCapacity.scaleType] Available scale configurations + * for an App Service plan. + * @member {array} [sku.locations] Locations of the SKU. + * @member {array} [sku.capabilities] Capabilities of the SKU, e.g., is traffic + * manager enabled? + */ +export interface AppServicePlan extends Resource { + workerTierName?: string; + readonly status?: string; + readonly subscription?: string; + adminSiteName?: string; + hostingEnvironmentProfile?: HostingEnvironmentProfile; + readonly maximumNumberOfWorkers?: number; + readonly geoRegion?: string; + perSiteScaling?: boolean; + readonly numberOfSites?: number; + isSpot?: boolean; + spotExpirationTime?: Date; + freeOfferExpirationTime?: Date; + readonly resourceGroup?: string; + reserved?: boolean; + isXenon?: boolean; + hyperV?: boolean; + targetWorkerCount?: number; + targetWorkerSizeId?: number; + readonly provisioningState?: string; + sku?: SkuDescription; +} + +/** + * @class + * Initializes a new instance of the DefaultErrorResponseErrorDetailsItem class. + * @constructor + * Detailed errors. + * + * @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. + */ +export interface DefaultErrorResponseErrorDetailsItem { + readonly code?: string; + readonly message?: string; + readonly target?: string; +} + +/** + * @class + * Initializes a new instance of the DefaultErrorResponseError class. + * @constructor + * Error model. + * + * @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. + * @member {array} [details] + * @member {string} [innererror] More information to debug error. + */ +export interface DefaultErrorResponseError { + readonly code?: string; + readonly message?: string; + readonly target?: string; + details?: DefaultErrorResponseErrorDetailsItem[]; + readonly innererror?: string; +} + +/** + * @class + * Initializes a new instance of the DefaultErrorResponse class. + * @constructor + * App Service error response. + * + * @member {object} [error] Error model. + * @member {string} [error.code] Standardized string to programmatically + * identify the error. + * @member {string} [error.message] Detailed error description and debugging + * information. + * @member {string} [error.target] Detailed error description and debugging + * information. + * @member {array} [error.details] + * @member {string} [error.innererror] More information to debug error. + */ +export interface DefaultErrorResponse { + readonly error?: DefaultErrorResponseError; +} + +/** + * @class + * Initializes a new instance of the NameIdentifier class. + * @constructor + * Identifies an object. + * + * @member {string} [name] Name of the object. + */ +export interface NameIdentifier { + name?: string; +} + +/** + * @class + * Initializes a new instance of the LogSpecification class. + * @constructor + * Log Definition of a single resource metric. + * + * @member {string} [name] + * @member {string} [displayName] + * @member {string} [blobDuration] + */ +export interface LogSpecification { + name?: string; + displayName?: string; + blobDuration?: string; +} + +/** + * @class + * Initializes a new instance of the MetricAvailability class. + * @constructor + * Retention policy of a resource metric. + * + * @member {string} [timeGrain] + * @member {string} [blobDuration] + */ +export interface MetricAvailability { + timeGrain?: string; + blobDuration?: string; +} + +/** + * @class + * Initializes a new instance of the Dimension class. + * @constructor + * Dimension of a resource metric. For e.g. instance specific HTTP requests for + * a web app, + * where instance name is dimension of the metric HTTP request + * + * @member {string} [name] + * @member {string} [displayName] + * @member {string} [internalName] + * @member {boolean} [toBeExportedForShoebox] + */ +export interface Dimension { + name?: string; + displayName?: string; + internalName?: string; + toBeExportedForShoebox?: boolean; +} + +/** + * @class + * Initializes a new instance of the MetricSpecification class. + * @constructor + * Definition of a single resource metric. + * + * @member {string} [name] + * @member {string} [displayName] + * @member {string} [displayDescription] + * @member {string} [unit] + * @member {string} [aggregationType] + * @member {boolean} [supportsInstanceLevelAggregation] + * @member {boolean} [enableRegionalMdmAccount] + * @member {string} [sourceMdmAccount] + * @member {string} [sourceMdmNamespace] + * @member {string} [metricFilterPattern] + * @member {boolean} [fillGapWithZero] + * @member {boolean} [isInternal] + * @member {array} [dimensions] + * @member {string} [category] + * @member {array} [availabilities] + */ +export interface MetricSpecification { + name?: string; + displayName?: string; + displayDescription?: string; + unit?: string; + aggregationType?: string; + supportsInstanceLevelAggregation?: boolean; + enableRegionalMdmAccount?: boolean; + sourceMdmAccount?: string; + sourceMdmNamespace?: string; + metricFilterPattern?: string; + fillGapWithZero?: boolean; + isInternal?: boolean; + dimensions?: Dimension[]; + category?: string; + availabilities?: MetricAvailability[]; +} + +/** + * @class + * Initializes a new instance of the ServiceSpecification class. + * @constructor + * Resource metrics service provided by Microsoft.Insights resource provider. + * + * @member {array} [metricSpecifications] + * @member {array} [logSpecifications] + */ +export interface ServiceSpecification { + metricSpecifications?: MetricSpecification[]; + logSpecifications?: LogSpecification[]; +} + +/** + * @class + * Initializes a new instance of the CsmOperationDescriptionProperties class. + * @constructor + * Properties available for a Microsoft.Web resource provider operation. + * + * @member {object} [serviceSpecification] + * @member {array} [serviceSpecification.metricSpecifications] + * @member {array} [serviceSpecification.logSpecifications] + */ +export interface CsmOperationDescriptionProperties { + serviceSpecification?: ServiceSpecification; +} + +/** + * @class + * Initializes a new instance of the CsmOperationDisplay class. + * @constructor + * Meta data about operation used for display in portal. + * + * @member {string} [provider] + * @member {string} [resource] + * @member {string} [operation] + * @member {string} [description] + */ +export interface CsmOperationDisplay { + provider?: string; + resource?: string; + operation?: string; + description?: string; +} + +/** + * @class + * Initializes a new instance of the CsmOperationDescription class. + * @constructor + * Description of an operation available for Microsoft.Web resource provider. + * + * @member {string} [name] + * @member {object} [display] + * @member {string} [display.provider] + * @member {string} [display.resource] + * @member {string} [display.operation] + * @member {string} [display.description] + * @member {string} [origin] + * @member {object} [properties] + * @member {object} [properties.serviceSpecification] + * @member {array} [properties.serviceSpecification.metricSpecifications] + * @member {array} [properties.serviceSpecification.logSpecifications] + */ +export interface CsmOperationDescription { + name?: string; + display?: CsmOperationDisplay; + origin?: string; + properties?: CsmOperationDescriptionProperties; +} + +/** + * @class + * Initializes a new instance of the Address class. + * @constructor + * Address information for domain registration. + * + * @member {string} address1 First line of an Address. + * @member {string} [address2] The second line of the Address. Optional. + * @member {string} city The city for the address. + * @member {string} country The country for the address. + * @member {string} postalCode The postal code for the address. + * @member {string} state The state or province for the address. + */ +export interface Address { + address1: string; + address2?: string; + city: string; + country: string; + postalCode: string; + state: string; +} + +/** + * @class + * Initializes a new instance of the Contact class. + * @constructor + * Contact information for domain registration. If 'Domain Privacy' option is + * not selected then the contact information is made publicly available through + * the Whois + * directories as per ICANN requirements. + * + * @member {object} [addressMailing] Mailing address. + * @member {string} [addressMailing.address1] First line of an Address. + * @member {string} [addressMailing.address2] The second line of the Address. + * Optional. + * @member {string} [addressMailing.city] The city for the address. + * @member {string} [addressMailing.country] The country for the address. + * @member {string} [addressMailing.postalCode] The postal code for the + * address. + * @member {string} [addressMailing.state] The state or province for the + * address. + * @member {string} email Email address. + * @member {string} [fax] Fax number. + * @member {string} [jobTitle] Job title. + * @member {string} nameFirst First name. + * @member {string} nameLast Last name. + * @member {string} [nameMiddle] Middle name. + * @member {string} [organization] Organization contact belongs to. + * @member {string} phone Phone number. + */ +export interface Contact { + addressMailing?: Address; + email: string; + fax?: string; + jobTitle?: string; + nameFirst: string; + nameLast: string; + nameMiddle?: string; + organization?: string; + phone: string; +} + +/** + * @class + * Initializes a new instance of the HostName class. + * @constructor + * Details of a hostname derived from a domain. + * + * @member {string} [name] Name of the hostname. + * @member {array} [siteNames] List of apps the hostname is assigned to. This + * list will have more than one app only if the hostname is pointing to a + * Traffic Manager. + * @member {string} [azureResourceName] Name of the Azure resource the hostname + * is assigned to. If it is assigned to a Traffic Manager then it will be the + * Traffic Manager name otherwise it will be the app name. + * @member {string} [azureResourceType] Type of the Azure resource the hostname + * is assigned to. Possible values include: 'Website', 'TrafficManager' + * @member {string} [customHostNameDnsRecordType] Type of the DNS record. + * Possible values include: 'CName', 'A' + * @member {string} [hostNameType] Type of the hostname. Possible values + * include: 'Verified', 'Managed' + */ +export interface HostName { + name?: string; + siteNames?: string[]; + azureResourceName?: string; + azureResourceType?: string; + customHostNameDnsRecordType?: string; + hostNameType?: string; +} + +/** + * @class + * Initializes a new instance of the DomainPurchaseConsent class. + * @constructor + * Domain purchase consent object, representing acceptance of applicable legal + * agreements. + * + * @member {array} [agreementKeys] List of applicable legal agreement keys. + * This list can be retrieved using ListLegalAgreements API under + * TopLevelDomain resource. + * @member {string} [agreedBy] Client IP address. + * @member {date} [agreedAt] Timestamp when the agreements were accepted. + */ +export interface DomainPurchaseConsent { + agreementKeys?: string[]; + agreedBy?: string; + agreedAt?: Date; +} + +/** + * @class + * Initializes a new instance of the Domain class. + * @constructor + * Information about a domain. + * + * @member {object} contactAdmin Administrative contact. + * @member {object} [contactAdmin.addressMailing] Mailing address. + * @member {string} [contactAdmin.addressMailing.address1] First line of an + * Address. + * @member {string} [contactAdmin.addressMailing.address2] The second line of + * the Address. Optional. + * @member {string} [contactAdmin.addressMailing.city] The city for the + * address. + * @member {string} [contactAdmin.addressMailing.country] The country for the + * address. + * @member {string} [contactAdmin.addressMailing.postalCode] The postal code + * for the address. + * @member {string} [contactAdmin.addressMailing.state] The state or province + * for the address. + * @member {string} [contactAdmin.email] Email address. + * @member {string} [contactAdmin.fax] Fax number. + * @member {string} [contactAdmin.jobTitle] Job title. + * @member {string} [contactAdmin.nameFirst] First name. + * @member {string} [contactAdmin.nameLast] Last name. + * @member {string} [contactAdmin.nameMiddle] Middle name. + * @member {string} [contactAdmin.organization] Organization contact belongs + * to. + * @member {string} [contactAdmin.phone] Phone number. + * @member {object} contactBilling Billing contact. + * @member {object} [contactBilling.addressMailing] Mailing address. + * @member {string} [contactBilling.addressMailing.address1] First line of an + * Address. + * @member {string} [contactBilling.addressMailing.address2] The second line of + * the Address. Optional. + * @member {string} [contactBilling.addressMailing.city] The city for the + * address. + * @member {string} [contactBilling.addressMailing.country] The country for the + * address. + * @member {string} [contactBilling.addressMailing.postalCode] The postal code + * for the address. + * @member {string} [contactBilling.addressMailing.state] The state or province + * for the address. + * @member {string} [contactBilling.email] Email address. + * @member {string} [contactBilling.fax] Fax number. + * @member {string} [contactBilling.jobTitle] Job title. + * @member {string} [contactBilling.nameFirst] First name. + * @member {string} [contactBilling.nameLast] Last name. + * @member {string} [contactBilling.nameMiddle] Middle name. + * @member {string} [contactBilling.organization] Organization contact belongs + * to. + * @member {string} [contactBilling.phone] Phone number. + * @member {object} contactRegistrant Registrant contact. + * @member {object} [contactRegistrant.addressMailing] Mailing address. + * @member {string} [contactRegistrant.addressMailing.address1] First line of + * an Address. + * @member {string} [contactRegistrant.addressMailing.address2] The second line + * of the Address. Optional. + * @member {string} [contactRegistrant.addressMailing.city] The city for the + * address. + * @member {string} [contactRegistrant.addressMailing.country] The country for + * the address. + * @member {string} [contactRegistrant.addressMailing.postalCode] The postal + * code for the address. + * @member {string} [contactRegistrant.addressMailing.state] The state or + * province for the address. + * @member {string} [contactRegistrant.email] Email address. + * @member {string} [contactRegistrant.fax] Fax number. + * @member {string} [contactRegistrant.jobTitle] Job title. + * @member {string} [contactRegistrant.nameFirst] First name. + * @member {string} [contactRegistrant.nameLast] Last name. + * @member {string} [contactRegistrant.nameMiddle] Middle name. + * @member {string} [contactRegistrant.organization] Organization contact + * belongs to. + * @member {string} [contactRegistrant.phone] Phone number. + * @member {object} contactTech Technical contact. + * @member {object} [contactTech.addressMailing] Mailing address. + * @member {string} [contactTech.addressMailing.address1] First line of an + * Address. + * @member {string} [contactTech.addressMailing.address2] The second line of + * the Address. Optional. + * @member {string} [contactTech.addressMailing.city] The city for the address. + * @member {string} [contactTech.addressMailing.country] The country for the + * address. + * @member {string} [contactTech.addressMailing.postalCode] The postal code for + * the address. + * @member {string} [contactTech.addressMailing.state] The state or province + * for the address. + * @member {string} [contactTech.email] Email address. + * @member {string} [contactTech.fax] Fax number. + * @member {string} [contactTech.jobTitle] Job title. + * @member {string} [contactTech.nameFirst] First name. + * @member {string} [contactTech.nameLast] Last name. + * @member {string} [contactTech.nameMiddle] Middle name. + * @member {string} [contactTech.organization] Organization contact belongs to. + * @member {string} [contactTech.phone] Phone number. + * @member {string} [registrationStatus] Domain registration status. Possible + * values include: 'Active', 'Awaiting', 'Cancelled', 'Confiscated', + * 'Disabled', 'Excluded', 'Expired', 'Failed', 'Held', 'Locked', 'Parked', + * 'Pending', 'Reserved', 'Reverted', 'Suspended', 'Transferred', 'Unknown', + * 'Unlocked', 'Unparked', 'Updated', 'JsonConverterFailed' + * @member {string} [provisioningState] Domain provisioning state. Possible + * values include: 'Succeeded', 'Failed', 'Canceled', 'InProgress', 'Deleting' + * @member {array} [nameServers] Name servers. + * @member {boolean} [privacy] true if domain privacy is enabled + * for this domain; otherwise, false. + * @member {date} [createdTime] Domain creation timestamp. + * @member {date} [expirationTime] Domain expiration timestamp. + * @member {date} [lastRenewedTime] Timestamp when the domain was renewed last + * time. + * @member {boolean} [autoRenew] true if the domain should be + * automatically renewed; otherwise, false. Default value: true . + * @member {boolean} [readyForDnsRecordManagement] true if Azure + * can assign this domain to App Service apps; otherwise, false. + * This value will be true if domain registration status is active + * and + * it is hosted on name servers Azure has programmatic access to. + * @member {array} [managedHostNames] All hostnames derived from the domain and + * assigned to Azure resources. + * @member {object} consent Legal agreement consent. + * @member {array} [consent.agreementKeys] List of applicable legal agreement + * keys. This list can be retrieved using ListLegalAgreements API under + * TopLevelDomain resource. + * @member {string} [consent.agreedBy] Client IP address. + * @member {date} [consent.agreedAt] Timestamp when the agreements were + * accepted. + * @member {array} [domainNotRenewableReasons] Reasons why domain is not + * renewable. + * @member {string} [dnsType] Current DNS type. Possible values include: + * 'AzureDns', 'DefaultDomainRegistrarDns' + * @member {string} [dnsZoneId] Azure DNS Zone to use + * @member {string} [targetDnsType] Target DNS type (would be used for + * migration). Possible values include: 'AzureDns', 'DefaultDomainRegistrarDns' + * @member {string} [authCode] + */ +export interface Domain extends Resource { + contactAdmin: Contact; + contactBilling: Contact; + contactRegistrant: Contact; + contactTech: Contact; + readonly registrationStatus?: string; + readonly provisioningState?: string; + readonly nameServers?: string[]; + privacy?: boolean; + readonly createdTime?: Date; + readonly expirationTime?: Date; + readonly lastRenewedTime?: Date; + autoRenew?: boolean; + readonly readyForDnsRecordManagement?: boolean; + readonly managedHostNames?: HostName[]; + consent: DomainPurchaseConsent; + readonly domainNotRenewableReasons?: string[]; + dnsType?: string; + dnsZoneId?: string; + targetDnsType?: string; + authCode?: string; +} + +/** + * @class + * Initializes a new instance of the DomainAvailablilityCheckResult class. + * @constructor + * Domain availablility check result. + * + * @member {string} [name] Name of the domain. + * @member {boolean} [available] true if domain can be purchased + * using CreateDomain API; otherwise, false. + * @member {string} [domainType] Valid values are Regular domain: Azure will + * charge the full price of domain registration, SoftDeleted: Purchasing this + * domain will simply restore it and this operation will not cost anything. + * Possible values include: 'Regular', 'SoftDeleted' + */ +export interface DomainAvailablilityCheckResult { + name?: string; + available?: boolean; + domainType?: string; +} + +/** + * @class + * Initializes a new instance of the DomainControlCenterSsoRequest class. + * @constructor + * Single sign-on request information for domain management. + * + * @member {string} [url] URL where the single sign-on request is to be made. + * @member {string} [postParameterKey] Post parameter key. + * @member {string} [postParameterValue] Post parameter value. Client should + * use 'application/x-www-form-urlencoded' encoding for this value. + */ +export interface DomainControlCenterSsoRequest { + readonly url?: string; + readonly postParameterKey?: string; + readonly postParameterValue?: string; +} + +/** + * @class + * Initializes a new instance of the DomainOwnershipIdentifier class. + * @constructor + * Domain ownership Identifier. + * + * @member {string} [ownershipId] Ownership Id. + */ +export interface DomainOwnershipIdentifier extends ProxyOnlyResource { + ownershipId?: string; +} + +/** + * @class + * Initializes a new instance of the DomainPatchResource class. + * @constructor + * ARM resource for a domain. + * + * @member {object} contactAdmin Administrative contact. + * @member {object} [contactAdmin.addressMailing] Mailing address. + * @member {string} [contactAdmin.addressMailing.address1] First line of an + * Address. + * @member {string} [contactAdmin.addressMailing.address2] The second line of + * the Address. Optional. + * @member {string} [contactAdmin.addressMailing.city] The city for the + * address. + * @member {string} [contactAdmin.addressMailing.country] The country for the + * address. + * @member {string} [contactAdmin.addressMailing.postalCode] The postal code + * for the address. + * @member {string} [contactAdmin.addressMailing.state] The state or province + * for the address. + * @member {string} [contactAdmin.email] Email address. + * @member {string} [contactAdmin.fax] Fax number. + * @member {string} [contactAdmin.jobTitle] Job title. + * @member {string} [contactAdmin.nameFirst] First name. + * @member {string} [contactAdmin.nameLast] Last name. + * @member {string} [contactAdmin.nameMiddle] Middle name. + * @member {string} [contactAdmin.organization] Organization contact belongs + * to. + * @member {string} [contactAdmin.phone] Phone number. + * @member {object} contactBilling Billing contact. + * @member {object} [contactBilling.addressMailing] Mailing address. + * @member {string} [contactBilling.addressMailing.address1] First line of an + * Address. + * @member {string} [contactBilling.addressMailing.address2] The second line of + * the Address. Optional. + * @member {string} [contactBilling.addressMailing.city] The city for the + * address. + * @member {string} [contactBilling.addressMailing.country] The country for the + * address. + * @member {string} [contactBilling.addressMailing.postalCode] The postal code + * for the address. + * @member {string} [contactBilling.addressMailing.state] The state or province + * for the address. + * @member {string} [contactBilling.email] Email address. + * @member {string} [contactBilling.fax] Fax number. + * @member {string} [contactBilling.jobTitle] Job title. + * @member {string} [contactBilling.nameFirst] First name. + * @member {string} [contactBilling.nameLast] Last name. + * @member {string} [contactBilling.nameMiddle] Middle name. + * @member {string} [contactBilling.organization] Organization contact belongs + * to. + * @member {string} [contactBilling.phone] Phone number. + * @member {object} contactRegistrant Registrant contact. + * @member {object} [contactRegistrant.addressMailing] Mailing address. + * @member {string} [contactRegistrant.addressMailing.address1] First line of + * an Address. + * @member {string} [contactRegistrant.addressMailing.address2] The second line + * of the Address. Optional. + * @member {string} [contactRegistrant.addressMailing.city] The city for the + * address. + * @member {string} [contactRegistrant.addressMailing.country] The country for + * the address. + * @member {string} [contactRegistrant.addressMailing.postalCode] The postal + * code for the address. + * @member {string} [contactRegistrant.addressMailing.state] The state or + * province for the address. + * @member {string} [contactRegistrant.email] Email address. + * @member {string} [contactRegistrant.fax] Fax number. + * @member {string} [contactRegistrant.jobTitle] Job title. + * @member {string} [contactRegistrant.nameFirst] First name. + * @member {string} [contactRegistrant.nameLast] Last name. + * @member {string} [contactRegistrant.nameMiddle] Middle name. + * @member {string} [contactRegistrant.organization] Organization contact + * belongs to. + * @member {string} [contactRegistrant.phone] Phone number. + * @member {object} contactTech Technical contact. + * @member {object} [contactTech.addressMailing] Mailing address. + * @member {string} [contactTech.addressMailing.address1] First line of an + * Address. + * @member {string} [contactTech.addressMailing.address2] The second line of + * the Address. Optional. + * @member {string} [contactTech.addressMailing.city] The city for the address. + * @member {string} [contactTech.addressMailing.country] The country for the + * address. + * @member {string} [contactTech.addressMailing.postalCode] The postal code for + * the address. + * @member {string} [contactTech.addressMailing.state] The state or province + * for the address. + * @member {string} [contactTech.email] Email address. + * @member {string} [contactTech.fax] Fax number. + * @member {string} [contactTech.jobTitle] Job title. + * @member {string} [contactTech.nameFirst] First name. + * @member {string} [contactTech.nameLast] Last name. + * @member {string} [contactTech.nameMiddle] Middle name. + * @member {string} [contactTech.organization] Organization contact belongs to. + * @member {string} [contactTech.phone] Phone number. + * @member {string} [registrationStatus] Domain registration status. Possible + * values include: 'Active', 'Awaiting', 'Cancelled', 'Confiscated', + * 'Disabled', 'Excluded', 'Expired', 'Failed', 'Held', 'Locked', 'Parked', + * 'Pending', 'Reserved', 'Reverted', 'Suspended', 'Transferred', 'Unknown', + * 'Unlocked', 'Unparked', 'Updated', 'JsonConverterFailed' + * @member {string} [provisioningState] Domain provisioning state. Possible + * values include: 'Succeeded', 'Failed', 'Canceled', 'InProgress', 'Deleting' + * @member {array} [nameServers] Name servers. + * @member {boolean} [privacy] true if domain privacy is enabled + * for this domain; otherwise, false. + * @member {date} [createdTime] Domain creation timestamp. + * @member {date} [expirationTime] Domain expiration timestamp. + * @member {date} [lastRenewedTime] Timestamp when the domain was renewed last + * time. + * @member {boolean} [autoRenew] true if the domain should be + * automatically renewed; otherwise, false. Default value: true . + * @member {boolean} [readyForDnsRecordManagement] true if Azure + * can assign this domain to App Service apps; otherwise, false. + * This value will be true if domain registration status is active + * and + * it is hosted on name servers Azure has programmatic access to. + * @member {array} [managedHostNames] All hostnames derived from the domain and + * assigned to Azure resources. + * @member {object} consent Legal agreement consent. + * @member {array} [consent.agreementKeys] List of applicable legal agreement + * keys. This list can be retrieved using ListLegalAgreements API under + * TopLevelDomain resource. + * @member {string} [consent.agreedBy] Client IP address. + * @member {date} [consent.agreedAt] Timestamp when the agreements were + * accepted. + * @member {array} [domainNotRenewableReasons] Reasons why domain is not + * renewable. + * @member {string} [dnsType] Current DNS type. Possible values include: + * 'AzureDns', 'DefaultDomainRegistrarDns' + * @member {string} [dnsZoneId] Azure DNS Zone to use + * @member {string} [targetDnsType] Target DNS type (would be used for + * migration). Possible values include: 'AzureDns', 'DefaultDomainRegistrarDns' + * @member {string} [authCode] + */ +export interface DomainPatchResource extends ProxyOnlyResource { + contactAdmin: Contact; + contactBilling: Contact; + contactRegistrant: Contact; + contactTech: Contact; + readonly registrationStatus?: string; + readonly provisioningState?: string; + readonly nameServers?: string[]; + privacy?: boolean; + readonly createdTime?: Date; + readonly expirationTime?: Date; + readonly lastRenewedTime?: Date; + autoRenew?: boolean; + readonly readyForDnsRecordManagement?: boolean; + readonly managedHostNames?: HostName[]; + consent: DomainPurchaseConsent; + readonly domainNotRenewableReasons?: string[]; + dnsType?: string; + dnsZoneId?: string; + targetDnsType?: string; + authCode?: string; +} + +/** + * @class + * Initializes a new instance of the DomainRecommendationSearchParameters class. + * @constructor + * Domain recommendation search parameters. + * + * @member {string} [keywords] Keywords to be used for generating domain + * recommendations. + * @member {number} [maxDomainRecommendations] Maximum number of + * recommendations. + */ +export interface DomainRecommendationSearchParameters { + keywords?: string; + maxDomainRecommendations?: number; +} + +/** + * @class + * Initializes a new instance of the TldLegalAgreement class. + * @constructor + * Legal agreement for a top level domain. + * + * @member {string} agreementKey Unique identifier for the agreement. + * @member {string} title Agreement title. + * @member {string} content Agreement details. + * @member {string} [url] URL where a copy of the agreement details is hosted. + */ +export interface TldLegalAgreement { + agreementKey: string; + title: string; + content: string; + url?: string; +} + +/** + * @class + * Initializes a new instance of the TopLevelDomain class. + * @constructor + * A top level domain object. + * + * @member {boolean} [privacy] If true, then the top level domain + * supports domain privacy; otherwise, false. + */ +export interface TopLevelDomain extends ProxyOnlyResource { + privacy?: boolean; +} + +/** + * @class + * Initializes a new instance of the TopLevelDomainAgreementOption class. + * @constructor + * Options for retrieving the list of top level domain legal agreements. + * + * @member {boolean} [includePrivacy] If true, then the list of + * agreements will include agreements for domain privacy as well; otherwise, + * false. + * @member {boolean} [forTransfer] If true, then the list of + * agreements will include agreements for domain transfer as well; otherwise, + * false. + */ +export interface TopLevelDomainAgreementOption { + includePrivacy?: boolean; + forTransfer?: boolean; +} + +/** + * @class + * Initializes a new instance of the Certificate class. + * @constructor + * SSL certificate for an app. + * + * @member {string} [friendlyName] Friendly name of the certificate. + * @member {string} [subjectName] Subject name of the certificate. + * @member {array} [hostNames] Host names the certificate applies to. + * @member {buffer} [pfxBlob] Pfx blob. + * @member {string} [siteName] App name. + * @member {string} [selfLink] Self link. + * @member {string} [issuer] Certificate issuer. + * @member {date} [issueDate] Certificate issue Date. + * @member {date} [expirationDate] Certificate expriration date. + * @member {string} password Certificate password. + * @member {string} [thumbprint] Certificate thumbprint. + * @member {boolean} [valid] Is the certificate valid?. + * @member {buffer} [cerBlob] Raw bytes of .cer file + * @member {string} [publicKeyHash] Public key hash. + * @member {object} [hostingEnvironmentProfile] Specification for the App + * Service Environment to use for the certificate. + * @member {string} [hostingEnvironmentProfile.id] Resource ID of the App + * Service Environment. + * @member {string} [hostingEnvironmentProfile.name] Name of the App Service + * Environment. + * @member {string} [hostingEnvironmentProfile.type] Resource type of the App + * Service Environment. + * @member {string} [keyVaultId] Key Vault Csm resource Id. + * @member {string} [keyVaultSecretName] Key Vault secret name. + * @member {string} [keyVaultSecretStatus] Status of the Key Vault secret. + * Possible values include: 'Initialized', 'WaitingOnCertificateOrder', + * 'Succeeded', 'CertificateOrderFailed', 'OperationNotPermittedOnKeyVault', + * 'AzureServiceUnauthorizedToAccessKeyVault', 'KeyVaultDoesNotExist', + * 'KeyVaultSecretDoesNotExist', 'UnknownError', 'ExternalPrivateKey', + * 'Unknown' + * @member {string} [serverFarmId] Resource ID of the associated App Service + * plan, formatted as: + * "/subscriptions/{subscriptionID}/resourceGroups/{groupName}/providers/Microsoft.Web/serverfarms/{appServicePlanName}". + */ +export interface Certificate extends Resource { + readonly friendlyName?: string; + readonly subjectName?: string; + hostNames?: string[]; + pfxBlob?: Buffer; + readonly siteName?: string; + readonly selfLink?: string; + readonly issuer?: string; + readonly issueDate?: Date; + readonly expirationDate?: Date; + password: string; + readonly thumbprint?: string; + readonly valid?: boolean; + readonly cerBlob?: Buffer; + readonly publicKeyHash?: string; + readonly hostingEnvironmentProfile?: HostingEnvironmentProfile; + keyVaultId?: string; + keyVaultSecretName?: string; + readonly keyVaultSecretStatus?: string; + serverFarmId?: string; +} + +/** + * @class + * Initializes a new instance of the CertificatePatchResource class. + * @constructor + * ARM resource for a certificate. + * + * @member {string} [friendlyName] Friendly name of the certificate. + * @member {string} [subjectName] Subject name of the certificate. + * @member {array} [hostNames] Host names the certificate applies to. + * @member {buffer} [pfxBlob] Pfx blob. + * @member {string} [siteName] App name. + * @member {string} [selfLink] Self link. + * @member {string} [issuer] Certificate issuer. + * @member {date} [issueDate] Certificate issue Date. + * @member {date} [expirationDate] Certificate expriration date. + * @member {string} password Certificate password. + * @member {string} [thumbprint] Certificate thumbprint. + * @member {boolean} [valid] Is the certificate valid?. + * @member {buffer} [cerBlob] Raw bytes of .cer file + * @member {string} [publicKeyHash] Public key hash. + * @member {object} [hostingEnvironmentProfile] Specification for the App + * Service Environment to use for the certificate. + * @member {string} [hostingEnvironmentProfile.id] Resource ID of the App + * Service Environment. + * @member {string} [hostingEnvironmentProfile.name] Name of the App Service + * Environment. + * @member {string} [hostingEnvironmentProfile.type] Resource type of the App + * Service Environment. + * @member {string} [keyVaultId] Key Vault Csm resource Id. + * @member {string} [keyVaultSecretName] Key Vault secret name. + * @member {string} [keyVaultSecretStatus] Status of the Key Vault secret. + * Possible values include: 'Initialized', 'WaitingOnCertificateOrder', + * 'Succeeded', 'CertificateOrderFailed', 'OperationNotPermittedOnKeyVault', + * 'AzureServiceUnauthorizedToAccessKeyVault', 'KeyVaultDoesNotExist', + * 'KeyVaultSecretDoesNotExist', 'UnknownError', 'ExternalPrivateKey', + * 'Unknown' + * @member {string} [serverFarmId] Resource ID of the associated App Service + * plan, formatted as: + * "/subscriptions/{subscriptionID}/resourceGroups/{groupName}/providers/Microsoft.Web/serverfarms/{appServicePlanName}". + */ +export interface CertificatePatchResource extends ProxyOnlyResource { + readonly friendlyName?: string; + readonly subjectName?: string; + hostNames?: string[]; + pfxBlob?: Buffer; + readonly siteName?: string; + readonly selfLink?: string; + readonly issuer?: string; + readonly issueDate?: Date; + readonly expirationDate?: Date; + password: string; + readonly thumbprint?: string; + readonly valid?: boolean; + readonly cerBlob?: Buffer; + readonly publicKeyHash?: string; + readonly hostingEnvironmentProfile?: HostingEnvironmentProfile; + keyVaultId?: string; + keyVaultSecretName?: string; + readonly keyVaultSecretStatus?: string; + serverFarmId?: string; +} + +/** + * @class + * Initializes a new instance of the VirtualNetworkProfile class. + * @constructor + * Specification for using a Virtual Network. + * + * @member {string} [id] Resource id of the Virtual Network. + * @member {string} [name] Name of the Virtual Network (read-only). + * @member {string} [type] Resource type of the Virtual Network (read-only). + * @member {string} [subnet] Subnet within the Virtual Network. + */ +export interface VirtualNetworkProfile { + id?: string; + readonly name?: string; + readonly type?: string; + subnet?: string; +} + +/** + * @class + * Initializes a new instance of the WorkerPool class. + * @constructor + * Worker pool of an App Service Environment. + * + * @member {number} [workerSizeId] Worker size ID for referencing this worker + * pool. + * @member {string} [computeMode] Shared or dedicated app hosting. Possible + * values include: 'Shared', 'Dedicated', 'Dynamic' + * @member {string} [workerSize] VM size of the worker pool instances. + * @member {number} [workerCount] Number of instances in the worker pool. + * @member {array} [instanceNames] Names of all instances in the worker pool + * (read only). + */ +export interface WorkerPool { + workerSizeId?: number; + computeMode?: string; + workerSize?: string; + workerCount?: number; + readonly instanceNames?: string[]; +} + +/** + * @class + * Initializes a new instance of the VirtualIPMapping class. + * @constructor + * Virtual IP mapping. + * + * @member {string} [virtualIP] Virtual IP address. + * @member {number} [internalHttpPort] Internal HTTP port. + * @member {number} [internalHttpsPort] Internal HTTPS port. + * @member {boolean} [inUse] Is virtual IP mapping in use. + */ +export interface VirtualIPMapping { + virtualIP?: string; + internalHttpPort?: number; + internalHttpsPort?: number; + inUse?: boolean; +} + +/** + * @class + * Initializes a new instance of the StampCapacity class. + * @constructor + * Stamp capacity information. + * + * @member {string} [name] Name of the stamp. + * @member {number} [availableCapacity] Available capacity (# of machines, + * bytes of storage etc...). + * @member {number} [totalCapacity] Total capacity (# of machines, bytes of + * storage etc...). + * @member {string} [unit] Name of the unit. + * @member {string} [computeMode] Shared/dedicated workers. Possible values + * include: 'Shared', 'Dedicated', 'Dynamic' + * @member {string} [workerSize] Size of the machines. Possible values include: + * 'Small', 'Medium', 'Large', 'D1', 'D2', 'D3', 'Default' + * @member {number} [workerSizeId] Size ID of machines: + * 0 - Small + * 1 - Medium + * 2 - Large + * @member {boolean} [excludeFromCapacityAllocation] If true, it + * includes basic apps. + * Basic apps are not used for capacity allocation. + * @member {boolean} [isApplicableForAllComputeModes] true if + * capacity is applicable for all apps; otherwise, false. + * @member {string} [siteMode] Shared or Dedicated. + * @member {boolean} [isLinux] Is this a linux stamp capacity + */ +export interface StampCapacity { + name?: string; + availableCapacity?: number; + totalCapacity?: number; + unit?: string; + computeMode?: string; + workerSize?: string; + workerSizeId?: number; + excludeFromCapacityAllocation?: boolean; + isApplicableForAllComputeModes?: boolean; + siteMode?: string; + isLinux?: boolean; +} + +/** + * @class + * Initializes a new instance of the NetworkAccessControlEntry class. + * @constructor + * Network access control entry. + * + * @member {string} [action] Action object. Possible values include: 'Permit', + * 'Deny' + * @member {string} [description] Description of network access control entry. + * @member {number} [order] Order of precedence. + * @member {string} [remoteSubnet] Remote subnet. + */ +export interface NetworkAccessControlEntry { + action?: string; + description?: string; + order?: number; + remoteSubnet?: string; +} + +/** + * @class + * Initializes a new instance of the AppServiceEnvironment class. + * @constructor + * Description of an App Service Environment. + * + * @member {string} name Name of the App Service Environment. + * @member {string} location Location of the App Service Environment, e.g. + * "West US". + * @member {string} [provisioningState] Provisioning state of the App Service + * Environment. Possible values include: 'Succeeded', 'Failed', 'Canceled', + * 'InProgress', 'Deleting' + * @member {string} [status] Current status of the App Service Environment. + * Possible values include: 'Preparing', 'Ready', 'Scaling', 'Deleting' + * @member {string} [vnetName] Name of the Virtual Network for the App Service + * Environment. + * @member {string} [vnetResourceGroupName] Resource group of the Virtual + * Network. + * @member {string} [vnetSubnetName] Subnet of the Virtual Network. + * @member {object} virtualNetwork Description of the Virtual Network. + * @member {string} [virtualNetwork.id] Resource id of the Virtual Network. + * @member {string} [virtualNetwork.name] Name of the Virtual Network + * (read-only). + * @member {string} [virtualNetwork.type] Resource type of the Virtual Network + * (read-only). + * @member {string} [virtualNetwork.subnet] Subnet within the Virtual Network. + * @member {string} [internalLoadBalancingMode] Specifies which endpoints to + * serve internally in the Virtual Network for the App Service Environment. + * Possible values include: 'None', 'Web', 'Publishing' + * @member {string} [multiSize] Front-end VM size, e.g. "Medium", "Large". + * @member {number} [multiRoleCount] Number of front-end instances. + * @member {array} workerPools Description of worker pools with worker size + * IDs, VM sizes, and number of workers in each pool. + * @member {number} [ipsslAddressCount] Number of IP SSL addresses reserved for + * the App Service Environment. + * @member {string} [databaseEdition] Edition of the metadata database for the + * App Service Environment, e.g. "Standard". + * @member {string} [databaseServiceObjective] Service objective of the + * metadata database for the App Service Environment, e.g. "S0". + * @member {number} [upgradeDomains] Number of upgrade domains of the App + * Service Environment. + * @member {string} [subscriptionId] Subscription of the App Service + * Environment. + * @member {string} [dnsSuffix] DNS suffix of the App Service Environment. + * @member {string} [lastAction] Last deployment action on the App Service + * Environment. + * @member {string} [lastActionResult] Result of the last deployment action on + * the App Service Environment. + * @member {string} [allowedMultiSizes] List of comma separated strings + * describing which VM sizes are allowed for front-ends. + * @member {string} [allowedWorkerSizes] List of comma separated strings + * describing which VM sizes are allowed for workers. + * @member {number} [maximumNumberOfMachines] Maximum number of VMs in the App + * Service Environment. + * @member {array} [vipMappings] Description of IP SSL mapping for the App + * Service Environment. + * @member {array} [environmentCapacities] Current total, used, and available + * worker capacities. + * @member {array} [networkAccessControlList] Access control list for + * controlling traffic to the App Service Environment. + * @member {boolean} [environmentIsHealthy] True/false indicating whether the + * App Service Environment is healthy. + * @member {string} [environmentStatus] Detailed message about with results of + * the last check of the App Service Environment. + * @member {string} [resourceGroup] Resource group of the App Service + * Environment. + * @member {number} [frontEndScaleFactor] Scale factor for front-ends. + * @member {number} [defaultFrontEndScaleFactor] Default Scale Factor for + * FrontEnds. + * @member {string} [apiManagementAccountId] API Management Account associated + * with the App Service Environment. + * @member {boolean} [suspended] true if the App Service + * Environment is suspended; otherwise, false. The environment can + * be suspended, e.g. when the management endpoint is no longer available + * (most likely because NSG blocked the incoming traffic). + * @member {boolean} [dynamicCacheEnabled] True/false indicating whether the + * App Service Environment is suspended. The environment can be suspended e.g. + * when the management endpoint is no longer available + * (most likely because NSG blocked the incoming traffic). + * @member {array} [clusterSettings] Custom settings for changing the behavior + * of the App Service Environment. + * @member {array} [userWhitelistedIpRanges] User added ip ranges to whitelist + * on ASE db + * @member {boolean} [hasLinuxWorkers] Flag that displays whether an ASE has + * linux workers or not + * @member {string} [sslCertKeyVaultId] Key Vault ID for ILB App Service + * Environment default SSL certificate + * @member {string} [sslCertKeyVaultSecretName] Key Vault Secret Name for ILB + * App Service Environment default SSL certificate + */ +export interface AppServiceEnvironment { + name: string; + location: string; + readonly provisioningState?: string; + readonly status?: string; + vnetName?: string; + vnetResourceGroupName?: string; + vnetSubnetName?: string; + virtualNetwork: VirtualNetworkProfile; + internalLoadBalancingMode?: string; + multiSize?: string; + multiRoleCount?: number; + workerPools: WorkerPool[]; + ipsslAddressCount?: number; + readonly databaseEdition?: string; + readonly databaseServiceObjective?: string; + readonly upgradeDomains?: number; + readonly subscriptionId?: string; + dnsSuffix?: string; + readonly lastAction?: string; + readonly lastActionResult?: string; + readonly allowedMultiSizes?: string; + readonly allowedWorkerSizes?: string; + readonly maximumNumberOfMachines?: number; + readonly vipMappings?: VirtualIPMapping[]; + readonly environmentCapacities?: StampCapacity[]; + networkAccessControlList?: NetworkAccessControlEntry[]; + readonly environmentIsHealthy?: boolean; + readonly environmentStatus?: string; + readonly resourceGroup?: string; + frontEndScaleFactor?: number; + readonly defaultFrontEndScaleFactor?: number; + apiManagementAccountId?: string; + suspended?: boolean; + dynamicCacheEnabled?: boolean; + clusterSettings?: NameValuePair[]; + userWhitelistedIpRanges?: string[]; + hasLinuxWorkers?: boolean; + sslCertKeyVaultId?: string; + sslCertKeyVaultSecretName?: string; +} + +/** + * @class + * Initializes a new instance of the LocalizableString class. + * @constructor + * Localizable string object containing the name and a localized value. + * + * @member {string} [value] Non-localized name. + * @member {string} [localizedValue] Localized name. + */ +export interface LocalizableString { + value?: string; + localizedValue?: string; +} + +/** + * @class + * Initializes a new instance of the CsmUsageQuota class. + * @constructor + * Usage of the quota resource. + * + * @member {string} [unit] Units of measurement for the quota resourse. + * @member {date} [nextResetTime] Next reset time for the resource counter. + * @member {number} [currentValue] The current value of the resource counter. + * @member {number} [limit] The resource limit. + * @member {object} [name] Quota name. + * @member {string} [name.value] Non-localized name. + * @member {string} [name.localizedValue] Localized name. + */ +export interface CsmUsageQuota { + unit?: string; + nextResetTime?: Date; + currentValue?: number; + limit?: number; + name?: LocalizableString; +} + +/** + * @class + * Initializes a new instance of the ErrorEntity class. + * @constructor + * Body of the error response returned from the API. + * + * @member {string} [extendedCode] Type of error. + * @member {string} [messageTemplate] Message template. + * @member {array} [parameters] Parameters for the template. + * @member {array} [innerErrors] Inner errors. + * @member {string} [code] Basic error code. + * @member {string} [message] Any details of the error. + */ +export interface ErrorEntity { + extendedCode?: string; + messageTemplate?: string; + parameters?: string[]; + innerErrors?: ErrorEntity[]; + code?: string; + message?: string; +} + +/** + * @class + * Initializes a new instance of the Operation class. + * @constructor + * An operation on a resource. + * + * @member {string} [id] Operation ID. + * @member {string} [name] Operation name. + * @member {string} [status] The current status of the operation. Possible + * values include: 'InProgress', 'Failed', 'Succeeded', 'TimedOut', 'Created' + * @member {array} [errors] Any errors associate with the operation. + * @member {date} [createdTime] Time when operation has started. + * @member {date} [modifiedTime] Time when operation has been updated. + * @member {date} [expirationTime] Time when operation will expire. + * @member {uuid} [geoMasterOperationId] Applicable only for stamp operation + * ids. + */ +export interface Operation { + id?: string; + name?: string; + status?: string; + errors?: ErrorEntity[]; + createdTime?: Date; + modifiedTime?: Date; + expirationTime?: Date; + geoMasterOperationId?: string; +} + +/** + * @class + * Initializes a new instance of the ResourceMetricName class. + * @constructor + * Name of a metric for any resource . + * + * @member {string} [value] metric name value. + * @member {string} [localizedValue] Localized metric name value. + */ +export interface ResourceMetricName { + readonly value?: string; + readonly localizedValue?: string; +} + +/** + * @class + * Initializes a new instance of the ResourceMetricProperty class. + * @constructor + * Resource metric property. + * + * @member {string} [key] Key for resource metric property. + * @member {string} [value] Value of pair. + */ +export interface ResourceMetricProperty { + key?: string; + value?: string; +} + +/** + * @class + * Initializes a new instance of the ResourceMetricValue class. + * @constructor + * Value of resource metric. + * + * @member {string} [timestamp] Value timestamp. + * @member {number} [average] Value average. + * @member {number} [minimum] Value minimum. + * @member {number} [maximum] Value maximum. + * @member {number} [total] Value total. + * @member {number} [count] Value count. + * @member {array} [properties] Resource metric properties collection. + */ +export interface ResourceMetricValue { + readonly timestamp?: string; + readonly average?: number; + readonly minimum?: number; + readonly maximum?: number; + readonly total?: number; + readonly count?: number; + readonly properties?: ResourceMetricProperty[]; +} + +/** + * @class + * Initializes a new instance of the ResourceMetric class. + * @constructor + * Object representing a metric for any resource . + * + * @member {object} [name] Name of metric. + * @member {string} [name.value] metric name value. + * @member {string} [name.localizedValue] Localized metric name value. + * @member {string} [unit] Metric unit. + * @member {string} [timeGrain] Metric granularity. E.g PT1H, PT5M, P1D + * @member {date} [startTime] Metric start time. + * @member {date} [endTime] Metric end time. + * @member {string} [resourceId] Metric resource Id. + * @member {string} [id] Resource Id. + * @member {array} [metricValues] Metric values. + * @member {array} [properties] Resource metric properties collection. + */ +export interface ResourceMetric { + readonly name?: ResourceMetricName; + readonly unit?: string; + readonly timeGrain?: string; + readonly startTime?: Date; + readonly endTime?: Date; + readonly resourceId?: string; + readonly id?: string; + readonly metricValues?: ResourceMetricValue[]; + readonly properties?: ResourceMetricProperty[]; +} + +/** + * @class + * Initializes a new instance of the Solution class. + * @constructor + * Class Representing Solution for problems detected. + * + * @member {number} [id] Solution Id. + * @member {string} [displayName] Display Name of the solution + * @member {number} [order] Order of the solution. + * @member {string} [description] Description of the solution + * @member {string} [type] Type of Solution. Possible values include: + * 'QuickSolution', 'DeepInvestigation', 'BestPractices' + * @member {array} [data] Solution Data. + * @member {array} [metadata] Solution Metadata. + */ +export interface Solution { + id?: number; + displayName?: string; + order?: number; + description?: string; + type?: string; + data?: NameValuePair[][]; + metadata?: NameValuePair[][]; +} + +/** + * @class + * Initializes a new instance of the DetectorAbnormalTimePeriod class. + * @constructor + * Class representing Abnormal Time Period detected. + * + * @member {date} [startTime] Start time of the corelated event + * @member {date} [endTime] End time of the corelated event + * @member {string} [message] Message describing the event + * @member {string} [source] Represents the name of the Detector + * @member {number} [priority] Represents the rank of the Detector + * @member {array} [metaData] Downtime metadata + * @member {string} [type] Represents the type of the Detector. Possible values + * include: 'ServiceIncident', 'AppDeployment', 'AppCrash', + * 'RuntimeIssueDetected', 'AseDeployment', 'UserIssue', 'PlatformIssue', + * 'Other' + * @member {array} [solutions] List of proposed solutions + */ +export interface DetectorAbnormalTimePeriod { + startTime?: Date; + endTime?: Date; + message?: string; + source?: string; + priority?: number; + metaData?: NameValuePair[][]; + type?: string; + solutions?: Solution[]; +} + +/** + * @class + * Initializes a new instance of the AbnormalTimePeriod class. + * @constructor + * Class representing Abnormal Time Period identified in diagnosis + * + * @member {date} [startTime] Start time of the downtime + * @member {date} [endTime] End time of the downtime + * @member {array} [events] List of Possible Cause of downtime + * @member {array} [solutions] List of proposed solutions + */ +export interface AbnormalTimePeriod { + startTime?: Date; + endTime?: Date; + events?: DetectorAbnormalTimePeriod[]; + solutions?: Solution[]; +} + +/** + * @class + * Initializes a new instance of the DetectorDefinition class. + * @constructor + * Class representing detector definition + * + * @member {string} [displayName] Display name of the detector + * @member {string} [description] Description of the detector + * @member {number} [rank] Detector Rank + * @member {boolean} [isEnabled] Flag representing whether detector is enabled + * or not. + */ +export interface DetectorDefinition extends ProxyOnlyResource { + readonly displayName?: string; + readonly description?: string; + readonly rank?: number; + readonly isEnabled?: boolean; +} + +/** + * @class + * Initializes a new instance of the DiagnosticMetricSample class. + * @constructor + * Class representing Diagnostic Metric + * + * @member {date} [timestamp] Time at which metric is measured + * @member {string} [roleInstance] Role Instance. Null if this counter is not + * per instance + * This is returned and should be whichever instance name we desire to be + * returned + * i.e. CPU and Memory return RDWORKERNAME (LargeDed..._IN_0) + * where RDWORKERNAME is Machine name below and RoleInstance name in + * parenthesis + * @member {number} [total] Total value of the metric. If multiple measurements + * are made this will have sum of all. + * @member {number} [maximum] Maximum of the metric sampled during the time + * period + * @member {number} [minimum] Minimum of the metric sampled during the time + * period + * @member {boolean} [isAggregated] Whether the values are aggregates across + * all workers or not + */ +export interface DiagnosticMetricSample { + timestamp?: Date; + roleInstance?: string; + total?: number; + maximum?: number; + minimum?: number; + isAggregated?: boolean; +} + +/** + * @class + * Initializes a new instance of the DiagnosticMetricSet class. + * @constructor + * Class representing Diagnostic Metric information + * + * @member {string} [name] Name of the metric + * @member {string} [unit] Metric's unit + * @member {date} [startTime] Start time of the period + * @member {date} [endTime] End time of the period + * @member {string} [timeGrain] Presented time grain. Supported grains at the + * moment are PT1M, PT1H, P1D + * @member {array} [values] Collection of metric values for the selected period + * based on the + * {Microsoft.Web.Hosting.Administration.DiagnosticMetricSet.TimeGrain} + */ +export interface DiagnosticMetricSet { + name?: string; + unit?: string; + startTime?: Date; + endTime?: Date; + timeGrain?: string; + values?: DiagnosticMetricSample[]; +} + +/** + * @class + * Initializes a new instance of the DataSource class. + * @constructor + * Class representing data source used by the detectors + * + * @member {array} [instructions] Instrunctions if any for the data source + * @member {array} [dataSourceUri] Datasource Uri Links + */ +export interface DataSource { + instructions?: string[]; + dataSourceUri?: NameValuePair[]; +} + +/** + * @class + * Initializes a new instance of the ResponseMetaData class. + * @constructor + * @member {object} [dataSource] Source of the Data + * @member {array} [dataSource.instructions] Instrunctions if any for the data + * source + * @member {array} [dataSource.dataSourceUri] Datasource Uri Links + */ +export interface ResponseMetaData { + dataSource?: DataSource; +} + +/** + * @class + * Initializes a new instance of the AnalysisData class. + * @constructor + * Class Representing Detector Evidence used for analysis + * + * @member {string} [source] Name of the Detector + * @member {object} [detectorDefinition] Detector Definition + * @member {string} [detectorDefinition.displayName] Display name of the + * detector + * @member {string} [detectorDefinition.description] Description of the + * detector + * @member {number} [detectorDefinition.rank] Detector Rank + * @member {boolean} [detectorDefinition.isEnabled] Flag representing whether + * detector is enabled or not. + * @member {array} [metrics] Source Metrics + * @member {array} [data] Additional Source Data + * @member {object} [detectorMetaData] Detector Meta Data + * @member {object} [detectorMetaData.dataSource] Source of the Data + * @member {array} [detectorMetaData.dataSource.instructions] Instrunctions if + * any for the data source + * @member {array} [detectorMetaData.dataSource.dataSourceUri] Datasource Uri + * Links + */ +export interface AnalysisData { + source?: string; + detectorDefinition?: DetectorDefinition; + metrics?: DiagnosticMetricSet[]; + data?: NameValuePair[][]; + detectorMetaData?: ResponseMetaData; +} + +/** + * @class + * Initializes a new instance of the AnalysisDefinition class. + * @constructor + * Definition of Analysis + * + * @member {string} [description] Description of the Analysis + */ +export interface AnalysisDefinition extends ProxyOnlyResource { + readonly description?: string; +} + +/** + * @class + * Initializes a new instance of the DataTableResponseColumn class. + * @constructor + * Column definition + * + * @member {string} [columnName] Name of the column + * @member {string} [dataType] Data type which looks like 'String' or 'Int32'. + * @member {string} [columnType] Column Type + */ +export interface DataTableResponseColumn { + columnName?: string; + dataType?: string; + columnType?: string; +} + +/** + * @class + * Initializes a new instance of the DataTableResponseObject class. + * @constructor + * Data Table which defines columns and raw row values + * + * @member {string} [tableName] Name of the table + * @member {array} [columns] List of columns with data types + * @member {array} [rows] Raw row values + */ +export interface DataTableResponseObject { + tableName?: string; + columns?: DataTableResponseColumn[]; + rows?: string[][]; +} + +/** + * @class + * Initializes a new instance of the DetectorInfo class. + * @constructor + * Definition of Detector + * + * @member {string} [description] Short description of the detector and its + * purpose + * @member {string} [category] Support Category + * @member {string} [subCategory] Support Sub Category + * @member {string} [supportTopicId] Support Topic Id + */ +export interface DetectorInfo { + readonly description?: string; + readonly category?: string; + readonly subCategory?: string; + readonly supportTopicId?: string; +} + +/** + * @class + * Initializes a new instance of the Rendering class. + * @constructor + * Instructions for rendering the data + * + * @member {string} [type] Rendering Type. Possible values include: 'NoGraph', + * 'Table', 'TimeSeries', 'TimeSeriesPerInstance' + * @member {string} [title] Title of data + * @member {string} [description] Description of the data that will help it be + * interpreted + */ +export interface Rendering { + type?: string; + title?: string; + description?: string; +} + +/** + * @class + * Initializes a new instance of the DiagnosticData class. + * @constructor + * Set of data with rendering instructions + * + * @member {object} [table] Data in table form + * @member {string} [table.tableName] Name of the table + * @member {array} [table.columns] List of columns with data types + * @member {array} [table.rows] Raw row values + * @member {object} [renderingProperties] Properties that describe how the + * table should be rendered + * @member {string} [renderingProperties.type] Rendering Type. Possible values + * include: 'NoGraph', 'Table', 'TimeSeries', 'TimeSeriesPerInstance' + * @member {string} [renderingProperties.title] Title of data + * @member {string} [renderingProperties.description] Description of the data + * that will help it be interpreted + */ +export interface DiagnosticData { + table?: DataTableResponseObject; + renderingProperties?: Rendering; +} + +/** + * @class + * Initializes a new instance of the DetectorResponse class. + * @constructor + * Class representing Response from Detector + * + * @member {object} [metadata] metadata for the detector + * @member {string} [metadata.description] Short description of the detector + * and its purpose + * @member {string} [metadata.category] Support Category + * @member {string} [metadata.subCategory] Support Sub Category + * @member {string} [metadata.supportTopicId] Support Topic Id + * @member {array} [dataset] Data Set + */ +export interface DetectorResponse extends ProxyOnlyResource { + metadata?: DetectorInfo; + dataset?: DiagnosticData[]; +} + +/** + * @class + * Initializes a new instance of the DiagnosticAnalysis class. + * @constructor + * Class representing a diagnostic analysis done on an application + * + * @member {date} [startTime] Start time of the period + * @member {date} [endTime] End time of the period + * @member {array} [abnormalTimePeriods] List of time periods. + * @member {array} [payload] Data by each detector + * @member {array} [nonCorrelatedDetectors] Data by each detector for detectors + * that did not corelate + */ +export interface DiagnosticAnalysis extends ProxyOnlyResource { + startTime?: Date; + endTime?: Date; + abnormalTimePeriods?: AbnormalTimePeriod[]; + payload?: AnalysisData[]; + nonCorrelatedDetectors?: DetectorDefinition[]; +} + +/** + * @class + * Initializes a new instance of the DiagnosticCategory class. + * @constructor + * Class representing detector definition + * + * @member {string} [description] Description of the diagnostic category + */ +export interface DiagnosticCategory extends ProxyOnlyResource { + readonly description?: string; +} + +/** + * @class + * Initializes a new instance of the DiagnosticDetectorResponse class. + * @constructor + * Class representing Reponse from Diagnostic Detectors + * + * @member {date} [startTime] Start time of the period + * @member {date} [endTime] End time of the period + * @member {boolean} [issueDetected] Flag representing Issue was detected. + * @member {object} [detectorDefinition] Detector's definition + * @member {string} [detectorDefinition.displayName] Display name of the + * detector + * @member {string} [detectorDefinition.description] Description of the + * detector + * @member {number} [detectorDefinition.rank] Detector Rank + * @member {boolean} [detectorDefinition.isEnabled] Flag representing whether + * detector is enabled or not. + * @member {array} [metrics] Metrics provided by the detector + * @member {array} [abnormalTimePeriods] List of Correlated events found by the + * detector + * @member {array} [data] Additional Data that detector wants to send. + * @member {object} [responseMetaData] Meta Data + * @member {object} [responseMetaData.dataSource] Source of the Data + * @member {array} [responseMetaData.dataSource.instructions] Instrunctions if + * any for the data source + * @member {array} [responseMetaData.dataSource.dataSourceUri] Datasource Uri + * Links + */ +export interface DiagnosticDetectorResponse extends ProxyOnlyResource { + startTime?: Date; + endTime?: Date; + issueDetected?: boolean; + detectorDefinition?: DetectorDefinition; + metrics?: DiagnosticMetricSet[]; + abnormalTimePeriods?: DetectorAbnormalTimePeriod[]; + data?: NameValuePair[][]; + responseMetaData?: ResponseMetaData; +} + +/** + * @class + * Initializes a new instance of the StackMinorVersion class. + * @constructor + * Application stack minor version. + * + * @member {string} [displayVersion] Application stack minor version (display + * only). + * @member {string} [runtimeVersion] Application stack minor version (runtime + * only). + * @member {boolean} [isDefault] true if this is the default minor + * version; otherwise, false. + */ +export interface StackMinorVersion { + displayVersion?: string; + runtimeVersion?: string; + isDefault?: boolean; +} + +/** + * @class + * Initializes a new instance of the StackMajorVersion class. + * @constructor + * Application stack major version. + * + * @member {string} [displayVersion] Application stack major version (display + * only). + * @member {string} [runtimeVersion] Application stack major version (runtime + * only). + * @member {boolean} [isDefault] true if this is the default major + * version; otherwise, false. + * @member {array} [minorVersions] Minor versions associated with the major + * version. + */ +export interface StackMajorVersion { + displayVersion?: string; + runtimeVersion?: string; + isDefault?: boolean; + minorVersions?: StackMinorVersion[]; +} + +/** + * @class + * Initializes a new instance of the ApplicationStack class. + * @constructor + * Application stack. + * + * @member {string} [name] Application stack name. + * @member {string} [display] Application stack display name. + * @member {string} [dependency] Application stack dependency. + * @member {array} [majorVersions] List of major versions available. + * @member {array} [frameworks] List of frameworks associated with application + * stack. + */ +export interface ApplicationStack { + name?: string; + display?: string; + dependency?: string; + majorVersions?: StackMajorVersion[]; + frameworks?: ApplicationStack[]; +} + +/** + * @class + * Initializes a new instance of the Recommendation class. + * @constructor + * Represents a recommendation result generated by the recommendation engine. + * + * @member {date} [creationTime] Timestamp when this instance was created. + * @member {uuid} [recommendationId] A GUID value that each recommendation + * object is associated with. + * @member {string} [resourceId] Full ARM resource ID string that this + * recommendation object is associated with. + * @member {string} [resourceScope] Name of a resource type this recommendation + * applies, e.g. Subscription, ServerFarm, Site. Possible values include: + * 'ServerFarm', 'Subscription', 'WebSite' + * @member {string} [ruleName] Unique name of the rule. + * @member {string} [displayName] UI friendly name of the rule (may not be + * unique). + * @member {string} [message] Recommendation text. + * @member {string} [level] Level indicating how critical this recommendation + * can impact. Possible values include: 'Critical', 'Warning', 'Information', + * 'NonUrgentSuggestion' + * @member {string} [channels] List of channels that this recommendation can + * apply. Possible values include: 'Notification', 'Api', 'Email', 'Webhook', + * 'All' + * @member {array} [categoryTags] The list of category tags that this + * recommendation belongs to. + * @member {string} [actionName] Name of action recommended by this object. + * @member {number} [enabled] True if this recommendation is still valid (i.e. + * "actionable"). False if it is invalid. + * @member {array} [states] The list of states of this recommendation. If it's + * null then it shoud be considered "Active". + * @member {date} [startTime] The beginning time in UTC of a range that the + * recommendation refers to. + * @member {date} [endTime] The end time in UTC of a range that the + * recommendation refers to. + * @member {date} [nextNotificationTime] When to notify this recommendation + * next in UTC. Null means that this will never be notified anymore. + * @member {date} [notificationExpirationTime] Date and time in UTC when this + * notification expires. + * @member {date} [notifiedTime] Last timestamp in UTC this instance was + * actually notified. Null means that this recommendation hasn't been notified + * yet. + * @member {number} [score] A metric value measured by the rule. + * @member {boolean} [isDynamic] True if this is associated with a dynamically + * added rule + * @member {string} [extensionName] Extension name of the portal if exists. + * @member {string} [bladeName] Deep link to a blade on the portal. + * @member {string} [forwardLink] Forward link to an external document + * associated with the rule. + */ +export interface Recommendation extends ProxyOnlyResource { + creationTime?: Date; + recommendationId?: string; + resourceId?: string; + resourceScope?: string; + ruleName?: string; + displayName?: string; + message?: string; + level?: string; + channels?: string; + readonly categoryTags?: string[]; + actionName?: string; + enabled?: number; + states?: string[]; + startTime?: Date; + endTime?: Date; + nextNotificationTime?: Date; + notificationExpirationTime?: Date; + notifiedTime?: Date; + score?: number; + isDynamic?: boolean; + extensionName?: string; + bladeName?: string; + forwardLink?: string; +} + +/** + * @class + * Initializes a new instance of the RecommendationRule class. + * @constructor + * Represents a recommendation rule that the recommendation engine can perform. + * + * @member {string} [recommendationName] Unique name of the rule. + * @member {string} [displayName] UI friendly name of the rule. + * @member {string} [message] Localized name of the rule (Good for UI). + * @member {uuid} [recommendationId] Recommendation ID of an associated + * recommendation object tied to the rule, if exists. + * If such an object doesn't exist, it is set to null. + * @member {string} [description] Localized detailed description of the rule. + * @member {string} [actionName] Name of action that is recommended by this + * rule in string. + * @member {string} [level] Level of impact indicating how critical this rule + * is. Possible values include: 'Critical', 'Warning', 'Information', + * 'NonUrgentSuggestion' + * @member {string} [channels] List of available channels that this rule + * applies. Possible values include: 'Notification', 'Api', 'Email', 'Webhook', + * 'All' + * @member {array} [categoryTags] The list of category tags that this + * recommendation rule belongs to. + * @member {boolean} [isDynamic] True if this is associated with a dynamically + * added rule + * @member {string} [extensionName] Extension name of the portal if exists. + * Applicable to dynamic rule only. + * @member {string} [bladeName] Deep link to a blade on the portal. Applicable + * to dynamic rule only. + * @member {string} [forwardLink] Forward link to an external document + * associated with the rule. Applicable to dynamic rule only. + */ +export interface RecommendationRule extends ProxyOnlyResource { + recommendationName?: string; + displayName?: string; + message?: string; + recommendationId?: string; + description?: string; + actionName?: string; + level?: string; + channels?: string; + readonly categoryTags?: string[]; + isDynamic?: boolean; + extensionName?: string; + bladeName?: string; + forwardLink?: string; +} + +/** + * @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 ResourceType meter used for + * @member {string} [osType] App Service OS type meter used for + */ +export interface BillingMeter extends ProxyOnlyResource { + meterId?: string; + billingLocation?: string; + shortName?: string; + friendlyName?: string; + resourceType?: string; + osType?: string; +} + +/** + * @class + * Initializes a new instance of the CsmMoveResourceEnvelope class. + * @constructor + * Object with a list of the resources that need to be moved and the resource + * group they should be moved to. + * + * @member {string} [targetResourceGroup] + * @member {array} [resources] + */ +export interface CsmMoveResourceEnvelope { + targetResourceGroup?: string; + resources?: string[]; +} + +/** + * @class + * Initializes a new instance of the GeoRegion class. + * @constructor + * Geographical region. + * + * @member {string} [description] Region description. + * @member {string} [displayName] Display name for region. + */ +export interface GeoRegion extends ProxyOnlyResource { + readonly description?: string; + readonly displayName?: string; +} + +/** + * @class + * Initializes a new instance of the HostingEnvironmentDeploymentInfo class. + * @constructor + * Information needed to create resources on an App Service Environment. + * + * @member {string} [name] Name of the App Service Environment. + * @member {string} [location] Location of the App Service Environment. + */ +export interface HostingEnvironmentDeploymentInfo { + name?: string; + location?: string; +} + +/** + * @class + * Initializes a new instance of the DeploymentLocations class. + * @constructor + * List of available locations (regions or App Service Environments) for + * deployment of App Service resources. + * + * @member {array} [locations] Available regions. + * @member {array} [hostingEnvironments] Available App Service Environments + * with full descriptions of the environments. + * @member {array} [hostingEnvironmentDeploymentInfos] Available App Service + * Environments with basic information. + */ +export interface DeploymentLocations { + locations?: GeoRegion[]; + hostingEnvironments?: AppServiceEnvironment[]; + hostingEnvironmentDeploymentInfos?: HostingEnvironmentDeploymentInfo[]; +} + +/** + * @class + * Initializes a new instance of the GlobalCsmSkuDescription class. + * @constructor + * A Global SKU Description. + * + * @member {string} [name] Name of the resource SKU. + * @member {string} [tier] Service Tier of the resource SKU. + * @member {string} [size] Size specifier of the resource SKU. + * @member {string} [family] Family code of the resource SKU. + * @member {object} [capacity] Min, max, and default scale values of the SKU. + * @member {number} [capacity.minimum] Minimum number of workers for this App + * Service plan SKU. + * @member {number} [capacity.maximum] Maximum number of workers for this App + * Service plan SKU. + * @member {number} [capacity.default] Default number of workers for this App + * Service plan SKU. + * @member {string} [capacity.scaleType] Available scale configurations for an + * App Service plan. + * @member {array} [locations] Locations of the SKU. + * @member {array} [capabilities] Capabilities of the SKU, e.g., is traffic + * manager enabled? + */ +export interface GlobalCsmSkuDescription { + name?: string; + tier?: string; + size?: string; + family?: string; + capacity?: SkuCapacity; + locations?: string[]; + capabilities?: Capability[]; +} + +/** + * @class + * Initializes a new instance of the PremierAddOnOffer class. + * @constructor + * Premier add-on offer. + * + * @member {string} [sku] Premier add on SKU. + * @member {string} [product] Premier add on offer Product. + * @member {string} [vendor] Premier add on offer Vendor. + * @member {boolean} [promoCodeRequired] true if promotion code is + * required; otherwise, false. + * @member {number} [quota] Premier add on offer Quota. + * @member {string} [webHostingPlanRestrictions] App Service plans this offer + * is restricted to. Possible values include: 'None', 'Free', 'Shared', + * 'Basic', 'Standard', 'Premium' + * @member {string} [privacyPolicyUrl] Privacy policy URL. + * @member {string} [legalTermsUrl] Legal terms URL. + * @member {string} [marketplacePublisher] Marketplace publisher. + * @member {string} [marketplaceOffer] Marketplace offer. + */ +export interface PremierAddOnOffer extends ProxyOnlyResource { + sku?: string; + product?: string; + vendor?: string; + promoCodeRequired?: boolean; + quota?: number; + webHostingPlanRestrictions?: string; + privacyPolicyUrl?: string; + legalTermsUrl?: string; + marketplacePublisher?: string; + marketplaceOffer?: string; +} + +/** + * @class + * Initializes a new instance of the ResourceNameAvailability class. + * @constructor + * Information regarding availbility of a resource name. + * + * @member {boolean} [nameAvailable] true indicates name is valid + * and available. false indicates the name is invalid, + * unavailable, or both. + * @member {string} [reason] Invalid indicates the name provided + * does not match Azure App Service naming requirements. + * AlreadyExists indicates that the name is already in use and is + * therefore unavailable. Possible values include: 'Invalid', 'AlreadyExists' + * @member {string} [message] If reason == invalid, provide the user with the + * reason why the given name is invalid, and provide the resource naming + * requirements so that the user can select a valid name. If reason == + * AlreadyExists, explain that resource name is already in use, and direct them + * to select a different name. + */ +export interface ResourceNameAvailability { + nameAvailable?: boolean; + reason?: string; + message?: string; +} + +/** + * @class + * Initializes a new instance of the ResourceNameAvailabilityRequest class. + * @constructor + * Resource name availability request content. + * + * @member {string} name Resource name to verify. + * @member {string} type Resource type used for verification. Possible values + * include: 'Site', 'Slot', 'HostingEnvironment', 'PublishingUser', + * 'Microsoft.Web/sites', 'Microsoft.Web/sites/slots', + * 'Microsoft.Web/hostingEnvironments', 'Microsoft.Web/publishingUsers' + * @member {boolean} [isFqdn] Is fully qualified domain name. + */ +export interface ResourceNameAvailabilityRequest { + name: string; + type: string; + isFqdn?: boolean; +} + +/** + * @class + * Initializes a new instance of the SkuInfos class. + * @constructor + * Collection of SKU information. + * + * @member {string} [resourceType] Resource type that this SKU applies to. + * @member {array} [skus] List of SKUs the subscription is able to use. + */ +export interface SkuInfos { + resourceType?: string; + skus?: GlobalCsmSkuDescription[]; +} + +/** + * @class + * Initializes a new instance of the SourceControl class. + * @constructor + * The source control OAuth token. + * + * @member {string} [token] OAuth access token. + * @member {string} [tokenSecret] OAuth access token secret. + * @member {string} [refreshToken] OAuth refresh token. + * @member {date} [expirationTime] OAuth token expiration. + */ +export interface SourceControl extends ProxyOnlyResource { + token?: string; + tokenSecret?: string; + refreshToken?: string; + expirationTime?: Date; +} + +/** + * @class + * Initializes a new instance of the ValidateRequest class. + * @constructor + * Resource validation request content. + * + * @member {string} name Resource name to verify. + * @member {string} type Resource type used for verification. Possible values + * include: 'ServerFarm', 'Site' + * @member {string} location Expected location of the resource. + * @member {string} [serverFarmId] ARM resource ID of an App Service plan that + * would host the app. + * @member {string} [skuName] Name of the target SKU for the App Service plan. + * @member {boolean} [needLinuxWorkers] true if App Service plan + * is for Linux workers; otherwise, false. + * @member {boolean} [isSpot] true if App Service plan is for Spot + * instances; otherwise, false. + * @member {number} [capacity] Target capacity of the App Service plan (number + * of VM's). + * @member {string} [hostingEnvironment] Name of App Service Environment where + * app or App Service plan should be created. + * @member {boolean} [isXenon] true if App Service plan is running + * as a windows container + */ +export interface ValidateRequest { + name: string; + type: string; + location: string; + serverFarmId?: string; + skuName?: string; + needLinuxWorkers?: boolean; + isSpot?: boolean; + capacity?: number; + hostingEnvironment?: string; + isXenon?: boolean; +} + +/** + * @class + * Initializes a new instance of the ValidateResponseError class. + * @constructor + * Error details for when validation fails. + * + * @member {string} [code] Validation error code. + * @member {string} [message] Validation error message. + */ +export interface ValidateResponseError { + code?: string; + message?: string; +} + +/** + * @class + * Initializes a new instance of the ValidateResponse class. + * @constructor + * Describes the result of resource validation. + * + * @member {string} [status] Result of validation. + * @member {object} [error] Error details for the case when validation fails. + * @member {string} [error.code] Validation error code. + * @member {string} [error.message] Validation error message. + */ +export interface ValidateResponse { + status?: string; + error?: ValidateResponseError; +} + +/** + * @class + * Initializes a new instance of the VnetParameters class. + * @constructor + * The required set of inputs to validate a VNET + * + * @member {string} [vnetResourceGroup] The Resource Group of the VNET to be + * validated + * @member {string} [vnetName] The name of the VNET to be validated + * @member {string} [vnetSubnetName] The subnet name to be validated + */ +export interface VnetParameters extends ProxyOnlyResource { + vnetResourceGroup?: string; + vnetName?: string; + vnetSubnetName?: string; +} + +/** + * @class + * Initializes a new instance of the VnetValidationTestFailure class. + * @constructor + * A class that describes a test that failed during NSG and UDR validation. + * + * @member {string} [testName] The name of the test that failed. + * @member {string} [details] The details of what caused the failure, e.g. the + * blocking rule name, etc. + */ +export interface VnetValidationTestFailure extends ProxyOnlyResource { + testName?: string; + details?: string; +} + +/** + * @class + * Initializes a new instance of the VnetValidationFailureDetails class. + * @constructor + * A class that describes the reason for a validation failure. + * + * @member {boolean} [failed] A flag describing whether or not validation + * failed. + * @member {array} [failedTests] A list of tests that failed in the validation. + */ +export interface VnetValidationFailureDetails extends ProxyOnlyResource { + failed?: boolean; + failedTests?: VnetValidationTestFailure[]; +} + +/** + * @class + * Initializes a new instance of the FileSystemApplicationLogsConfig class. + * @constructor + * Application logs to file system configuration. + * + * @member {string} [level] Log level. Possible values include: 'Off', + * 'Verbose', 'Information', 'Warning', 'Error'. Default value: 'Off' . + */ +export interface FileSystemApplicationLogsConfig { + level?: string; +} + +/** + * @class + * Initializes a new instance of the AzureTableStorageApplicationLogsConfig class. + * @constructor + * Application logs to Azure table storage configuration. + * + * @member {string} [level] Log level. Possible values include: 'Off', + * 'Verbose', 'Information', 'Warning', 'Error' + * @member {string} sasUrl SAS URL to an Azure table with add/query/delete + * permissions. + */ +export interface AzureTableStorageApplicationLogsConfig { + level?: string; + sasUrl: string; +} + +/** + * @class + * Initializes a new instance of the AzureBlobStorageApplicationLogsConfig class. + * @constructor + * Application logs azure blob storage configuration. + * + * @member {string} [level] Log level. Possible values include: 'Off', + * 'Verbose', 'Information', 'Warning', 'Error' + * @member {string} [sasUrl] SAS url to a azure blob container with + * read/write/list/delete permissions. + * @member {number} [retentionInDays] Retention in days. + * Remove blobs older than X days. + * 0 or lower means no retention. + */ +export interface AzureBlobStorageApplicationLogsConfig { + level?: string; + sasUrl?: string; + retentionInDays?: number; +} + +/** + * @class + * Initializes a new instance of the ApplicationLogsConfig class. + * @constructor + * Application logs configuration. + * + * @member {object} [fileSystem] Application logs to file system configuration. + * @member {string} [fileSystem.level] Log level. Possible values include: + * 'Off', 'Verbose', 'Information', 'Warning', 'Error' + * @member {object} [azureTableStorage] Application logs to azure table storage + * configuration. + * @member {string} [azureTableStorage.level] Log level. Possible values + * include: 'Off', 'Verbose', 'Information', 'Warning', 'Error' + * @member {string} [azureTableStorage.sasUrl] SAS URL to an Azure table with + * add/query/delete permissions. + * @member {object} [azureBlobStorage] Application logs to blob storage + * configuration. + * @member {string} [azureBlobStorage.level] Log level. Possible values + * include: 'Off', 'Verbose', 'Information', 'Warning', 'Error' + * @member {string} [azureBlobStorage.sasUrl] SAS url to a azure blob container + * with read/write/list/delete permissions. + * @member {number} [azureBlobStorage.retentionInDays] Retention in days. + * Remove blobs older than X days. + * 0 or lower means no retention. + */ +export interface ApplicationLogsConfig { + fileSystem?: FileSystemApplicationLogsConfig; + azureTableStorage?: AzureTableStorageApplicationLogsConfig; + azureBlobStorage?: AzureBlobStorageApplicationLogsConfig; +} + +/** + * @class + * Initializes a new instance of the AzureBlobStorageHttpLogsConfig class. + * @constructor + * Http logs to azure blob storage configuration. + * + * @member {string} [sasUrl] SAS url to a azure blob container with + * read/write/list/delete permissions. + * @member {number} [retentionInDays] Retention in days. + * Remove blobs older than X days. + * 0 or lower means no retention. + * @member {boolean} [enabled] True if configuration is enabled, false if it is + * disabled and null if configuration is not set. + */ +export interface AzureBlobStorageHttpLogsConfig { + sasUrl?: string; + retentionInDays?: number; + enabled?: boolean; +} + +/** + * @class + * Initializes a new instance of the AzureStoragePropertyDictionaryResource class. + * @constructor + * AzureStorageInfo dictionary resource. + * + * @member {object} [properties] Azure storage accounts. + */ +export interface AzureStoragePropertyDictionaryResource extends ProxyOnlyResource { + properties?: { [propertyName: string]: AzureStorageInfoValue }; +} + +/** + * @class + * Initializes a new instance of the DatabaseBackupSetting class. + * @constructor + * Database backup settings. + * + * @member {string} databaseType Database type (e.g. SqlAzure / MySql). + * Possible values include: 'SqlAzure', 'MySql', 'LocalMySql', 'PostgreSql' + * @member {string} [name] + * @member {string} [connectionStringName] Contains a connection string name + * that is linked to the SiteConfig.ConnectionStrings. + * This is used during restore with overwrite connection strings options. + * @member {string} [connectionString] Contains a connection string to a + * database which is being backed up or restored. If the restore should happen + * to a new database, the database name inside is the new one. + */ +export interface DatabaseBackupSetting { + databaseType: string; + name?: string; + connectionStringName?: string; + connectionString?: string; +} + +/** + * @class + * Initializes a new instance of the BackupItem class. + * @constructor + * Backup description. + * + * @member {number} [backupId] Id of the backup. + * @member {string} [storageAccountUrl] SAS URL for the storage account + * container which contains this backup. + * @member {string} [blobName] Name of the blob which contains data for this + * backup. + * @member {string} [backupItemName] Name of this backup. + * @member {string} [status] Backup status. Possible values include: + * 'InProgress', 'Failed', 'Succeeded', 'TimedOut', 'Created', 'Skipped', + * 'PartiallySucceeded', 'DeleteInProgress', 'DeleteFailed', 'Deleted' + * @member {number} [sizeInBytes] Size of the backup in bytes. + * @member {date} [created] Timestamp of the backup creation. + * @member {string} [log] Details regarding this backup. Might contain an error + * message. + * @member {array} [databases] List of databases included in the backup. + * @member {boolean} [scheduled] True if this backup has been created due to a + * schedule being triggered. + * @member {date} [lastRestoreTimeStamp] Timestamp of a last restore operation + * which used this backup. + * @member {date} [finishedTimeStamp] Timestamp when this backup finished. + * @member {string} [correlationId] Unique correlation identifier. Please use + * this along with the timestamp while communicating with Azure support. + * @member {number} [websiteSizeInBytes] Size of the original web app which has + * been backed up. + */ +export interface BackupItem extends ProxyOnlyResource { + readonly backupId?: number; + readonly storageAccountUrl?: string; + readonly blobName?: string; + readonly backupItemName?: string; + readonly status?: string; + readonly sizeInBytes?: number; + readonly created?: Date; + readonly log?: string; + readonly databases?: DatabaseBackupSetting[]; + readonly scheduled?: boolean; + readonly lastRestoreTimeStamp?: Date; + readonly finishedTimeStamp?: Date; + readonly correlationId?: string; + readonly websiteSizeInBytes?: number; +} + +/** + * @class + * Initializes a new instance of the BackupSchedule class. + * @constructor + * Description of a backup schedule. Describes how often should be the backup + * performed and what should be the retention policy. + * + * @member {number} frequencyInterval How often the backup should be executed + * (e.g. for weekly backup, this should be set to 7 and FrequencyUnit should be + * set to Day). Default value: 7 . + * @member {string} frequencyUnit The unit of time for how often the backup + * should be executed (e.g. for weekly backup, this should be set to Day and + * FrequencyInterval should be set to 7). Possible values include: 'Day', + * 'Hour'. Default value: 'Day' . + * @member {boolean} keepAtLeastOneBackup True if the retention policy should + * always keep at least one backup in the storage account, regardless how old + * it is; false otherwise. Default value: true . + * @member {number} retentionPeriodInDays After how many days backups should be + * deleted. Default value: 30 . + * @member {date} [startTime] When the schedule should start working. + * @member {date} [lastExecutionTime] Last time when this schedule was + * triggered. + */ +export interface BackupSchedule { + frequencyInterval: number; + frequencyUnit: string; + keepAtLeastOneBackup: boolean; + retentionPeriodInDays: number; + startTime?: Date; + readonly lastExecutionTime?: Date; +} + +/** + * @class + * Initializes a new instance of the BackupRequest class. + * @constructor + * Description of a backup which will be performed. + * + * @member {string} [backupName] Name of the backup. + * @member {boolean} [enabled] True if the backup schedule is enabled (must be + * included in that case), false if the backup schedule should be disabled. + * @member {string} storageAccountUrl SAS URL to the container. + * @member {object} [backupSchedule] Schedule for the backup if it is executed + * periodically. + * @member {number} [backupSchedule.frequencyInterval] How often the backup + * should be executed (e.g. for weekly backup, this should be set to 7 and + * FrequencyUnit should be set to Day) + * @member {string} [backupSchedule.frequencyUnit] The unit of time for how + * often the backup should be executed (e.g. for weekly backup, this should be + * set to Day and FrequencyInterval should be set to 7). Possible values + * include: 'Day', 'Hour' + * @member {boolean} [backupSchedule.keepAtLeastOneBackup] True if the + * retention policy should always keep at least one backup in the storage + * account, regardless how old it is; false otherwise. + * @member {number} [backupSchedule.retentionPeriodInDays] After how many days + * backups should be deleted. + * @member {date} [backupSchedule.startTime] When the schedule should start + * working. + * @member {date} [backupSchedule.lastExecutionTime] Last time when this + * schedule was triggered. + * @member {array} [databases] Databases included in the backup. + */ +export interface BackupRequest extends ProxyOnlyResource { + backupName?: string; + enabled?: boolean; + storageAccountUrl: string; + backupSchedule?: BackupSchedule; + databases?: DatabaseBackupSetting[]; +} + +/** + * @class + * Initializes a new instance of the ConnStringValueTypePair class. + * @constructor + * Database connection string value to type pair. + * + * @member {string} value Value of pair. + * @member {string} type Type of database. Possible values include: 'MySql', + * 'SQLServer', 'SQLAzure', 'Custom', 'NotificationHub', 'ServiceBus', + * 'EventHub', 'ApiHub', 'DocDb', 'RedisCache', 'PostgreSQL' + */ +export interface ConnStringValueTypePair { + value: string; + type: string; +} + +/** + * @class + * Initializes a new instance of the ConnectionStringDictionary class. + * @constructor + * String dictionary resource. + * + * @member {object} [properties] Connection strings. + */ +export interface ConnectionStringDictionary extends ProxyOnlyResource { + properties?: { [propertyName: string]: ConnStringValueTypePair }; +} + +/** + * @class + * Initializes a new instance of the ContinuousWebJob class. + * @constructor + * Continuous Web Job Information. + * + * @member {string} [status] Job status. Possible values include: + * 'Initializing', 'Starting', 'Running', 'PendingRestart', 'Stopped' + * @member {string} [detailedStatus] Detailed status. + * @member {string} [logUrl] Log URL. + * @member {string} [runCommand] Run command. + * @member {string} [url] Job URL. + * @member {string} [extraInfoUrl] Extra Info URL. + * @member {string} [webJobType] Job type. Possible values include: + * 'Continuous', 'Triggered' + * @member {string} [error] Error information. + * @member {boolean} [usingSdk] Using SDK? + * @member {object} [settings] Job settings. + */ +export interface ContinuousWebJob extends ProxyOnlyResource { + status?: string; + detailedStatus?: string; + logUrl?: string; + runCommand?: string; + url?: string; + extraInfoUrl?: string; + webJobType?: string; + error?: string; + usingSdk?: boolean; + settings?: { [propertyName: string]: any }; +} + +/** + * @class + * Initializes a new instance of the CsmPublishingProfileOptions class. + * @constructor + * Publishing options for requested profile. + * + * @member {string} [format] Name of the format. Valid values are: + * FileZilla3 + * WebDeploy -- default + * Ftp. Possible values include: 'FileZilla3', 'WebDeploy', 'Ftp' + * @member {boolean} [includeDisasterRecoveryEndpoints] Include the + * DisasterRecover endpoint if true + */ +export interface CsmPublishingProfileOptions { + format?: string; + includeDisasterRecoveryEndpoints?: boolean; +} + +/** + * @class + * Initializes a new instance of the CsmSlotEntity class. + * @constructor + * Deployment slot parameters. + * + * @member {string} targetSlot Destination deployment slot during swap + * operation. + * @member {boolean} preserveVnet true to preserve Virtual Network + * to the slot during swap; otherwise, false. + */ +export interface CsmSlotEntity { + targetSlot: string; + preserveVnet: boolean; +} + +/** + * @class + * Initializes a new instance of the CustomHostnameAnalysisResult class. + * @constructor + * Custom domain analysis. + * + * @member {boolean} [isHostnameAlreadyVerified] true if hostname + * is already verified; otherwise, false. + * @member {string} [customDomainVerificationTest] DNS verification test + * result. Possible values include: 'Passed', 'Failed', 'Skipped' + * @member {object} [customDomainVerificationFailureInfo] Raw failure + * information if DNS verification fails. + * @member {string} [customDomainVerificationFailureInfo.extendedCode] Type of + * error. + * @member {string} [customDomainVerificationFailureInfo.messageTemplate] + * Message template. + * @member {array} [customDomainVerificationFailureInfo.parameters] Parameters + * for the template. + * @member {array} [customDomainVerificationFailureInfo.innerErrors] Inner + * errors. + * @member {string} [customDomainVerificationFailureInfo.code] Basic error + * code. + * @member {string} [customDomainVerificationFailureInfo.message] Any details + * of the error. + * @member {boolean} [hasConflictOnScaleUnit] true if there is a + * conflict on a scale unit; otherwise, false. + * @member {boolean} [hasConflictAcrossSubscription] true if htere + * is a conflict across subscriptions; otherwise, false. + * @member {string} [conflictingAppResourceId] Name of the conflicting app on + * scale unit if it's within the same subscription. + * @member {array} [cNameRecords] CName records controller can see for this + * hostname. + * @member {array} [txtRecords] TXT records controller can see for this + * hostname. + * @member {array} [aRecords] A records controller can see for this hostname. + * @member {array} [alternateCNameRecords] Alternate CName records controller + * can see for this hostname. + * @member {array} [alternateTxtRecords] Alternate TXT records controller can + * see for this hostname. + */ +export interface CustomHostnameAnalysisResult extends ProxyOnlyResource { + readonly isHostnameAlreadyVerified?: boolean; + readonly customDomainVerificationTest?: string; + readonly customDomainVerificationFailureInfo?: ErrorEntity; + readonly hasConflictOnScaleUnit?: boolean; + readonly hasConflictAcrossSubscription?: boolean; + readonly conflictingAppResourceId?: string; + cNameRecords?: string[]; + txtRecords?: string[]; + aRecords?: string[]; + alternateCNameRecords?: string[]; + alternateTxtRecords?: string[]; +} + +/** + * @class + * Initializes a new instance of the DeletedAppRestoreRequest class. + * @constructor + * Details about restoring a deleted app. + * + * @member {string} [deletedSiteId] ARM resource ID of the deleted app. + * Example: + * /subscriptions/{subId}/providers/Microsoft.Web/deletedSites/{deletedSiteId} + * @member {boolean} [recoverConfiguration] If true, deleted site + * configuration, in addition to content, will be restored. + * @member {string} [snapshotTime] Point in time to restore the deleted app + * from, formatted as a DateTime string. + * If unspecified, default value is the time that the app was deleted. + */ +export interface DeletedAppRestoreRequest extends ProxyOnlyResource { + deletedSiteId?: string; + recoverConfiguration?: boolean; + snapshotTime?: string; +} + +/** + * @class + * Initializes a new instance of the Deployment class. + * @constructor + * User crendentials used for publishing activity. + * + * @member {number} [status] Deployment status. + * @member {string} [message] Details about deployment status. + * @member {string} [author] Who authored the deployment. + * @member {string} [deployer] Who performed the deployment. + * @member {string} [authorEmail] Author email. + * @member {date} [startTime] Start time. + * @member {date} [endTime] End time. + * @member {boolean} [active] True if deployment is currently active, false if + * completed and null if not started. + * @member {string} [details] Details on deployment. + */ +export interface Deployment extends ProxyOnlyResource { + status?: number; + message?: string; + author?: string; + deployer?: string; + authorEmail?: string; + startTime?: Date; + endTime?: Date; + active?: boolean; + details?: string; +} + +/** + * @class + * Initializes a new instance of the EnabledConfig class. + * @constructor + * Enabled configuration. + * + * @member {boolean} [enabled] True if configuration is enabled, false if it is + * disabled and null if configuration is not set. + */ +export interface EnabledConfig { + enabled?: boolean; +} + +/** + * @class + * Initializes a new instance of the FileSystemHttpLogsConfig class. + * @constructor + * Http logs to file system configuration. + * + * @member {number} [retentionInMb] Maximum size in megabytes that http log + * files can use. + * When reached old log files will be removed to make space for new ones. + * Value can range between 25 and 100. + * @member {number} [retentionInDays] Retention in days. + * Remove files older than X days. + * 0 or lower means no retention. + * @member {boolean} [enabled] True if configuration is enabled, false if it is + * disabled and null if configuration is not set. + */ +export interface FileSystemHttpLogsConfig { + retentionInMb?: number; + retentionInDays?: number; + enabled?: boolean; +} + +/** + * @class + * Initializes a new instance of the FunctionEnvelope class. + * @constructor + * Web Job Information. + * + * @member {string} [functionAppId] Function App ID. + * @member {string} [scriptRootPathHref] Script root path URI. + * @member {string} [scriptHref] Script URI. + * @member {string} [configHref] Config URI. + * @member {string} [secretsFileHref] Secrets file URI. + * @member {string} [href] Function URI. + * @member {object} [config] Config information. + * @member {object} [files] File list. + * @member {string} [testData] Test data used when testing via the Azure + * Portal. + */ +export interface FunctionEnvelope extends ProxyOnlyResource { + functionAppId?: string; + scriptRootPathHref?: string; + scriptHref?: string; + configHref?: string; + secretsFileHref?: string; + href?: string; + config?: any; + files?: { [propertyName: string]: string }; + testData?: string; +} + +/** + * @class + * Initializes a new instance of the FunctionSecrets class. + * @constructor + * Function secrets. + * + * @member {string} [key] Secret key. + * @member {string} [triggerUrl] Trigger URL. + */ +export interface FunctionSecrets extends ProxyOnlyResource { + key?: string; + triggerUrl?: string; +} + +/** + * @class + * Initializes a new instance of the HostNameBinding class. + * @constructor + * A hostname binding object. + * + * @member {string} [siteName] App Service app name. + * @member {string} [domainId] Fully qualified ARM domain resource URI. + * @member {string} [azureResourceName] Azure resource name. + * @member {string} [azureResourceType] Azure resource type. Possible values + * include: 'Website', 'TrafficManager' + * @member {string} [customHostNameDnsRecordType] Custom DNS record type. + * Possible values include: 'CName', 'A' + * @member {string} [hostNameType] Hostname type. Possible values include: + * 'Verified', 'Managed' + * @member {string} [sslState] SSL type. Possible values include: 'Disabled', + * 'SniEnabled', 'IpBasedEnabled' + * @member {string} [thumbprint] SSL certificate thumbprint + * @member {string} [virtualIP] Virtual IP address assigned to the hostname if + * IP based SSL is enabled. + */ +export interface HostNameBinding extends ProxyOnlyResource { + siteName?: string; + domainId?: string; + azureResourceName?: string; + azureResourceType?: string; + customHostNameDnsRecordType?: string; + hostNameType?: string; + sslState?: string; + thumbprint?: string; + readonly virtualIP?: string; +} + +/** + * @class + * Initializes a new instance of the HttpLogsConfig class. + * @constructor + * Http logs configuration. + * + * @member {object} [fileSystem] Http logs to file system configuration. + * @member {number} [fileSystem.retentionInMb] Maximum size in megabytes that + * http log files can use. + * When reached old log files will be removed to make space for new ones. + * Value can range between 25 and 100. + * @member {number} [fileSystem.retentionInDays] Retention in days. + * Remove files older than X days. + * 0 or lower means no retention. + * @member {boolean} [fileSystem.enabled] True if configuration is enabled, + * false if it is disabled and null if configuration is not set. + * @member {object} [azureBlobStorage] Http logs to azure blob storage + * configuration. + * @member {string} [azureBlobStorage.sasUrl] SAS url to a azure blob container + * with read/write/list/delete permissions. + * @member {number} [azureBlobStorage.retentionInDays] Retention in days. + * Remove blobs older than X days. + * 0 or lower means no retention. + * @member {boolean} [azureBlobStorage.enabled] True if configuration is + * enabled, false if it is disabled and null if configuration is not set. + */ +export interface HttpLogsConfig { + fileSystem?: FileSystemHttpLogsConfig; + azureBlobStorage?: AzureBlobStorageHttpLogsConfig; +} + +/** + * @class + * Initializes a new instance of the MSDeploy class. + * @constructor + * MSDeploy ARM PUT information + * + * @member {string} [packageUri] Package URI + * @member {string} [connectionString] SQL Connection String + * @member {string} [dbType] Database Type + * @member {string} [setParametersXmlFileUri] URI of MSDeploy Parameters file. + * Must not be set if SetParameters is used. + * @member {object} [setParameters] MSDeploy Parameters. Must not be set if + * SetParametersXmlFileUri is used. + * @member {boolean} [skipAppData] Controls whether the MSDeploy operation + * skips the App_Data directory. + * If set to true, the existing App_Data directory on the + * destination + * will not be deleted, and any App_Data directory in the source will be + * ignored. + * Setting is false by default. + * @member {boolean} [appOffline] Sets the AppOffline rule while the MSDeploy + * operation executes. + * Setting is false by default. + */ +export interface MSDeploy extends ProxyOnlyResource { + packageUri?: string; + connectionString?: string; + dbType?: string; + setParametersXmlFileUri?: string; + setParameters?: { [propertyName: string]: string }; + skipAppData?: boolean; + appOffline?: boolean; +} + +/** + * @class + * Initializes a new instance of the MSDeployLogEntry class. + * @constructor + * MSDeploy log entry + * + * @member {date} [time] Timestamp of log entry + * @member {string} [type] Log entry type. Possible values include: 'Message', + * 'Warning', 'Error' + * @member {string} [message] Log entry message + */ +export interface MSDeployLogEntry { + readonly time?: Date; + readonly type?: string; + readonly message?: string; +} + +/** + * @class + * Initializes a new instance of the MSDeployLog class. + * @constructor + * MSDeploy log + * + * @member {array} [entries] List of log entry messages + */ +export interface MSDeployLog extends ProxyOnlyResource { + readonly entries?: MSDeployLogEntry[]; +} + +/** + * @class + * Initializes a new instance of the MSDeployStatus class. + * @constructor + * MSDeploy ARM response + * + * @member {string} [deployer] Username of deployer + * @member {string} [provisioningState] Provisioning state. Possible values + * include: 'accepted', 'running', 'succeeded', 'failed', 'canceled' + * @member {date} [startTime] Start time of deploy operation + * @member {date} [endTime] End time of deploy operation + * @member {boolean} [complete] Whether the deployment operation has completed + */ +export interface MSDeployStatus extends ProxyOnlyResource { + readonly deployer?: string; + readonly provisioningState?: string; + readonly startTime?: Date; + readonly endTime?: Date; + readonly complete?: boolean; +} + +/** + * @class + * Initializes a new instance of the MigrateMySqlRequest class. + * @constructor + * MySQL migration request. + * + * @member {string} connectionString Connection string to the remote MySQL + * database. + * @member {string} migrationType The type of migration operation to be done. + * Possible values include: 'LocalToRemote', 'RemoteToLocal' + */ +export interface MigrateMySqlRequest extends ProxyOnlyResource { + connectionString: string; + migrationType: string; +} + +/** + * @class + * Initializes a new instance of the MigrateMySqlStatus class. + * @constructor + * MySQL migration status. + * + * @member {string} [migrationOperationStatus] Status of the migration task. + * Possible values include: 'InProgress', 'Failed', 'Succeeded', 'TimedOut', + * 'Created' + * @member {string} [operationId] Operation ID for the migration task. + * @member {boolean} [localMySqlEnabled] True if the web app has in app MySql + * enabled + */ +export interface MigrateMySqlStatus extends ProxyOnlyResource { + readonly migrationOperationStatus?: string; + readonly operationId?: string; + readonly localMySqlEnabled?: boolean; +} + +/** + * @class + * Initializes a new instance of the RelayServiceConnectionEntity class. + * @constructor + * Hybrid Connection for an App Service app. + * + * @member {string} [entityName] + * @member {string} [entityConnectionString] + * @member {string} [resourceType] + * @member {string} [resourceConnectionString] + * @member {string} [hostname] + * @member {number} [port] + * @member {string} [biztalkUri] + */ +export interface RelayServiceConnectionEntity extends ProxyOnlyResource { + entityName?: string; + entityConnectionString?: string; + resourceType?: string; + resourceConnectionString?: string; + hostname?: string; + port?: number; + biztalkUri?: string; +} + +/** + * @class + * Initializes a new instance of the NetworkFeatures class. + * @constructor + * Full view of network features for an app (presently VNET integration and + * Hybrid Connections). + * + * @member {string} [virtualNetworkName] The Virtual Network name. + * @member {object} [virtualNetworkConnection] The Virtual Network summary + * view. + * @member {string} [virtualNetworkConnection.vnetResourceId] The Virtual + * Network's resource ID. + * @member {string} [virtualNetworkConnection.certThumbprint] The client + * certificate thumbprint. + * @member {buffer} [virtualNetworkConnection.certBlob] A certificate file + * (.cer) blob containing the public key of the private key used to + * authenticate a + * Point-To-Site VPN connection. + * @member {array} [virtualNetworkConnection.routes] The routes that this + * Virtual Network connection uses. + * @member {boolean} [virtualNetworkConnection.resyncRequired] + * true if a resync is required; otherwise, false. + * @member {string} [virtualNetworkConnection.dnsServers] DNS servers to be + * used by this Virtual Network. This should be a comma-separated list of IP + * addresses. + * @member {array} [hybridConnections] The Hybrid Connections summary view. + * @member {array} [hybridConnectionsV2] The Hybrid Connection V2 (Service Bus) + * view. + */ +export interface NetworkFeatures extends ProxyOnlyResource { + readonly virtualNetworkName?: string; + readonly virtualNetworkConnection?: VnetInfo; + readonly hybridConnections?: RelayServiceConnectionEntity[]; + readonly hybridConnectionsV2?: HybridConnection[]; +} + +/** + * @class + * Initializes a new instance of the PerfMonSample class. + * @constructor + * Performance monitor sample in a set. + * + * @member {date} [time] Point in time for which counter was measured. + * @member {string} [instanceName] Name of the server on which the measurement + * is made. + * @member {number} [value] Value of counter at a certain time. + */ +export interface PerfMonSample { + time?: Date; + instanceName?: string; + value?: number; +} + +/** + * @class + * Initializes a new instance of the PerfMonSet class. + * @constructor + * Metric information. + * + * @member {string} [name] Unique key name of the counter. + * @member {date} [startTime] Start time of the period. + * @member {date} [endTime] End time of the period. + * @member {string} [timeGrain] Presented time grain. + * @member {array} [values] Collection of workers that are active during this + * time. + */ +export interface PerfMonSet { + name?: string; + startTime?: Date; + endTime?: Date; + timeGrain?: string; + values?: PerfMonSample[]; +} + +/** + * @class + * Initializes a new instance of the PerfMonResponse class. + * @constructor + * Performance monitor API response. + * + * @member {string} [code] The response code. + * @member {string} [message] The message. + * @member {object} [data] The performance monitor counters. + * @member {string} [data.name] Unique key name of the counter. + * @member {date} [data.startTime] Start time of the period. + * @member {date} [data.endTime] End time of the period. + * @member {string} [data.timeGrain] Presented time grain. + * @member {array} [data.values] Collection of workers that are active during + * this time. + */ +export interface PerfMonResponse { + code?: string; + message?: string; + data?: PerfMonSet; +} + +/** + * @class + * Initializes a new instance of the PremierAddOn class. + * @constructor + * Premier add-on. + * + * @member {string} [sku] Premier add on SKU. + * @member {string} [product] Premier add on Product. + * @member {string} [vendor] Premier add on Vendor. + * @member {string} [marketplacePublisher] Premier add on Marketplace + * publisher. + * @member {string} [marketplaceOffer] Premier add on Marketplace offer. + */ +export interface PremierAddOn extends Resource { + sku?: string; + product?: string; + vendor?: string; + marketplacePublisher?: string; + marketplaceOffer?: string; +} + +/** + * @class + * Initializes a new instance of the PremierAddOnPatchResource class. + * @constructor + * ARM resource for a PremierAddOn. + * + * @member {string} [sku] Premier add on SKU. + * @member {string} [product] Premier add on Product. + * @member {string} [vendor] Premier add on Vendor. + * @member {string} [marketplacePublisher] Premier add on Marketplace + * publisher. + * @member {string} [marketplaceOffer] Premier add on Marketplace offer. + */ +export interface PremierAddOnPatchResource extends ProxyOnlyResource { + sku?: string; + product?: string; + vendor?: string; + marketplacePublisher?: string; + marketplaceOffer?: string; +} + +/** + * @class + * Initializes a new instance of the PrivateAccessSubnet class. + * @constructor + * Description of a Virtual Network subnet that is useable for private site + * access. + * + * @member {string} [name] The name of the subnet. + * @member {number} [key] The key (ID) of the subnet. + */ +export interface PrivateAccessSubnet { + name?: string; + key?: number; +} + +/** + * @class + * Initializes a new instance of the PrivateAccessVirtualNetwork class. + * @constructor + * Description of a Virtual Network that is useable for private site access. + * + * @member {string} [name] The name of the Virtual Network. + * @member {number} [key] The key (ID) of the Virtual Network. + * @member {string} [resourceId] The ARM uri of the Virtual Network + * @member {array} [subnets] A List of subnets that access is allowed to on + * this Virtual Network. An empty array (but not null) is interpreted to mean + * that all subnets are allowed within this Virtual Network. + */ +export interface PrivateAccessVirtualNetwork { + name?: string; + key?: number; + resourceId?: string; + subnets?: PrivateAccessSubnet[]; +} + +/** + * @class + * Initializes a new instance of the PrivateAccess class. + * @constructor + * Description of the parameters of Private Access for a Web Site. + * + * @member {boolean} [enabled] Whether private access is enabled or not. + * @member {array} [virtualNetworks] The Virtual Networks (and subnets) allowed + * to access the site privately. + */ +export interface PrivateAccess extends ProxyOnlyResource { + enabled?: boolean; + virtualNetworks?: PrivateAccessVirtualNetwork[]; +} + +/** + * @class + * Initializes a new instance of the ProcessThreadInfo class. + * @constructor + * Process Thread Information. + * + * @member {number} [identifier] Site extension ID. + * @member {string} [href] HRef URI. + * @member {string} [process] Process URI. + * @member {string} [startAddress] Start address. + * @member {number} [currentPriority] Current thread priority. + * @member {string} [priorityLevel] Thread priority level. + * @member {number} [basePriority] Base priority. + * @member {date} [startTime] Start time. + * @member {string} [totalProcessorTime] Total processor time. + * @member {string} [userProcessorTime] User processor time. + * @member {string} [priviledgedProcessorTime] Priviledged processor time. + * @member {string} [state] Thread state. + * @member {string} [waitReason] Wait reason. + */ +export interface ProcessThreadInfo extends ProxyOnlyResource { + readonly identifier?: number; + href?: string; + process?: string; + startAddress?: string; + currentPriority?: number; + priorityLevel?: string; + basePriority?: number; + startTime?: Date; + totalProcessorTime?: string; + userProcessorTime?: string; + priviledgedProcessorTime?: string; + state?: string; + waitReason?: string; +} + +/** + * @class + * Initializes a new instance of the ProcessModuleInfo class. + * @constructor + * Process Module Information. + * + * @member {string} [baseAddress] Base address. Used as module identifier in + * ARM resource URI. + * @member {string} [fileName] File name. + * @member {string} [href] HRef URI. + * @member {string} [filePath] File path. + * @member {number} [moduleMemorySize] Module memory size. + * @member {string} [fileVersion] File version. + * @member {string} [fileDescription] File description. + * @member {string} [product] Product name. + * @member {string} [productVersion] Product version. + * @member {boolean} [isDebug] Is debug? + * @member {string} [language] Module language (locale). + */ +export interface ProcessModuleInfo extends ProxyOnlyResource { + baseAddress?: string; + fileName?: string; + href?: string; + filePath?: string; + moduleMemorySize?: number; + fileVersion?: string; + fileDescription?: string; + product?: string; + productVersion?: string; + isDebug?: boolean; + language?: string; +} + +/** + * @class + * Initializes a new instance of the ProcessInfo class. + * @constructor + * Process Information. + * + * @member {number} [identifier] ARM Identifier for deployment. + * @member {string} [deploymentName] Deployment name. + * @member {string} [href] HRef URI. + * @member {string} [minidump] Minidump URI. + * @member {boolean} [isProfileRunning] Is profile running? + * @member {boolean} [isIisProfileRunning] Is the IIS Profile running? + * @member {number} [iisProfileTimeoutInSeconds] IIS Profile timeout (seconds). + * @member {string} [parent] Parent process. + * @member {array} [children] Child process list. + * @member {array} [threads] Thread list. + * @member {array} [openFileHandles] List of open files. + * @member {array} [modules] List of modules. + * @member {string} [fileName] File name of this process. + * @member {string} [commandLine] Command line. + * @member {string} [userName] User name. + * @member {number} [handleCount] Handle count. + * @member {number} [moduleCount] Module count. + * @member {number} [threadCount] Thread count. + * @member {date} [startTime] Start time. + * @member {string} [totalCpuTime] Total CPU time. + * @member {string} [userCpuTime] User CPU time. + * @member {string} [privilegedCpuTime] Privileged CPU time. + * @member {number} [workingSet] Working set. + * @member {number} [peakWorkingSet] Peak working set. + * @member {number} [privateMemory] Private memory size. + * @member {number} [virtualMemory] Virtual memory size. + * @member {number} [peakVirtualMemory] Peak virtual memory usage. + * @member {number} [pagedSystemMemory] Paged system memory. + * @member {number} [nonPagedSystemMemory] Non-paged system memory. + * @member {number} [pagedMemory] Paged memory. + * @member {number} [peakPagedMemory] Peak paged memory. + * @member {date} [timeStamp] Time stamp. + * @member {object} [environmentVariables] List of environment variables. + * @member {boolean} [isScmSite] Is this the SCM site? + * @member {boolean} [isWebjob] Is this a Web Job? + * @member {string} [description] Description of process. + */ +export interface ProcessInfo extends ProxyOnlyResource { + readonly identifier?: number; + deploymentName?: string; + href?: string; + minidump?: string; + isProfileRunning?: boolean; + isIisProfileRunning?: boolean; + iisProfileTimeoutInSeconds?: number; + parent?: string; + children?: string[]; + threads?: ProcessThreadInfo[]; + openFileHandles?: string[]; + modules?: ProcessModuleInfo[]; + fileName?: string; + commandLine?: string; + userName?: string; + handleCount?: number; + moduleCount?: number; + threadCount?: number; + startTime?: Date; + totalCpuTime?: string; + userCpuTime?: string; + privilegedCpuTime?: string; + workingSet?: number; + peakWorkingSet?: number; + privateMemory?: number; + virtualMemory?: number; + peakVirtualMemory?: number; + pagedSystemMemory?: number; + nonPagedSystemMemory?: number; + pagedMemory?: number; + peakPagedMemory?: number; + timeStamp?: Date; + environmentVariables?: { [propertyName: string]: string }; + isScmSite?: boolean; + isWebjob?: boolean; + description?: string; +} + +/** + * @class + * Initializes a new instance of the PublicCertificate class. + * @constructor + * Public certificate object + * + * @member {buffer} [blob] Public Certificate byte array + * @member {string} [publicCertificateLocation] Public Certificate Location. + * Possible values include: 'CurrentUserMy', 'LocalMachineMy', 'Unknown' + * @member {string} [thumbprint] Certificate Thumbprint + */ +export interface PublicCertificate extends ProxyOnlyResource { + blob?: Buffer; + publicCertificateLocation?: string; + readonly thumbprint?: string; +} + +/** + * @class + * Initializes a new instance of the RestoreRequest class. + * @constructor + * Description of a restore request. + * + * @member {string} storageAccountUrl SAS URL to the container. + * @member {string} [blobName] Name of a blob which contains the backup. + * @member {boolean} overwrite true if the restore operation can + * overwrite target app; otherwise, false. true is + * needed if trying to restore over an existing app. + * @member {string} [siteName] Name of an app. + * @member {array} [databases] Collection of databases which should be + * restored. This list has to match the list of databases included in the + * backup. + * @member {boolean} [ignoreConflictingHostNames] Changes a logic when + * restoring an app with custom domains. true to remove custom + * domains automatically. If false, custom domains are added to + * the app's object when it is being restored, but that might fail due to + * conflicts during the operation. Default value: false . + * @member {boolean} [ignoreDatabases] Ignore the databases and only restore + * the site content. Default value: false . + * @member {string} [appServicePlan] Specify app service plan that will own + * restored site. + * @member {string} [operationType] Operation type. Possible values include: + * 'Default', 'Clone', 'Relocation', 'Snapshot', 'CloudFS'. Default value: + * 'Default' . + * @member {boolean} [adjustConnectionStrings] true if + * SiteConfig.ConnectionStrings should be set in new app; otherwise, + * false. + * @member {string} [hostingEnvironment] App Service Environment name, if + * needed (only when restoring an app to an App Service Environment). + */ +export interface RestoreRequest extends ProxyOnlyResource { + storageAccountUrl: string; + blobName?: string; + overwrite: boolean; + siteName?: string; + databases?: DatabaseBackupSetting[]; + ignoreConflictingHostNames?: boolean; + ignoreDatabases?: boolean; + appServicePlan?: string; + operationType?: string; + adjustConnectionStrings?: boolean; + hostingEnvironment?: string; +} + +/** + * @class + * Initializes a new instance of the SiteAuthSettings class. + * @constructor + * Configuration settings for the Azure App Service Authentication / + * Authorization feature. + * + * @member {boolean} [enabled] true if the Authentication / + * Authorization feature is enabled for the current app; otherwise, + * false. + * @member {string} [runtimeVersion] The RuntimeVersion of the Authentication / + * Authorization feature in use for the current app. + * The setting in this value can control the behavior of certain features in + * the Authentication / Authorization module. + * @member {string} [unauthenticatedClientAction] The action to take when an + * unauthenticated client attempts to access the app. Possible values include: + * 'RedirectToLoginPage', 'AllowAnonymous' + * @member {boolean} [tokenStoreEnabled] true to durably store + * platform-specific security tokens that are obtained during login flows; + * otherwise, false. + * The default is false. + * @member {array} [allowedExternalRedirectUrls] External URLs that can be + * redirected to as part of logging in or logging out of the app. Note that the + * query string part of the URL is ignored. + * This is an advanced setting typically only needed by Windows Store + * application backends. + * Note that URLs within the current domain are always implicitly allowed. + * @member {string} [defaultProvider] The default authentication provider to + * use when multiple providers are configured. + * This setting is only needed if multiple providers are configured and the + * unauthenticated client + * action is set to "RedirectToLoginPage". Possible values include: + * 'AzureActiveDirectory', 'Facebook', 'Google', 'MicrosoftAccount', 'Twitter' + * @member {number} [tokenRefreshExtensionHours] The number of hours after + * session token expiration that a session token can be used to + * call the token refresh API. The default is 72 hours. + * @member {string} [clientId] The Client ID of this relying party application, + * known as the client_id. + * This setting is required for enabling OpenID Connection authentication with + * Azure Active Directory or + * other 3rd party OpenID Connect providers. + * More information on OpenID Connect: + * http://openid.net/specs/openid-connect-core-1_0.html + * @member {string} [clientSecret] The Client Secret of this relying party + * application (in Azure Active Directory, this is also referred to as the + * Key). + * This setting is optional. If no client secret is configured, the OpenID + * Connect implicit auth flow is used to authenticate end users. + * Otherwise, the OpenID Connect Authorization Code Flow is used to + * authenticate end users. + * More information on OpenID Connect: + * http://openid.net/specs/openid-connect-core-1_0.html + * @member {string} [issuer] The OpenID Connect Issuer URI that represents the + * entity which issues access tokens for this application. + * When using Azure Active Directory, this value is the URI of the directory + * tenant, e.g. https://sts.windows.net/{tenant-guid}/. + * This URI is a case-sensitive identifier for the token issuer. + * More information on OpenID Connect Discovery: + * http://openid.net/specs/openid-connect-discovery-1_0.html + * @member {boolean} [validateIssuer] Gets a value indicating whether the + * issuer should be a valid HTTPS url and be validated as such. + * @member {array} [allowedAudiences] Allowed audience values to consider when + * validating JWTs issued by + * Azure Active Directory. Note that the ClientID value is always + * considered an + * allowed audience, regardless of this setting. + * @member {array} [additionalLoginParams] Login parameters to send to the + * OpenID Connect authorization endpoint when + * a user logs in. Each parameter must be in the form "key=value". + * @member {string} [googleClientId] The OpenID Connect Client ID for the + * Google web application. + * This setting is required for enabling Google Sign-In. + * Google Sign-In documentation: + * https://developers.google.com/identity/sign-in/web/ + * @member {string} [googleClientSecret] The client secret associated with the + * Google web application. + * This setting is required for enabling Google Sign-In. + * Google Sign-In documentation: + * https://developers.google.com/identity/sign-in/web/ + * @member {array} [googleOAuthScopes] The OAuth 2.0 scopes that will be + * requested as part of Google Sign-In authentication. + * This setting is optional. If not specified, "openid", "profile", and "email" + * are used as default scopes. + * Google Sign-In documentation: + * https://developers.google.com/identity/sign-in/web/ + * @member {string} [facebookAppId] The App ID of the Facebook app used for + * login. + * This setting is required for enabling Facebook Login. + * Facebook Login documentation: + * https://developers.facebook.com/docs/facebook-login + * @member {string} [facebookAppSecret] The App Secret of the Facebook app used + * for Facebook Login. + * This setting is required for enabling Facebook Login. + * Facebook Login documentation: + * https://developers.facebook.com/docs/facebook-login + * @member {array} [facebookOAuthScopes] The OAuth 2.0 scopes that will be + * requested as part of Facebook Login authentication. + * This setting is optional. + * Facebook Login documentation: + * https://developers.facebook.com/docs/facebook-login + * @member {string} [twitterConsumerKey] The OAuth 1.0a consumer key of the + * Twitter application used for sign-in. + * This setting is required for enabling Twitter Sign-In. + * Twitter Sign-In documentation: https://dev.twitter.com/web/sign-in + * @member {string} [twitterConsumerSecret] The OAuth 1.0a consumer secret of + * the Twitter application used for sign-in. + * This setting is required for enabling Twitter Sign-In. + * Twitter Sign-In documentation: https://dev.twitter.com/web/sign-in + * @member {string} [microsoftAccountClientId] The OAuth 2.0 client ID that was + * created for the app used for authentication. + * This setting is required for enabling Microsoft Account authentication. + * Microsoft Account OAuth documentation: + * https://dev.onedrive.com/auth/msa_oauth.htm + * @member {string} [microsoftAccountClientSecret] The OAuth 2.0 client secret + * that was created for the app used for authentication. + * This setting is required for enabling Microsoft Account authentication. + * Microsoft Account OAuth documentation: + * https://dev.onedrive.com/auth/msa_oauth.htm + * @member {array} [microsoftAccountOAuthScopes] The OAuth 2.0 scopes that will + * be requested as part of Microsoft Account authentication. + * This setting is optional. If not specified, "wl.basic" is used as the + * default scope. + * Microsoft Account Scopes and permissions documentation: + * https://msdn.microsoft.com/en-us/library/dn631845.aspx + */ +export interface SiteAuthSettings extends ProxyOnlyResource { + enabled?: boolean; + runtimeVersion?: string; + unauthenticatedClientAction?: string; + tokenStoreEnabled?: boolean; + allowedExternalRedirectUrls?: string[]; + defaultProvider?: string; + tokenRefreshExtensionHours?: number; + clientId?: string; + clientSecret?: string; + issuer?: string; + validateIssuer?: boolean; + allowedAudiences?: string[]; + additionalLoginParams?: string[]; + googleClientId?: string; + googleClientSecret?: string; + googleOAuthScopes?: string[]; + facebookAppId?: string; + facebookAppSecret?: string; + facebookOAuthScopes?: string[]; + twitterConsumerKey?: string; + twitterConsumerSecret?: string; + microsoftAccountClientId?: string; + microsoftAccountClientSecret?: string; + microsoftAccountOAuthScopes?: string[]; +} + +/** + * @class + * Initializes a new instance of the SiteCloneabilityCriterion class. + * @constructor + * An app cloneability criterion. + * + * @member {string} [name] Name of criterion. + * @member {string} [description] Description of criterion. + */ +export interface SiteCloneabilityCriterion { + name?: string; + description?: string; +} + +/** + * @class + * Initializes a new instance of the SiteCloneability class. + * @constructor + * Represents whether or not an app is cloneable. + * + * @member {string} [result] Name of app. Possible values include: 'Cloneable', + * 'PartiallyCloneable', 'NotCloneable' + * @member {array} [blockingFeatures] List of features enabled on app that + * prevent cloning. + * @member {array} [unsupportedFeatures] List of features enabled on app that + * are non-blocking but cannot be cloned. The app can still be cloned + * but the features in this list will not be set up on cloned app. + * @member {array} [blockingCharacteristics] List of blocking application + * characteristics. + */ +export interface SiteCloneability { + result?: string; + blockingFeatures?: SiteCloneabilityCriterion[]; + unsupportedFeatures?: SiteCloneabilityCriterion[]; + blockingCharacteristics?: SiteCloneabilityCriterion[]; +} + +/** + * @class + * Initializes a new instance of the SiteConfigResource class. + * @constructor + * Web app configuration ARM resource. + * + * @member {number} [numberOfWorkers] Number of workers. + * @member {array} [defaultDocuments] Default documents. + * @member {string} [netFrameworkVersion] .NET Framework version. Default + * value: 'v4.6' . + * @member {string} [phpVersion] Version of PHP. + * @member {string} [pythonVersion] Version of Python. + * @member {string} [nodeVersion] Version of Node.js. + * @member {string} [linuxFxVersion] Linux App Framework and version + * @member {string} [windowsFxVersion] Xenon App Framework and version + * @member {boolean} [requestTracingEnabled] true if request + * tracing is enabled; otherwise, false. + * @member {date} [requestTracingExpirationTime] Request tracing expiration + * time. + * @member {boolean} [remoteDebuggingEnabled] true if remote + * debugging is enabled; otherwise, false. + * @member {string} [remoteDebuggingVersion] Remote debugging version. + * @member {boolean} [httpLoggingEnabled] true if HTTP logging is + * enabled; otherwise, false. + * @member {number} [logsDirectorySizeLimit] HTTP logs directory size limit. + * @member {boolean} [detailedErrorLoggingEnabled] true if + * detailed error logging is enabled; otherwise, false. + * @member {string} [publishingUsername] Publishing user name. + * @member {array} [appSettings] Application settings. + * @member {object} [azureStorageAccounts] User-provided Azure storage + * accounts. + * @member {array} [connectionStrings] Connection strings. + * @member {object} [machineKey] Site MachineKey. + * @member {string} [machineKey.validation] MachineKey validation. + * @member {string} [machineKey.validationKey] Validation key. + * @member {string} [machineKey.decryption] Algorithm used for decryption. + * @member {string} [machineKey.decryptionKey] Decryption key. + * @member {array} [handlerMappings] Handler mappings. + * @member {string} [documentRoot] Document root. + * @member {string} [scmType] SCM type. Possible values include: 'None', + * 'Dropbox', 'Tfs', 'LocalGit', 'GitHub', 'CodePlexGit', 'CodePlexHg', + * 'BitbucketGit', 'BitbucketHg', 'ExternalGit', 'ExternalHg', 'OneDrive', + * 'VSO' + * @member {boolean} [use32BitWorkerProcess] true to use 32-bit + * worker process; otherwise, false. + * @member {boolean} [webSocketsEnabled] true if WebSocket is + * enabled; otherwise, false. + * @member {boolean} [alwaysOn] true if Always On is enabled; + * otherwise, false. + * @member {string} [javaVersion] Java version. + * @member {string} [javaContainer] Java container. + * @member {string} [javaContainerVersion] Java container version. + * @member {string} [appCommandLine] App command line to launch. + * @member {string} [managedPipelineMode] Managed pipeline mode. Possible + * values include: 'Integrated', 'Classic' + * @member {array} [virtualApplications] Virtual applications. + * @member {string} [loadBalancing] Site load balancing. Possible values + * include: 'WeightedRoundRobin', 'LeastRequests', 'LeastResponseTime', + * 'WeightedTotalTraffic', 'RequestHash' + * @member {object} [experiments] This is work around for polymophic types. + * @member {array} [experiments.rampUpRules] List of ramp-up rules. + * @member {object} [limits] Site limits. + * @member {number} [limits.maxPercentageCpu] Maximum allowed CPU usage + * percentage. + * @member {number} [limits.maxMemoryInMb] Maximum allowed memory usage in MB. + * @member {number} [limits.maxDiskSizeInMb] Maximum allowed disk size usage in + * MB. + * @member {boolean} [autoHealEnabled] true if Auto Heal is + * enabled; otherwise, false. + * @member {object} [autoHealRules] Auto Heal rules. + * @member {object} [autoHealRules.triggers] Conditions that describe when to + * execute the auto-heal actions. + * @member {object} [autoHealRules.triggers.requests] A rule based on total + * requests. + * @member {number} [autoHealRules.triggers.requests.count] Request Count. + * @member {string} [autoHealRules.triggers.requests.timeInterval] Time + * interval. + * @member {number} [autoHealRules.triggers.privateBytesInKB] A rule based on + * private bytes. + * @member {array} [autoHealRules.triggers.statusCodes] A rule based on status + * codes. + * @member {object} [autoHealRules.triggers.slowRequests] A rule based on + * request execution time. + * @member {string} [autoHealRules.triggers.slowRequests.timeTaken] Time taken. + * @member {number} [autoHealRules.triggers.slowRequests.count] Request Count. + * @member {string} [autoHealRules.triggers.slowRequests.timeInterval] Time + * interval. + * @member {object} [autoHealRules.actions] Actions to be executed when a rule + * is triggered. + * @member {string} [autoHealRules.actions.actionType] Predefined action to be + * taken. Possible values include: 'Recycle', 'LogEvent', 'CustomAction' + * @member {object} [autoHealRules.actions.customAction] Custom action to be + * taken. + * @member {string} [autoHealRules.actions.customAction.exe] Executable to be + * run. + * @member {string} [autoHealRules.actions.customAction.parameters] Parameters + * for the executable. + * @member {string} [autoHealRules.actions.minProcessExecutionTime] Minimum + * time the process must execute + * before taking the action + * @member {string} [tracingOptions] Tracing options. + * @member {string} [vnetName] Virtual Network name. + * @member {object} [cors] Cross-Origin Resource Sharing (CORS) settings. + * @member {array} [cors.allowedOrigins] Gets or sets the list of origins that + * should be allowed to make cross-origin + * calls (for example: http://example.com:12345). Use "*" to allow all. + * @member {object} [push] Push endpoint settings. + * @member {boolean} [push.isPushEnabled] Gets or sets a flag indicating + * whether the Push endpoint is enabled. + * @member {string} [push.tagWhitelistJson] Gets or sets a JSON string + * containing a list of tags that are whitelisted for use by the push + * registration endpoint. + * @member {string} [push.tagsRequiringAuth] Gets or sets a JSON string + * containing a list of tags that require user authentication to be used in the + * push registration endpoint. + * Tags can consist of alphanumeric characters and the following: + * '_', '@', '#', '.', ':', '-'. + * Validation should be performed at the PushRequestHandler. + * @member {string} [push.dynamicTagsJson] Gets or sets a JSON string + * containing a list of dynamic tags that will be evaluated from user claims in + * the push registration endpoint. + * @member {object} [apiDefinition] Information about the formal API definition + * for the app. + * @member {string} [apiDefinition.url] The URL of the API definition. + * @member {string} [autoSwapSlotName] Auto-swap slot name. + * @member {boolean} [localMySqlEnabled] true to enable local + * MySQL; otherwise, false. Default value: false . + * @member {number} [managedServiceIdentityId] Managed Service Identity Id + * @member {number} [xManagedServiceIdentityId] Explicit Managed Service + * Identity Id + * @member {array} [ipSecurityRestrictions] IP security restrictions. + * @member {boolean} [http20Enabled] Http20Enabled: configures a web site to + * allow clients to connect over http2.0. Default value: true . + * @member {string} [minTlsVersion] MinTlsVersion: configures the minimum + * version of TLS required for SSL requests. Possible values include: '1.0', + * '1.1', '1.2' + * @member {string} [ftpsState] State of FTP / FTPS service. Possible values + * include: 'AllAllowed', 'FtpsOnly', 'Disabled' + * @member {number} [reservedInstanceCount] Number of reserved instances. + * This setting only applies to the Consumption Plan + */ +export interface SiteConfigResource extends ProxyOnlyResource { + numberOfWorkers?: number; + defaultDocuments?: string[]; + netFrameworkVersion?: string; + phpVersion?: string; + pythonVersion?: string; + nodeVersion?: string; + linuxFxVersion?: string; + windowsFxVersion?: string; + requestTracingEnabled?: boolean; + requestTracingExpirationTime?: Date; + remoteDebuggingEnabled?: boolean; + remoteDebuggingVersion?: string; + httpLoggingEnabled?: boolean; + logsDirectorySizeLimit?: number; + detailedErrorLoggingEnabled?: boolean; + publishingUsername?: string; + appSettings?: NameValuePair[]; + azureStorageAccounts?: { [propertyName: string]: AzureStorageInfoValue }; + connectionStrings?: ConnStringInfo[]; + readonly machineKey?: SiteMachineKey; + handlerMappings?: HandlerMapping[]; + documentRoot?: string; + scmType?: string; + use32BitWorkerProcess?: boolean; + webSocketsEnabled?: boolean; + alwaysOn?: boolean; + javaVersion?: string; + javaContainer?: string; + javaContainerVersion?: string; + appCommandLine?: string; + managedPipelineMode?: string; + virtualApplications?: VirtualApplication[]; + loadBalancing?: string; + experiments?: Experiments; + limits?: SiteLimits; + autoHealEnabled?: boolean; + autoHealRules?: AutoHealRules; + tracingOptions?: string; + vnetName?: string; + cors?: CorsSettings; + push?: PushSettings; + apiDefinition?: ApiDefinitionInfo; + autoSwapSlotName?: string; + localMySqlEnabled?: boolean; + managedServiceIdentityId?: number; + xManagedServiceIdentityId?: number; + ipSecurityRestrictions?: IpSecurityRestriction[]; + http20Enabled?: boolean; + minTlsVersion?: string; + ftpsState?: string; + reservedInstanceCount?: number; +} + +/** + * @class + * Initializes a new instance of the SiteConfigurationSnapshotInfo class. + * @constructor + * A snapshot of a web app configuration. + * + * @member {date} [time] The time the snapshot was taken. + * @member {number} [snapshotId] The id of the snapshot + */ +export interface SiteConfigurationSnapshotInfo extends ProxyOnlyResource { + readonly time?: Date; + readonly snapshotId?: number; +} + +/** + * @class + * Initializes a new instance of the SiteExtensionInfo class. + * @constructor + * Site Extension Information. + * + * @member {string} [extensionId] Site extension ID. + * @member {string} [title] + * @member {string} [extensionType] Site extension type. Possible values + * include: 'Gallery', 'WebRoot' + * @member {string} [summary] Summary description. + * @member {string} [description] Detailed description. + * @member {string} [version] Version information. + * @member {string} [extensionUrl] Extension URL. + * @member {string} [projectUrl] Project URL. + * @member {string} [iconUrl] Icon URL. + * @member {string} [licenseUrl] License URL. + * @member {string} [feedUrl] Feed URL. + * @member {array} [authors] List of authors. + * @member {string} [installerCommandLineParams] Installer command line + * parameters. + * @member {date} [publishedDateTime] Published timestamp. + * @member {number} [downloadCount] Count of downloads. + * @member {boolean} [localIsLatestVersion] true if the local + * version is the latest version; false otherwise. + * @member {string} [localPath] Local path. + * @member {date} [installedDateTime] Installed timestamp. + * @member {string} [provisioningState] Provisioning state. + * @member {string} [comment] Site Extension comment. + */ +export interface SiteExtensionInfo extends ProxyOnlyResource { + extensionId?: string; + title?: string; + extensionType?: string; + summary?: string; + description?: string; + version?: string; + extensionUrl?: string; + projectUrl?: string; + iconUrl?: string; + licenseUrl?: string; + feedUrl?: string; + authors?: string[]; + installerCommandLineParams?: string; + publishedDateTime?: Date; + downloadCount?: number; + localIsLatestVersion?: boolean; + localPath?: string; + installedDateTime?: Date; + provisioningState?: string; + comment?: string; +} + +/** + * @class + * Initializes a new instance of the SiteInstance class. + * @constructor + * Instance of an app. + * + * @member {string} [siteInstanceName] Name of instance. + */ +export interface SiteInstance extends ProxyOnlyResource { + readonly siteInstanceName?: string; +} + +/** + * @class + * Initializes a new instance of the SiteLogsConfig class. + * @constructor + * Configuration of App Service site logs. + * + * @member {object} [applicationLogs] Application logs configuration. + * @member {object} [applicationLogs.fileSystem] Application logs to file + * system configuration. + * @member {string} [applicationLogs.fileSystem.level] Log level. Possible + * values include: 'Off', 'Verbose', 'Information', 'Warning', 'Error' + * @member {object} [applicationLogs.azureTableStorage] Application logs to + * azure table storage configuration. + * @member {string} [applicationLogs.azureTableStorage.level] Log level. + * Possible values include: 'Off', 'Verbose', 'Information', 'Warning', 'Error' + * @member {string} [applicationLogs.azureTableStorage.sasUrl] SAS URL to an + * Azure table with add/query/delete permissions. + * @member {object} [applicationLogs.azureBlobStorage] Application logs to blob + * storage configuration. + * @member {string} [applicationLogs.azureBlobStorage.level] Log level. + * Possible values include: 'Off', 'Verbose', 'Information', 'Warning', 'Error' + * @member {string} [applicationLogs.azureBlobStorage.sasUrl] SAS url to a + * azure blob container with read/write/list/delete permissions. + * @member {number} [applicationLogs.azureBlobStorage.retentionInDays] + * Retention in days. + * Remove blobs older than X days. + * 0 or lower means no retention. + * @member {object} [httpLogs] HTTP logs configuration. + * @member {object} [httpLogs.fileSystem] Http logs to file system + * configuration. + * @member {number} [httpLogs.fileSystem.retentionInMb] Maximum size in + * megabytes that http log files can use. + * When reached old log files will be removed to make space for new ones. + * Value can range between 25 and 100. + * @member {number} [httpLogs.fileSystem.retentionInDays] Retention in days. + * Remove files older than X days. + * 0 or lower means no retention. + * @member {boolean} [httpLogs.fileSystem.enabled] True if configuration is + * enabled, false if it is disabled and null if configuration is not set. + * @member {object} [httpLogs.azureBlobStorage] Http logs to azure blob storage + * configuration. + * @member {string} [httpLogs.azureBlobStorage.sasUrl] SAS url to a azure blob + * container with read/write/list/delete permissions. + * @member {number} [httpLogs.azureBlobStorage.retentionInDays] Retention in + * days. + * Remove blobs older than X days. + * 0 or lower means no retention. + * @member {boolean} [httpLogs.azureBlobStorage.enabled] True if configuration + * is enabled, false if it is disabled and null if configuration is not set. + * @member {object} [failedRequestsTracing] Failed requests tracing + * configuration. + * @member {boolean} [failedRequestsTracing.enabled] True if configuration is + * enabled, false if it is disabled and null if configuration is not set. + * @member {object} [detailedErrorMessages] Detailed error messages + * configuration. + * @member {boolean} [detailedErrorMessages.enabled] True if configuration is + * enabled, false if it is disabled and null if configuration is not set. + */ +export interface SiteLogsConfig extends ProxyOnlyResource { + applicationLogs?: ApplicationLogsConfig; + httpLogs?: HttpLogsConfig; + failedRequestsTracing?: EnabledConfig; + detailedErrorMessages?: EnabledConfig; +} + +/** + * @class + * Initializes a new instance of the SitePatchResource class. + * @constructor + * ARM resource for a site. + * + * @member {string} [state] Current state of the app. + * @member {array} [hostNames] Hostnames associated with the app. + * @member {string} [repositorySiteName] Name of the repository site. + * @member {string} [usageState] State indicating whether the app has exceeded + * its quota usage. Read-only. Possible values include: 'Normal', 'Exceeded' + * @member {boolean} [enabled] true if the app is enabled; + * otherwise, false. Setting this value to false disables the app + * (takes the app offline). + * @member {array} [enabledHostNames] Enabled hostnames for the app.Hostnames + * need to be assigned (see HostNames) AND enabled. Otherwise, + * the app is not served on those hostnames. + * @member {string} [availabilityState] Management information availability + * state for the app. Possible values include: 'Normal', 'Limited', + * 'DisasterRecoveryMode' + * @member {array} [hostNameSslStates] Hostname SSL states are used to manage + * the SSL bindings for app's hostnames. + * @member {string} [serverFarmId] Resource ID of the associated App Service + * plan, formatted as: + * "/subscriptions/{subscriptionID}/resourceGroups/{groupName}/providers/Microsoft.Web/serverfarms/{appServicePlanName}". + * @member {boolean} [reserved] true if reserved; otherwise, + * false. Default value: false . + * @member {boolean} [isXenon] Obsolete: Hyper-V sandbox. Default value: false + * . + * @member {boolean} [hyperV] Hyper-V sandbox. Default value: false . + * @member {date} [lastModifiedTimeUtc] Last time the app was modified, in UTC. + * Read-only. + * @member {object} [siteConfig] Configuration of the app. + * @member {number} [siteConfig.numberOfWorkers] Number of workers. + * @member {array} [siteConfig.defaultDocuments] Default documents. + * @member {string} [siteConfig.netFrameworkVersion] .NET Framework version. + * @member {string} [siteConfig.phpVersion] Version of PHP. + * @member {string} [siteConfig.pythonVersion] Version of Python. + * @member {string} [siteConfig.nodeVersion] Version of Node.js. + * @member {string} [siteConfig.linuxFxVersion] Linux App Framework and version + * @member {string} [siteConfig.windowsFxVersion] Xenon App Framework and + * version + * @member {boolean} [siteConfig.requestTracingEnabled] true if + * request tracing is enabled; otherwise, false. + * @member {date} [siteConfig.requestTracingExpirationTime] Request tracing + * expiration time. + * @member {boolean} [siteConfig.remoteDebuggingEnabled] true if + * remote debugging is enabled; otherwise, false. + * @member {string} [siteConfig.remoteDebuggingVersion] Remote debugging + * version. + * @member {boolean} [siteConfig.httpLoggingEnabled] true if HTTP + * logging is enabled; otherwise, false. + * @member {number} [siteConfig.logsDirectorySizeLimit] HTTP logs directory + * size limit. + * @member {boolean} [siteConfig.detailedErrorLoggingEnabled] true + * if detailed error logging is enabled; otherwise, false. + * @member {string} [siteConfig.publishingUsername] Publishing user name. + * @member {array} [siteConfig.appSettings] Application settings. + * @member {object} [siteConfig.azureStorageAccounts] User-provided Azure + * storage accounts. + * @member {array} [siteConfig.connectionStrings] Connection strings. + * @member {object} [siteConfig.machineKey] Site MachineKey. + * @member {string} [siteConfig.machineKey.validation] MachineKey validation. + * @member {string} [siteConfig.machineKey.validationKey] Validation key. + * @member {string} [siteConfig.machineKey.decryption] Algorithm used for + * decryption. + * @member {string} [siteConfig.machineKey.decryptionKey] Decryption key. + * @member {array} [siteConfig.handlerMappings] Handler mappings. + * @member {string} [siteConfig.documentRoot] Document root. + * @member {string} [siteConfig.scmType] SCM type. Possible values include: + * 'None', 'Dropbox', 'Tfs', 'LocalGit', 'GitHub', 'CodePlexGit', 'CodePlexHg', + * 'BitbucketGit', 'BitbucketHg', 'ExternalGit', 'ExternalHg', 'OneDrive', + * 'VSO' + * @member {boolean} [siteConfig.use32BitWorkerProcess] true to + * use 32-bit worker process; otherwise, false. + * @member {boolean} [siteConfig.webSocketsEnabled] true if + * WebSocket is enabled; otherwise, false. + * @member {boolean} [siteConfig.alwaysOn] true if Always On is + * enabled; otherwise, false. + * @member {string} [siteConfig.javaVersion] Java version. + * @member {string} [siteConfig.javaContainer] Java container. + * @member {string} [siteConfig.javaContainerVersion] Java container version. + * @member {string} [siteConfig.appCommandLine] App command line to launch. + * @member {string} [siteConfig.managedPipelineMode] Managed pipeline mode. + * Possible values include: 'Integrated', 'Classic' + * @member {array} [siteConfig.virtualApplications] Virtual applications. + * @member {string} [siteConfig.loadBalancing] Site load balancing. Possible + * values include: 'WeightedRoundRobin', 'LeastRequests', 'LeastResponseTime', + * 'WeightedTotalTraffic', 'RequestHash' + * @member {object} [siteConfig.experiments] This is work around for polymophic + * types. + * @member {array} [siteConfig.experiments.rampUpRules] List of ramp-up rules. + * @member {object} [siteConfig.limits] Site limits. + * @member {number} [siteConfig.limits.maxPercentageCpu] Maximum allowed CPU + * usage percentage. + * @member {number} [siteConfig.limits.maxMemoryInMb] Maximum allowed memory + * usage in MB. + * @member {number} [siteConfig.limits.maxDiskSizeInMb] Maximum allowed disk + * size usage in MB. + * @member {boolean} [siteConfig.autoHealEnabled] true if Auto + * Heal is enabled; otherwise, false. + * @member {object} [siteConfig.autoHealRules] Auto Heal rules. + * @member {object} [siteConfig.autoHealRules.triggers] Conditions that + * describe when to execute the auto-heal actions. + * @member {object} [siteConfig.autoHealRules.triggers.requests] A rule based + * on total requests. + * @member {number} [siteConfig.autoHealRules.triggers.requests.count] Request + * Count. + * @member {string} [siteConfig.autoHealRules.triggers.requests.timeInterval] + * Time interval. + * @member {number} [siteConfig.autoHealRules.triggers.privateBytesInKB] A rule + * based on private bytes. + * @member {array} [siteConfig.autoHealRules.triggers.statusCodes] A rule based + * on status codes. + * @member {object} [siteConfig.autoHealRules.triggers.slowRequests] A rule + * based on request execution time. + * @member {string} [siteConfig.autoHealRules.triggers.slowRequests.timeTaken] + * Time taken. + * @member {number} [siteConfig.autoHealRules.triggers.slowRequests.count] + * Request Count. + * @member {string} + * [siteConfig.autoHealRules.triggers.slowRequests.timeInterval] Time interval. + * @member {object} [siteConfig.autoHealRules.actions] Actions to be executed + * when a rule is triggered. + * @member {string} [siteConfig.autoHealRules.actions.actionType] Predefined + * action to be taken. Possible values include: 'Recycle', 'LogEvent', + * 'CustomAction' + * @member {object} [siteConfig.autoHealRules.actions.customAction] Custom + * action to be taken. + * @member {string} [siteConfig.autoHealRules.actions.customAction.exe] + * Executable to be run. + * @member {string} [siteConfig.autoHealRules.actions.customAction.parameters] + * Parameters for the executable. + * @member {string} [siteConfig.autoHealRules.actions.minProcessExecutionTime] + * Minimum time the process must execute + * before taking the action + * @member {string} [siteConfig.tracingOptions] Tracing options. + * @member {string} [siteConfig.vnetName] Virtual Network name. + * @member {object} [siteConfig.cors] Cross-Origin Resource Sharing (CORS) + * settings. + * @member {array} [siteConfig.cors.allowedOrigins] Gets or sets the list of + * origins that should be allowed to make cross-origin + * calls (for example: http://example.com:12345). Use "*" to allow all. + * @member {object} [siteConfig.push] Push endpoint settings. + * @member {boolean} [siteConfig.push.isPushEnabled] Gets or sets a flag + * indicating whether the Push endpoint is enabled. + * @member {string} [siteConfig.push.tagWhitelistJson] Gets or sets a JSON + * string containing a list of tags that are whitelisted for use by the push + * registration endpoint. + * @member {string} [siteConfig.push.tagsRequiringAuth] Gets or sets a JSON + * string containing a list of tags that require user authentication to be used + * in the push registration endpoint. + * Tags can consist of alphanumeric characters and the following: + * '_', '@', '#', '.', ':', '-'. + * Validation should be performed at the PushRequestHandler. + * @member {string} [siteConfig.push.dynamicTagsJson] Gets or sets a JSON + * string containing a list of dynamic tags that will be evaluated from user + * claims in the push registration endpoint. + * @member {object} [siteConfig.apiDefinition] Information about the formal API + * definition for the app. + * @member {string} [siteConfig.apiDefinition.url] The URL of the API + * definition. + * @member {string} [siteConfig.autoSwapSlotName] Auto-swap slot name. + * @member {boolean} [siteConfig.localMySqlEnabled] true to enable + * local MySQL; otherwise, false. + * @member {number} [siteConfig.managedServiceIdentityId] Managed Service + * Identity Id + * @member {number} [siteConfig.xManagedServiceIdentityId] Explicit Managed + * Service Identity Id + * @member {array} [siteConfig.ipSecurityRestrictions] IP security + * restrictions. + * @member {boolean} [siteConfig.http20Enabled] Http20Enabled: configures a web + * site to allow clients to connect over http2.0 + * @member {string} [siteConfig.minTlsVersion] MinTlsVersion: configures the + * minimum version of TLS required for SSL requests. Possible values include: + * '1.0', '1.1', '1.2' + * @member {string} [siteConfig.ftpsState] State of FTP / FTPS service. + * Possible values include: 'AllAllowed', 'FtpsOnly', 'Disabled' + * @member {number} [siteConfig.reservedInstanceCount] Number of reserved + * instances. + * This setting only applies to the Consumption Plan + * @member {array} [trafficManagerHostNames] Azure Traffic Manager hostnames + * associated with the app. Read-only. + * @member {boolean} [scmSiteAlsoStopped] true to stop SCM (KUDU) + * site when the app is stopped; otherwise, false. The default is + * false. Default value: false . + * @member {string} [targetSwapSlot] Specifies which deployment slot this app + * will swap into. Read-only. + * @member {object} [hostingEnvironmentProfile] App Service Environment to use + * for the app. + * @member {string} [hostingEnvironmentProfile.id] Resource ID of the App + * Service Environment. + * @member {string} [hostingEnvironmentProfile.name] Name of the App Service + * Environment. + * @member {string} [hostingEnvironmentProfile.type] Resource type of the App + * Service Environment. + * @member {boolean} [clientAffinityEnabled] true to enable client + * affinity; false to stop sending session affinity cookies, which + * route client requests in the same session to the same instance. Default is + * true. + * @member {boolean} [clientCertEnabled] true to enable client + * certificate authentication (TLS mutual authentication); otherwise, + * false. Default is false. + * @member {boolean} [hostNamesDisabled] true to disable the + * public hostnames of the app; otherwise, false. + * If true, the app is only accessible via API management process. + * @member {string} [outboundIpAddresses] List of IP addresses that the app + * uses for outbound connections (e.g. database access). Includes VIPs from + * tenants that site can be hosted with current settings. Read-only. + * @member {string} [possibleOutboundIpAddresses] List of IP addresses that the + * app uses for outbound connections (e.g. database access). Includes VIPs from + * all tenants. Read-only. + * @member {number} [containerSize] Size of the function container. + * @member {number} [dailyMemoryTimeQuota] Maximum allowed daily memory-time + * quota (applicable on dynamic apps only). + * @member {date} [suspendedTill] App suspended till in case memory-time quota + * is exceeded. + * @member {number} [maxNumberOfWorkers] Maximum number of workers. + * This only applies to Functions container. + * @member {object} [cloningInfo] If specified during app creation, the app is + * cloned from a source app. + * @member {uuid} [cloningInfo.correlationId] Correlation ID of cloning + * operation. This ID ties multiple cloning operations + * together to use the same snapshot. + * @member {boolean} [cloningInfo.overwrite] true to overwrite + * destination app; otherwise, false. + * @member {boolean} [cloningInfo.cloneCustomHostNames] true to + * clone custom hostnames from source app; otherwise, false. + * @member {boolean} [cloningInfo.cloneSourceControl] true to + * clone source control from source app; otherwise, false. + * @member {string} [cloningInfo.sourceWebAppId] ARM resource ID of the source + * app. App resource ID is of the form + * /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName} + * for production slots and + * /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/slots/{slotName} + * for other slots. + * @member {string} [cloningInfo.hostingEnvironment] App Service Environment. + * @member {object} [cloningInfo.appSettingsOverrides] Application setting + * overrides for cloned app. If specified, these settings override the settings + * cloned + * from source app. Otherwise, application settings from source app are + * retained. + * @member {boolean} [cloningInfo.configureLoadBalancing] true to + * configure load balancing for source and destination app. + * @member {string} [cloningInfo.trafficManagerProfileId] ARM resource ID of + * the Traffic Manager profile to use, if it exists. Traffic Manager resource + * ID is of the form + * /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/trafficManagerProfiles/{profileName}. + * @member {string} [cloningInfo.trafficManagerProfileName] Name of Traffic + * Manager profile to create. This is only needed if Traffic Manager profile + * does not already exist. + * @member {string} [resourceGroup] Name of the resource group the app belongs + * to. Read-only. + * @member {boolean} [isDefaultContainer] true if the app is a + * default container; otherwise, false. + * @member {string} [defaultHostName] Default hostname of the app. Read-only. + * @member {object} [slotSwapStatus] Status of the last deployment slot swap + * operation. + * @member {date} [slotSwapStatus.timestampUtc] The time the last successful + * slot swap completed. + * @member {string} [slotSwapStatus.sourceSlotName] The source slot of the last + * swap operation. + * @member {string} [slotSwapStatus.destinationSlotName] The destination slot + * of the last swap operation. + * @member {boolean} [httpsOnly] HttpsOnly: configures a web site to accept + * only https requests. Issues redirect for + * http requests + */ +export interface SitePatchResource extends ProxyOnlyResource { + readonly state?: string; + readonly hostNames?: string[]; + readonly repositorySiteName?: string; + readonly usageState?: string; + enabled?: boolean; + readonly enabledHostNames?: string[]; + readonly availabilityState?: string; + hostNameSslStates?: HostNameSslState[]; + serverFarmId?: string; + reserved?: boolean; + isXenon?: boolean; + hyperV?: boolean; + readonly lastModifiedTimeUtc?: Date; + siteConfig?: SiteConfig; + readonly trafficManagerHostNames?: string[]; + scmSiteAlsoStopped?: boolean; + readonly targetSwapSlot?: string; + hostingEnvironmentProfile?: HostingEnvironmentProfile; + clientAffinityEnabled?: boolean; + clientCertEnabled?: boolean; + hostNamesDisabled?: boolean; + readonly outboundIpAddresses?: string; + readonly possibleOutboundIpAddresses?: string; + containerSize?: number; + dailyMemoryTimeQuota?: number; + readonly suspendedTill?: Date; + readonly maxNumberOfWorkers?: number; + cloningInfo?: CloningInfo; + readonly resourceGroup?: string; + readonly isDefaultContainer?: boolean; + readonly defaultHostName?: string; + readonly slotSwapStatus?: SlotSwapStatus; + httpsOnly?: boolean; +} + +/** + * @class + * Initializes a new instance of the SitePhpErrorLogFlag class. + * @constructor + * Used for getting PHP error logging flag. + * + * @member {string} [localLogErrors] Local log_errors setting. + * @member {string} [masterLogErrors] Master log_errors setting. + * @member {string} [localLogErrorsMaxLength] Local log_errors_max_len setting. + * @member {string} [masterLogErrorsMaxLength] Master log_errors_max_len + * setting. + */ +export interface SitePhpErrorLogFlag extends ProxyOnlyResource { + localLogErrors?: string; + masterLogErrors?: string; + localLogErrorsMaxLength?: string; + masterLogErrorsMaxLength?: string; +} + +/** + * @class + * Initializes a new instance of the SiteSourceControl class. + * @constructor + * Source control configuration for an app. + * + * @member {string} [repoUrl] Repository or source control URL. + * @member {string} [branch] Name of branch to use for deployment. + * @member {boolean} [isManualIntegration] true to limit to manual + * integration; false to enable continuous integration (which + * configures webhooks into online repos like GitHub). + * @member {boolean} [deploymentRollbackEnabled] true to enable + * deployment rollback; otherwise, false. + * @member {boolean} [isMercurial] true for a Mercurial + * repository; false for a Git repository. + */ +export interface SiteSourceControl extends ProxyOnlyResource { + repoUrl?: string; + branch?: string; + isManualIntegration?: boolean; + deploymentRollbackEnabled?: boolean; + isMercurial?: boolean; +} + +/** + * @class + * Initializes a new instance of the SlotConfigNamesResource class. + * @constructor + * Slot Config names azure resource. + * + * @member {array} [connectionStringNames] List of connection string names. + * @member {array} [appSettingNames] List of application settings names. + * @member {array} [azureStorageConfigNames] List of external Azure storage + * account identifiers. + */ +export interface SlotConfigNamesResource extends ProxyOnlyResource { + connectionStringNames?: string[]; + appSettingNames?: string[]; + azureStorageConfigNames?: string[]; +} + +/** + * @class + * Initializes a new instance of the SlotDifference class. + * @constructor + * A setting difference between two deployment slots of an app. + * + * @member {string} [level] Level of the difference: Information, Warning or + * Error. + * @member {string} [settingType] The type of the setting: General, AppSetting + * or ConnectionString. + * @member {string} [diffRule] Rule that describes how to process the setting + * difference during a slot swap. + * @member {string} [settingName] Name of the setting. + * @member {string} [valueInCurrentSlot] Value of the setting in the current + * slot. + * @member {string} [valueInTargetSlot] Value of the setting in the target + * slot. + * @member {string} [description] Description of the setting difference. + */ +export interface SlotDifference extends ProxyOnlyResource { + readonly level?: string; + readonly settingType?: string; + readonly diffRule?: string; + readonly settingName?: string; + readonly valueInCurrentSlot?: string; + readonly valueInTargetSlot?: string; + readonly description?: string; +} + +/** + * @class + * Initializes a new instance of the SnapshotRecoverySource class. + * @constructor + * Specifies the web app that snapshot contents will be retrieved from. + * + * @member {string} [location] Geographical location of the source web app, + * e.g. SouthEastAsia, SouthCentralUS + * @member {string} [id] ARM resource ID of the source app. + * /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName} + * for production slots and + * /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/slots/{slotName} + * for other slots. + */ +export interface SnapshotRecoverySource { + location?: string; + id?: string; +} + +/** + * @class + * Initializes a new instance of the SnapshotRestoreRequest class. + * @constructor + * Details about app recovery operation. + * + * @member {string} [snapshotTime] Point in time in which the app restore + * should be done, formatted as a DateTime string. + * @member {object} [recoverySource] Optional. Specifies the web app that + * snapshot contents will be retrieved from. + * If empty, the targeted web app will be used as the source. + * @member {string} [recoverySource.location] Geographical location of the + * source web app, e.g. SouthEastAsia, SouthCentralUS + * @member {string} [recoverySource.id] ARM resource ID of the source app. + * /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName} + * for production slots and + * /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/slots/{slotName} + * for other slots. + * @member {boolean} overwrite If true the restore operation can + * overwrite source app; otherwise, false. + * @member {boolean} [recoverConfiguration] If true, site configuration, in + * addition to content, will be reverted. + * @member {boolean} [ignoreConflictingHostNames] If true, custom hostname + * conflicts will be ignored when recovering to a target web app. + * This setting is only necessary when RecoverConfiguration is enabled. + */ +export interface SnapshotRestoreRequest extends ProxyOnlyResource { + snapshotTime?: string; + recoverySource?: SnapshotRecoverySource; + overwrite: boolean; + recoverConfiguration?: boolean; + ignoreConflictingHostNames?: boolean; +} + +/** + * @class + * Initializes a new instance of the StorageMigrationOptions class. + * @constructor + * Options for app content migration. + * + * @member {string} azurefilesConnectionString AzureFiles connection string. + * @member {string} azurefilesShare AzureFiles share. + * @member {boolean} [switchSiteAfterMigration] trueif the app + * should be switched over; otherwise, false. Default value: false + * . + * @member {boolean} [blockWriteAccessToSite] true if the app + * should be read only during copy operation; otherwise, false. + * Default value: false . + */ +export interface StorageMigrationOptions extends ProxyOnlyResource { + azurefilesConnectionString: string; + azurefilesShare: string; + switchSiteAfterMigration?: boolean; + blockWriteAccessToSite?: boolean; +} + +/** + * @class + * Initializes a new instance of the StorageMigrationResponse class. + * @constructor + * Response for a migration of app content request. + * + * @member {string} [operationId] When server starts the migration process, it + * will return an operation ID identifying that particular migration operation. + */ +export interface StorageMigrationResponse extends ProxyOnlyResource { + readonly operationId?: string; +} + +/** + * @class + * Initializes a new instance of the StringDictionary class. + * @constructor + * String dictionary resource. + * + * @member {object} [properties] Settings. + */ +export interface StringDictionary extends ProxyOnlyResource { + properties?: { [propertyName: string]: string }; +} + +/** + * @class + * Initializes a new instance of the SwiftVirtualNetwork class. + * @constructor + * Swift Virtual Network Contract. This is used to enable the new Swift way of + * doing virtual network integration. + * + * @member {string} [subnetResourceId] The Virtual Network subnet's resource + * ID. This is the subnet that this Web App will join. This subnet must have a + * delegation to Microsoft.Web/serverFarms defined first. + * @member {boolean} [swiftSupported] A flag that specifies if the scale unit + * this Web App is on supports Swift integration. + */ +export interface SwiftVirtualNetwork extends ProxyOnlyResource { + subnetResourceId?: string; + swiftSupported?: boolean; +} + +/** + * @class + * Initializes a new instance of the TriggeredJobRun class. + * @constructor + * Triggered Web Job Run Information. + * + * @member {string} [webJobId] Job ID. + * @member {string} [webJobName] Job name. + * @member {string} [status] Job status. Possible values include: 'Success', + * 'Failed', 'Error' + * @member {date} [startTime] Start time. + * @member {date} [endTime] End time. + * @member {string} [duration] Job duration. + * @member {string} [outputUrl] Output URL. + * @member {string} [errorUrl] Error URL. + * @member {string} [url] Job URL. + * @member {string} [jobName] Job name. + * @member {string} [trigger] Job trigger. + */ +export interface TriggeredJobRun extends ProxyOnlyResource { + webJobId?: string; + webJobName?: string; + status?: string; + startTime?: Date; + endTime?: Date; + duration?: string; + outputUrl?: string; + errorUrl?: string; + url?: string; + jobName?: string; + trigger?: string; +} + +/** + * @class + * Initializes a new instance of the TriggeredJobHistory class. + * @constructor + * Triggered Web Job History. List of Triggered Web Job Run Information + * elements. + * + * @member {array} [runs] List of triggered web job runs. + */ +export interface TriggeredJobHistory extends ProxyOnlyResource { + runs?: TriggeredJobRun[]; +} + +/** + * @class + * Initializes a new instance of the TriggeredWebJob class. + * @constructor + * Triggered Web Job Information. + * + * @member {object} [latestRun] Latest job run information. + * @member {string} [latestRun.webJobId] Job ID. + * @member {string} [latestRun.webJobName] Job name. + * @member {string} [latestRun.status] Job status. Possible values include: + * 'Success', 'Failed', 'Error' + * @member {date} [latestRun.startTime] Start time. + * @member {date} [latestRun.endTime] End time. + * @member {string} [latestRun.duration] Job duration. + * @member {string} [latestRun.outputUrl] Output URL. + * @member {string} [latestRun.errorUrl] Error URL. + * @member {string} [latestRun.url] Job URL. + * @member {string} [latestRun.jobName] Job name. + * @member {string} [latestRun.trigger] Job trigger. + * @member {string} [historyUrl] History URL. + * @member {string} [schedulerLogsUrl] Scheduler Logs URL. + * @member {string} [runCommand] Run command. + * @member {string} [url] Job URL. + * @member {string} [extraInfoUrl] Extra Info URL. + * @member {string} [webJobType] Job type. Possible values include: + * 'Continuous', 'Triggered' + * @member {string} [error] Error information. + * @member {boolean} [usingSdk] Using SDK? + * @member {object} [settings] Job settings. + */ +export interface TriggeredWebJob extends ProxyOnlyResource { + latestRun?: TriggeredJobRun; + historyUrl?: string; + schedulerLogsUrl?: string; + runCommand?: string; + url?: string; + extraInfoUrl?: string; + webJobType?: string; + error?: string; + usingSdk?: boolean; + settings?: { [propertyName: string]: any }; +} + +/** + * @class + * Initializes a new instance of the WebJob class. + * @constructor + * Web Job Information. + * + * @member {string} [runCommand] Run command. + * @member {string} [url] Job URL. + * @member {string} [extraInfoUrl] Extra Info URL. + * @member {string} [webJobType] Job type. Possible values include: + * 'Continuous', 'Triggered' + * @member {string} [error] Error information. + * @member {boolean} [usingSdk] Using SDK? + * @member {object} [settings] Job settings. + */ +export interface WebJob extends ProxyOnlyResource { + runCommand?: string; + url?: string; + extraInfoUrl?: string; + webJobType?: string; + error?: string; + usingSdk?: boolean; + settings?: { [propertyName: string]: any }; +} + +/** + * @class + * Initializes a new instance of the AddressResponse class. + * @constructor + * Describes main public IP address and any extra virtual IPs. + * + * @member {string} [serviceIpAddress] Main public virtual IP. + * @member {string} [internalIpAddress] Virtual Network internal IP address of + * the App Service Environment if it is in internal load-balancing mode. + * @member {array} [outboundIpAddresses] IP addresses appearing on outbound + * connections. + * @member {array} [vipMappings] Additional virtual IPs. + */ +export interface AddressResponse { + serviceIpAddress?: string; + internalIpAddress?: string; + outboundIpAddresses?: string[]; + vipMappings?: VirtualIPMapping[]; +} + +/** + * @class + * Initializes a new instance of the AppServiceEnvironmentResource class. + * @constructor + * App Service Environment ARM resource. + * + * @member {string} appServiceEnvironmentResourceName Name of the App Service + * Environment. + * @member {string} appServiceEnvironmentResourceLocation Location of the App + * Service Environment, e.g. "West US". + * @member {string} [provisioningState] Provisioning state of the App Service + * Environment. Possible values include: 'Succeeded', 'Failed', 'Canceled', + * 'InProgress', 'Deleting' + * @member {string} [status] Current status of the App Service Environment. + * Possible values include: 'Preparing', 'Ready', 'Scaling', 'Deleting' + * @member {string} [vnetName] Name of the Virtual Network for the App Service + * Environment. + * @member {string} [vnetResourceGroupName] Resource group of the Virtual + * Network. + * @member {string} [vnetSubnetName] Subnet of the Virtual Network. + * @member {object} virtualNetwork Description of the Virtual Network. + * @member {string} [virtualNetwork.id] Resource id of the Virtual Network. + * @member {string} [virtualNetwork.name] Name of the Virtual Network + * (read-only). + * @member {string} [virtualNetwork.type] Resource type of the Virtual Network + * (read-only). + * @member {string} [virtualNetwork.subnet] Subnet within the Virtual Network. + * @member {string} [internalLoadBalancingMode] Specifies which endpoints to + * serve internally in the Virtual Network for the App Service Environment. + * Possible values include: 'None', 'Web', 'Publishing' + * @member {string} [multiSize] Front-end VM size, e.g. "Medium", "Large". + * @member {number} [multiRoleCount] Number of front-end instances. + * @member {array} workerPools Description of worker pools with worker size + * IDs, VM sizes, and number of workers in each pool. + * @member {number} [ipsslAddressCount] Number of IP SSL addresses reserved for + * the App Service Environment. + * @member {string} [databaseEdition] Edition of the metadata database for the + * App Service Environment, e.g. "Standard". + * @member {string} [databaseServiceObjective] Service objective of the + * metadata database for the App Service Environment, e.g. "S0". + * @member {number} [upgradeDomains] Number of upgrade domains of the App + * Service Environment. + * @member {string} [subscriptionId] Subscription of the App Service + * Environment. + * @member {string} [dnsSuffix] DNS suffix of the App Service Environment. + * @member {string} [lastAction] Last deployment action on the App Service + * Environment. + * @member {string} [lastActionResult] Result of the last deployment action on + * the App Service Environment. + * @member {string} [allowedMultiSizes] List of comma separated strings + * describing which VM sizes are allowed for front-ends. + * @member {string} [allowedWorkerSizes] List of comma separated strings + * describing which VM sizes are allowed for workers. + * @member {number} [maximumNumberOfMachines] Maximum number of VMs in the App + * Service Environment. + * @member {array} [vipMappings] Description of IP SSL mapping for the App + * Service Environment. + * @member {array} [environmentCapacities] Current total, used, and available + * worker capacities. + * @member {array} [networkAccessControlList] Access control list for + * controlling traffic to the App Service Environment. + * @member {boolean} [environmentIsHealthy] True/false indicating whether the + * App Service Environment is healthy. + * @member {string} [environmentStatus] Detailed message about with results of + * the last check of the App Service Environment. + * @member {string} [resourceGroup] Resource group of the App Service + * Environment. + * @member {number} [frontEndScaleFactor] Scale factor for front-ends. + * @member {number} [defaultFrontEndScaleFactor] Default Scale Factor for + * FrontEnds. + * @member {string} [apiManagementAccountId] API Management Account associated + * with the App Service Environment. + * @member {boolean} [suspended] true if the App Service + * Environment is suspended; otherwise, false. The environment can + * be suspended, e.g. when the management endpoint is no longer available + * (most likely because NSG blocked the incoming traffic). + * @member {boolean} [dynamicCacheEnabled] True/false indicating whether the + * App Service Environment is suspended. The environment can be suspended e.g. + * when the management endpoint is no longer available + * (most likely because NSG blocked the incoming traffic). + * @member {array} [clusterSettings] Custom settings for changing the behavior + * of the App Service Environment. + * @member {array} [userWhitelistedIpRanges] User added ip ranges to whitelist + * on ASE db + * @member {boolean} [hasLinuxWorkers] Flag that displays whether an ASE has + * linux workers or not + * @member {string} [sslCertKeyVaultId] Key Vault ID for ILB App Service + * Environment default SSL certificate + * @member {string} [sslCertKeyVaultSecretName] Key Vault Secret Name for ILB + * App Service Environment default SSL certificate + */ +export interface AppServiceEnvironmentResource extends Resource { + appServiceEnvironmentResourceName: string; + appServiceEnvironmentResourceLocation: string; + readonly provisioningState?: string; + readonly status?: string; + vnetName?: string; + vnetResourceGroupName?: string; + vnetSubnetName?: string; + virtualNetwork: VirtualNetworkProfile; + internalLoadBalancingMode?: string; + multiSize?: string; + multiRoleCount?: number; + workerPools: WorkerPool[]; + ipsslAddressCount?: number; + readonly databaseEdition?: string; + readonly databaseServiceObjective?: string; + readonly upgradeDomains?: number; + readonly subscriptionId?: string; + dnsSuffix?: string; + readonly lastAction?: string; + readonly lastActionResult?: string; + readonly allowedMultiSizes?: string; + readonly allowedWorkerSizes?: string; + readonly maximumNumberOfMachines?: number; + readonly vipMappings?: VirtualIPMapping[]; + readonly environmentCapacities?: StampCapacity[]; + networkAccessControlList?: NetworkAccessControlEntry[]; + readonly environmentIsHealthy?: boolean; + readonly environmentStatus?: string; + readonly resourceGroup?: string; + frontEndScaleFactor?: number; + readonly defaultFrontEndScaleFactor?: number; + apiManagementAccountId?: string; + suspended?: boolean; + dynamicCacheEnabled?: boolean; + clusterSettings?: NameValuePair[]; + userWhitelistedIpRanges?: string[]; + hasLinuxWorkers?: boolean; + sslCertKeyVaultId?: string; + sslCertKeyVaultSecretName?: string; +} + +/** + * @class + * Initializes a new instance of the AppServiceEnvironmentPatchResource class. + * @constructor + * ARM resource for a app service enviroment. + * + * @member {string} appServiceEnvironmentPatchResourceName Name of the App + * Service Environment. + * @member {string} location Location of the App Service Environment, e.g. + * "West US". + * @member {string} [provisioningState] Provisioning state of the App Service + * Environment. Possible values include: 'Succeeded', 'Failed', 'Canceled', + * 'InProgress', 'Deleting' + * @member {string} [status] Current status of the App Service Environment. + * Possible values include: 'Preparing', 'Ready', 'Scaling', 'Deleting' + * @member {string} [vnetName] Name of the Virtual Network for the App Service + * Environment. + * @member {string} [vnetResourceGroupName] Resource group of the Virtual + * Network. + * @member {string} [vnetSubnetName] Subnet of the Virtual Network. + * @member {object} virtualNetwork Description of the Virtual Network. + * @member {string} [virtualNetwork.id] Resource id of the Virtual Network. + * @member {string} [virtualNetwork.name] Name of the Virtual Network + * (read-only). + * @member {string} [virtualNetwork.type] Resource type of the Virtual Network + * (read-only). + * @member {string} [virtualNetwork.subnet] Subnet within the Virtual Network. + * @member {string} [internalLoadBalancingMode] Specifies which endpoints to + * serve internally in the Virtual Network for the App Service Environment. + * Possible values include: 'None', 'Web', 'Publishing' + * @member {string} [multiSize] Front-end VM size, e.g. "Medium", "Large". + * @member {number} [multiRoleCount] Number of front-end instances. + * @member {array} workerPools Description of worker pools with worker size + * IDs, VM sizes, and number of workers in each pool. + * @member {number} [ipsslAddressCount] Number of IP SSL addresses reserved for + * the App Service Environment. + * @member {string} [databaseEdition] Edition of the metadata database for the + * App Service Environment, e.g. "Standard". + * @member {string} [databaseServiceObjective] Service objective of the + * metadata database for the App Service Environment, e.g. "S0". + * @member {number} [upgradeDomains] Number of upgrade domains of the App + * Service Environment. + * @member {string} [subscriptionId] Subscription of the App Service + * Environment. + * @member {string} [dnsSuffix] DNS suffix of the App Service Environment. + * @member {string} [lastAction] Last deployment action on the App Service + * Environment. + * @member {string} [lastActionResult] Result of the last deployment action on + * the App Service Environment. + * @member {string} [allowedMultiSizes] List of comma separated strings + * describing which VM sizes are allowed for front-ends. + * @member {string} [allowedWorkerSizes] List of comma separated strings + * describing which VM sizes are allowed for workers. + * @member {number} [maximumNumberOfMachines] Maximum number of VMs in the App + * Service Environment. + * @member {array} [vipMappings] Description of IP SSL mapping for the App + * Service Environment. + * @member {array} [environmentCapacities] Current total, used, and available + * worker capacities. + * @member {array} [networkAccessControlList] Access control list for + * controlling traffic to the App Service Environment. + * @member {boolean} [environmentIsHealthy] True/false indicating whether the + * App Service Environment is healthy. + * @member {string} [environmentStatus] Detailed message about with results of + * the last check of the App Service Environment. + * @member {string} [resourceGroup] Resource group of the App Service + * Environment. + * @member {number} [frontEndScaleFactor] Scale factor for front-ends. + * @member {number} [defaultFrontEndScaleFactor] Default Scale Factor for + * FrontEnds. + * @member {string} [apiManagementAccountId] API Management Account associated + * with the App Service Environment. + * @member {boolean} [suspended] true if the App Service + * Environment is suspended; otherwise, false. The environment can + * be suspended, e.g. when the management endpoint is no longer available + * (most likely because NSG blocked the incoming traffic). + * @member {boolean} [dynamicCacheEnabled] True/false indicating whether the + * App Service Environment is suspended. The environment can be suspended e.g. + * when the management endpoint is no longer available + * (most likely because NSG blocked the incoming traffic). + * @member {array} [clusterSettings] Custom settings for changing the behavior + * of the App Service Environment. + * @member {array} [userWhitelistedIpRanges] User added ip ranges to whitelist + * on ASE db + * @member {boolean} [hasLinuxWorkers] Flag that displays whether an ASE has + * linux workers or not + * @member {string} [sslCertKeyVaultId] Key Vault ID for ILB App Service + * Environment default SSL certificate + * @member {string} [sslCertKeyVaultSecretName] Key Vault Secret Name for ILB + * App Service Environment default SSL certificate + */ +export interface AppServiceEnvironmentPatchResource extends ProxyOnlyResource { + appServiceEnvironmentPatchResourceName: string; + location: string; + readonly provisioningState?: string; + readonly status?: string; + vnetName?: string; + vnetResourceGroupName?: string; + vnetSubnetName?: string; + virtualNetwork: VirtualNetworkProfile; + internalLoadBalancingMode?: string; + multiSize?: string; + multiRoleCount?: number; + workerPools: WorkerPool[]; + ipsslAddressCount?: number; + readonly databaseEdition?: string; + readonly databaseServiceObjective?: string; + readonly upgradeDomains?: number; + readonly subscriptionId?: string; + dnsSuffix?: string; + readonly lastAction?: string; + readonly lastActionResult?: string; + readonly allowedMultiSizes?: string; + readonly allowedWorkerSizes?: string; + readonly maximumNumberOfMachines?: number; + readonly vipMappings?: VirtualIPMapping[]; + readonly environmentCapacities?: StampCapacity[]; + networkAccessControlList?: NetworkAccessControlEntry[]; + readonly environmentIsHealthy?: boolean; + readonly environmentStatus?: string; + readonly resourceGroup?: string; + frontEndScaleFactor?: number; + readonly defaultFrontEndScaleFactor?: number; + apiManagementAccountId?: string; + suspended?: boolean; + dynamicCacheEnabled?: boolean; + clusterSettings?: NameValuePair[]; + userWhitelistedIpRanges?: string[]; + hasLinuxWorkers?: boolean; + sslCertKeyVaultId?: string; + sslCertKeyVaultSecretName?: string; +} + +/** + * @class + * Initializes a new instance of the HostingEnvironmentDiagnostics class. + * @constructor + * Diagnostics for an App Service Environment. + * + * @member {string} [name] Name/identifier of the diagnostics. + * @member {string} [diagnosicsOutput] Diagnostics output. + */ +export interface HostingEnvironmentDiagnostics { + name?: string; + diagnosicsOutput?: string; +} + +/** + * @class + * Initializes a new instance of the MetricAvailabilily class. + * @constructor + * Metric availability and retention. + * + * @member {string} [timeGrain] Time grain. + * @member {string} [retention] Retention period for the current time grain. + */ +export interface MetricAvailabilily { + timeGrain?: string; + retention?: string; +} + +/** + * @class + * Initializes a new instance of the MetricDefinition class. + * @constructor + * Metadata for a metric. + * + * @member {string} [unit] Unit of the metric. + * @member {string} [primaryAggregationType] Primary aggregation type. + * @member {array} [metricAvailabilities] List of time grains supported for the + * metric together with retention period. + * @member {string} [displayName] Friendly name shown in the UI. + */ +export interface MetricDefinition extends ProxyOnlyResource { + readonly unit?: string; + readonly primaryAggregationType?: string; + readonly metricAvailabilities?: MetricAvailabilily[]; + readonly displayName?: string; +} + +/** + * @class + * Initializes a new instance of the SkuInfo class. + * @constructor + * SKU discovery information. + * + * @member {string} [resourceType] Resource type that this SKU applies to. + * @member {object} [sku] Name and tier of the SKU. + * @member {string} [sku.name] Name of the resource SKU. + * @member {string} [sku.tier] Service tier of the resource SKU. + * @member {string} [sku.size] Size specifier of the resource SKU. + * @member {string} [sku.family] Family code of the resource SKU. + * @member {number} [sku.capacity] Current number of instances assigned to the + * resource. + * @member {object} [sku.skuCapacity] Min, max, and default scale values of the + * SKU. + * @member {number} [sku.skuCapacity.minimum] Minimum number of workers for + * this App Service plan SKU. + * @member {number} [sku.skuCapacity.maximum] Maximum number of workers for + * this App Service plan SKU. + * @member {number} [sku.skuCapacity.default] Default number of workers for + * this App Service plan SKU. + * @member {string} [sku.skuCapacity.scaleType] Available scale configurations + * for an App Service plan. + * @member {array} [sku.locations] Locations of the SKU. + * @member {array} [sku.capabilities] Capabilities of the SKU, e.g., is traffic + * manager enabled? + * @member {object} [capacity] Min, max, and default scale values of the SKU. + * @member {number} [capacity.minimum] Minimum number of workers for this App + * Service plan SKU. + * @member {number} [capacity.maximum] Maximum number of workers for this App + * Service plan SKU. + * @member {number} [capacity.default] Default number of workers for this App + * Service plan SKU. + * @member {string} [capacity.scaleType] Available scale configurations for an + * App Service plan. + */ +export interface SkuInfo { + resourceType?: string; + sku?: SkuDescription; + capacity?: SkuCapacity; +} + +/** + * @class + * Initializes a new instance of the Usage class. + * @constructor + * Usage of the quota resource. + * + * @member {string} [displayName] Friendly name shown in the UI. + * @member {string} [resourceName] Name of the quota resource. + * @member {string} [unit] Units of measurement for the quota resource. + * @member {number} [currentValue] The current value of the resource counter. + * @member {number} [limit] The resource limit. + * @member {date} [nextResetTime] Next reset time for the resource counter. + * @member {string} [computeMode] Compute mode used for this usage. Possible + * values include: 'Shared', 'Dedicated', 'Dynamic' + * @member {string} [siteMode] Site mode used for this usage. + */ +export interface Usage extends ProxyOnlyResource { + readonly displayName?: string; + readonly resourceName?: string; + readonly unit?: string; + readonly currentValue?: number; + readonly limit?: number; + readonly nextResetTime?: Date; + readonly computeMode?: string; + readonly siteMode?: string; +} + +/** + * @class + * Initializes a new instance of the WorkerPoolResource class. + * @constructor + * Worker pool of an App Service Environment ARM resource. + * + * @member {number} [workerSizeId] Worker size ID for referencing this worker + * pool. + * @member {string} [computeMode] Shared or dedicated app hosting. Possible + * values include: 'Shared', 'Dedicated', 'Dynamic' + * @member {string} [workerSize] VM size of the worker pool instances. + * @member {number} [workerCount] Number of instances in the worker pool. + * @member {array} [instanceNames] Names of all instances in the worker pool + * (read only). + * @member {object} [sku] + * @member {string} [sku.name] Name of the resource SKU. + * @member {string} [sku.tier] Service tier of the resource SKU. + * @member {string} [sku.size] Size specifier of the resource SKU. + * @member {string} [sku.family] Family code of the resource SKU. + * @member {number} [sku.capacity] Current number of instances assigned to the + * resource. + * @member {object} [sku.skuCapacity] Min, max, and default scale values of the + * SKU. + * @member {number} [sku.skuCapacity.minimum] Minimum number of workers for + * this App Service plan SKU. + * @member {number} [sku.skuCapacity.maximum] Maximum number of workers for + * this App Service plan SKU. + * @member {number} [sku.skuCapacity.default] Default number of workers for + * this App Service plan SKU. + * @member {string} [sku.skuCapacity.scaleType] Available scale configurations + * for an App Service plan. + * @member {array} [sku.locations] Locations of the SKU. + * @member {array} [sku.capabilities] Capabilities of the SKU, e.g., is traffic + * manager enabled? + */ +export interface WorkerPoolResource extends ProxyOnlyResource { + workerSizeId?: number; + computeMode?: string; + workerSize?: string; + workerCount?: number; + readonly instanceNames?: string[]; + sku?: SkuDescription; +} + +/** + * @class + * Initializes a new instance of the AppServicePlanPatchResource class. + * @constructor + * ARM resource for a app service plan. + * + * @member {string} [workerTierName] Target worker tier assigned to the App + * Service plan. + * @member {string} [status] App Service plan status. Possible values include: + * 'Ready', 'Pending', 'Creating' + * @member {string} [subscription] App Service plan subscription. + * @member {string} [adminSiteName] App Service plan administration site. + * @member {object} [hostingEnvironmentProfile] Specification for the App + * Service Environment to use for the App Service plan. + * @member {string} [hostingEnvironmentProfile.id] Resource ID of the App + * Service Environment. + * @member {string} [hostingEnvironmentProfile.name] Name of the App Service + * Environment. + * @member {string} [hostingEnvironmentProfile.type] Resource type of the App + * Service Environment. + * @member {number} [maximumNumberOfWorkers] Maximum number of instances that + * can be assigned to this App Service plan. + * @member {string} [geoRegion] Geographical location for the App Service plan. + * @member {boolean} [perSiteScaling] If true, apps assigned to + * this App Service plan can be scaled independently. + * If false, apps assigned to this App Service plan will scale to + * all instances of the plan. Default value: false . + * @member {number} [numberOfSites] Number of apps assigned to this App Service + * plan. + * @member {boolean} [isSpot] If true, this App Service Plan owns + * spot instances. + * @member {date} [spotExpirationTime] The time when the server farm expires. + * Valid only if it is a spot server farm. + * @member {date} [freeOfferExpirationTime] The time when the server farm free + * offer expires. + * @member {string} [resourceGroup] Resource group of the App Service plan. + * @member {boolean} [reserved] If Linux app service plan true, + * false otherwise. Default value: false . + * @member {boolean} [isXenon] Obsolete: If Hyper-V container app service plan + * true, false otherwise. Default value: false . + * @member {boolean} [hyperV] If Hyper-V container app service plan + * true, false otherwise. Default value: false . + * @member {number} [targetWorkerCount] Scaling worker count. + * @member {number} [targetWorkerSizeId] Scaling worker size ID. + * @member {string} [provisioningState] Provisioning state of the App Service + * Environment. Possible values include: 'Succeeded', 'Failed', 'Canceled', + * 'InProgress', 'Deleting' + */ +export interface AppServicePlanPatchResource extends ProxyOnlyResource { + workerTierName?: string; + readonly status?: string; + readonly subscription?: string; + adminSiteName?: string; + hostingEnvironmentProfile?: HostingEnvironmentProfile; + readonly maximumNumberOfWorkers?: number; + readonly geoRegion?: string; + perSiteScaling?: boolean; + readonly numberOfSites?: number; + isSpot?: boolean; + spotExpirationTime?: Date; + freeOfferExpirationTime?: Date; + readonly resourceGroup?: string; + reserved?: boolean; + isXenon?: boolean; + hyperV?: boolean; + targetWorkerCount?: number; + targetWorkerSizeId?: number; + readonly provisioningState?: string; +} + +/** + * @class + * Initializes a new instance of the HybridConnectionLimits class. + * @constructor + * Hybrid Connection limits contract. This is used to return the plan limits of + * Hybrid Connections. + * + * @member {number} [current] The current number of Hybrid Connections. + * @member {number} [maximum] The maximum number of Hybrid Connections allowed. + */ +export interface HybridConnectionLimits extends ProxyOnlyResource { + readonly current?: number; + readonly maximum?: number; +} + +/** + * @class + * Initializes a new instance of the ResourceHealthMetadata class. + * @constructor + * Used for getting ResourceHealthCheck settings. + * + * @member {string} [category] The category that the resource matches in the + * RHC Policy File + * @member {boolean} [signalAvailability] Is there a health signal for the + * resource + */ +export interface ResourceHealthMetadata extends ProxyOnlyResource { + category?: string; + signalAvailability?: boolean; +} + + +/** + * @class + * Initializes a new instance of the AppServiceCertificateOrderCollection class. + * @constructor + * Collection of certitificate orders. + * + * @member {string} [nextLink] Link to next page of resources. + */ +export interface AppServiceCertificateOrderCollection extends Array { + readonly nextLink?: string; +} + +/** + * @class + * Initializes a new instance of the AppServiceCertificateCollection class. + * @constructor + * Collection of certitificateorder certificates. + * + * @member {string} [nextLink] Link to next page of resources. + */ +export interface AppServiceCertificateCollection extends Array { + readonly nextLink?: string; +} + +/** + * @class + * Initializes a new instance of the CsmOperationCollection class. + * @constructor + * Collection of Azure resource manager operation metadata. + * + * @member {string} [nextLink] Link to next page of resources. + */ +export interface CsmOperationCollection extends Array { + readonly nextLink?: string; +} + +/** + * @class + * Initializes a new instance of the DomainCollection class. + * @constructor + * Collection of domains. + * + * @member {string} [nextLink] Link to next page of resources. + */ +export interface DomainCollection extends Array { + readonly nextLink?: string; +} + +/** + * @class + * Initializes a new instance of the NameIdentifierCollection class. + * @constructor + * Collection of domain name identifiers. + * + * @member {string} [nextLink] Link to next page of resources. + */ +export interface NameIdentifierCollection extends Array { + readonly nextLink?: string; +} + +/** + * @class + * Initializes a new instance of the DomainOwnershipIdentifierCollection class. + * @constructor + * Collection of domain ownership identifiers. + * + * @member {string} [nextLink] Link to next page of resources. + */ +export interface DomainOwnershipIdentifierCollection extends Array { + readonly nextLink?: string; +} + +/** + * @class + * Initializes a new instance of the TopLevelDomainCollection class. + * @constructor + * Collection of Top-level domains. + * + * @member {string} [nextLink] Link to next page of resources. + */ +export interface TopLevelDomainCollection extends Array { + readonly nextLink?: string; +} + +/** + * @class + * Initializes a new instance of the TldLegalAgreementCollection class. + * @constructor + * Collection of top-level domain legal agreements. + * + * @member {string} [nextLink] Link to next page of resources. + */ +export interface TldLegalAgreementCollection extends Array { + readonly nextLink?: string; +} + +/** + * @class + * Initializes a new instance of the CertificateCollection class. + * @constructor + * Collection of certificates. + * + * @member {string} [nextLink] Link to next page of resources. + */ +export interface CertificateCollection extends Array { + readonly nextLink?: string; +} + +/** + * @class + * Initializes a new instance of the DeletedWebAppCollection class. + * @constructor + * Collection of deleted apps. + * + * @member {string} [nextLink] Link to next page of resources. + */ +export interface DeletedWebAppCollection extends Array { + readonly nextLink?: string; +} + +/** + * @class + * Initializes a new instance of the DetectorResponseCollection class. + * @constructor + * Collection of detector responses + * + * @member {string} [nextLink] Link to next page of resources. + */ +export interface DetectorResponseCollection extends Array { + readonly nextLink?: string; +} + +/** + * @class + * Initializes a new instance of the DiagnosticCategoryCollection class. + * @constructor + * Collection of Diagnostic Categories + * + * @member {string} [nextLink] Link to next page of resources. + */ +export interface DiagnosticCategoryCollection extends Array { + readonly nextLink?: string; +} + +/** + * @class + * Initializes a new instance of the DiagnosticAnalysisCollection class. + * @constructor + * Collection of Diagnostic Analyses + * + * @member {string} [nextLink] Link to next page of resources. + */ +export interface DiagnosticAnalysisCollection extends Array { + readonly nextLink?: string; +} + +/** + * @class + * Initializes a new instance of the DiagnosticDetectorCollection class. + * @constructor + * Collection of Diagnostic Detectors + * + * @member {string} [nextLink] Link to next page of resources. + */ +export interface DiagnosticDetectorCollection extends Array { + readonly nextLink?: string; +} + +/** + * @class + * Initializes a new instance of the ApplicationStackCollection class. + * @constructor + * Collection of Application Stacks + * + * @member {string} [nextLink] Link to next page of resources. + */ +export interface ApplicationStackCollection extends Array { + readonly nextLink?: string; +} + +/** + * @class + * Initializes a new instance of the RecommendationCollection class. + * @constructor + * Collection of recommendations. + * + * @member {string} [nextLink] Link to next page of resources. + */ +export interface RecommendationCollection extends Array { + readonly nextLink?: string; +} + +/** + * @class + * Initializes a new instance of the SourceControlCollection class. + * @constructor + * Collection of source controls. + * + * @member {string} [nextLink] Link to next page of resources. + */ +export interface SourceControlCollection 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 GeoRegionCollection class. + * @constructor + * Collection of geographical regions. + * + * @member {string} [nextLink] Link to next page of resources. + */ +export interface GeoRegionCollection extends Array { + readonly nextLink?: string; +} + +/** + * @class + * Initializes a new instance of the IdentifierCollection class. + * @constructor + * Collection of identifiers. + * + * @member {string} [nextLink] Link to next page of resources. + */ +export interface IdentifierCollection extends Array { + readonly nextLink?: string; +} + +/** + * @class + * Initializes a new instance of the PremierAddOnOfferCollection class. + * @constructor + * Collection of premier add-on offers. + * + * @member {string} [nextLink] Link to next page of resources. + */ +export interface PremierAddOnOfferCollection extends Array { + readonly nextLink?: string; +} + +/** + * @class + * Initializes a new instance of the WebAppCollection class. + * @constructor + * Collection of App Service apps. + * + * @member {string} [nextLink] Link to next page of resources. + */ +export interface WebAppCollection extends Array { + readonly nextLink?: string; +} + +/** + * @class + * Initializes a new instance of the BackupItemCollection class. + * @constructor + * Collection of backup items. + * + * @member {string} [nextLink] Link to next page of resources. + */ +export interface BackupItemCollection extends Array { + readonly nextLink?: string; +} + +/** + * @class + * Initializes a new instance of the SiteConfigResourceCollection class. + * @constructor + * Collection of site configurations. + * + * @member {string} [nextLink] Link to next page of resources. + */ +export interface SiteConfigResourceCollection extends Array { + readonly nextLink?: string; +} + +/** + * @class + * Initializes a new instance of the SiteConfigurationSnapshotInfoCollection class. + * @constructor + * Collection of metadata for the app configuration snapshots that can be + * restored. + * + * @member {string} [nextLink] Link to next page of resources. + */ +export interface SiteConfigurationSnapshotInfoCollection extends Array { + readonly nextLink?: string; +} + +/** + * @class + * Initializes a new instance of the ContinuousWebJobCollection class. + * @constructor + * Collection of Kudu continuous web job information elements. + * + * @member {string} [nextLink] Link to next page of resources. + */ +export interface ContinuousWebJobCollection extends Array { + readonly nextLink?: string; +} + +/** + * @class + * Initializes a new instance of the DeploymentCollection class. + * @constructor + * Collection of app deployments. + * + * @member {string} [nextLink] Link to next page of resources. + */ +export interface DeploymentCollection extends Array { + readonly nextLink?: string; +} + +/** + * @class + * Initializes a new instance of the FunctionEnvelopeCollection class. + * @constructor + * Collection of Kudu function information elements. + * + * @member {string} [nextLink] Link to next page of resources. + */ +export interface FunctionEnvelopeCollection extends Array { + readonly nextLink?: string; +} + +/** + * @class + * Initializes a new instance of the HostNameBindingCollection class. + * @constructor + * Collection of hostname bindings. + * + * @member {string} [nextLink] Link to next page of resources. + */ +export interface HostNameBindingCollection extends Array { + readonly nextLink?: string; +} + +/** + * @class + * Initializes a new instance of the WebAppInstanceCollection class. + * @constructor + * Collection of app instances. + * + * @member {string} [nextLink] Link to next page of resources. + */ +export interface WebAppInstanceCollection extends Array { + readonly nextLink?: string; +} + +/** + * @class + * Initializes a new instance of the ProcessInfoCollection class. + * @constructor + * Collection of Kudu process information elements. + * + * @member {string} [nextLink] Link to next page of resources. + */ +export interface ProcessInfoCollection extends Array { + readonly nextLink?: string; +} + +/** + * @class + * Initializes a new instance of the ProcessModuleInfoCollection class. + * @constructor + * Collection of Kudu thread information elements. + * + * @member {string} [nextLink] Link to next page of resources. + */ +export interface ProcessModuleInfoCollection extends Array { + readonly nextLink?: string; +} + +/** + * @class + * Initializes a new instance of the ProcessThreadInfoCollection class. + * @constructor + * Collection of Kudu thread information elements. + * + * @member {string} [nextLink] Link to next page of resources. + */ +export interface ProcessThreadInfoCollection extends Array { + readonly nextLink?: string; +} + +/** + * @class + * Initializes a new instance of the ResourceMetricDefinitionCollection class. + * @constructor + * Collection of metric definitions. + * + * @member {string} [nextLink] Link to next page of resources. + */ +export interface ResourceMetricDefinitionCollection extends Array { + readonly nextLink?: string; +} + +/** + * @class + * Initializes a new instance of the ResourceMetricCollection class. + * @constructor + * Collection of metric responses. + * + * @member {string} [nextLink] Link to next page of resources. + */ +export interface ResourceMetricCollection extends Array { + readonly nextLink?: string; +} + +/** + * @class + * Initializes a new instance of the PerfMonCounterCollection class. + * @constructor + * Collection of performance monitor counters. + * + * @member {string} [nextLink] Link to next page of resources. + */ +export interface PerfMonCounterCollection extends Array { + readonly nextLink?: string; +} + +/** + * @class + * Initializes a new instance of the PublicCertificateCollection class. + * @constructor + * Collection of public certificates + * + * @member {string} [nextLink] Link to next page of resources. + */ +export interface PublicCertificateCollection extends Array { + readonly nextLink?: string; +} + +/** + * @class + * Initializes a new instance of the SiteExtensionInfoCollection class. + * @constructor + * Collection of Kudu site extension information elements. + * + * @member {string} [nextLink] Link to next page of resources. + */ +export interface SiteExtensionInfoCollection extends Array { + readonly nextLink?: string; +} + +/** + * @class + * Initializes a new instance of the SlotDifferenceCollection class. + * @constructor + * Collection of slot differences. + * + * @member {string} [nextLink] Link to next page of resources. + */ +export interface SlotDifferenceCollection extends Array { + readonly nextLink?: string; +} + +/** + * @class + * Initializes a new instance of the SnapshotCollection class. + * @constructor + * Collection of snapshots which can be used to revert an app to a previous + * time. + * + * @member {string} [nextLink] Link to next page of resources. + */ +export interface SnapshotCollection extends Array { + readonly nextLink?: string; +} + +/** + * @class + * Initializes a new instance of the TriggeredWebJobCollection class. + * @constructor + * Collection of Kudu continuous web job information elements. + * + * @member {string} [nextLink] Link to next page of resources. + */ +export interface TriggeredWebJobCollection extends Array { + readonly nextLink?: string; +} + +/** + * @class + * Initializes a new instance of the TriggeredJobHistoryCollection class. + * @constructor + * Collection of Kudu continuous web job information elements. + * + * @member {string} [nextLink] Link to next page of resources. + */ +export interface TriggeredJobHistoryCollection extends Array { + readonly nextLink?: string; +} + +/** + * @class + * Initializes a new instance of the CsmUsageQuotaCollection class. + * @constructor + * Collection of CSM usage quotas. + * + * @member {string} [nextLink] Link to next page of resources. + */ +export interface CsmUsageQuotaCollection extends Array { + readonly nextLink?: string; +} + +/** + * @class + * Initializes a new instance of the WebJobCollection class. + * @constructor + * Collection of Kudu web job information elements. + * + * @member {string} [nextLink] Link to next page of resources. + */ +export interface WebJobCollection extends Array { + readonly nextLink?: string; +} + +/** + * @class + * Initializes a new instance of the AppServiceEnvironmentCollection class. + * @constructor + * Collection of App Service Environments. + * + * @member {string} [nextLink] Link to next page of resources. + */ +export interface AppServiceEnvironmentCollection extends Array { + readonly nextLink?: string; +} + +/** + * @class + * Initializes a new instance of the StampCapacityCollection class. + * @constructor + * Collection of stamp capacities. + * + * @member {string} [nextLink] Link to next page of resources. + */ +export interface StampCapacityCollection extends Array { + readonly nextLink?: string; +} + +/** + * @class + * Initializes a new instance of the WorkerPoolCollection class. + * @constructor + * Collection of worker pools. + * + * @member {string} [nextLink] Link to next page of resources. + */ +export interface WorkerPoolCollection extends Array { + readonly nextLink?: string; +} + +/** + * @class + * Initializes a new instance of the SkuInfoCollection class. + * @constructor + * Collection of SKU information. + * + * @member {string} [nextLink] Link to next page of resources. + */ +export interface SkuInfoCollection extends Array { + readonly nextLink?: string; +} + +/** + * @class + * Initializes a new instance of the UsageCollection class. + * @constructor + * Collection of usages. + * + * @member {string} [nextLink] Link to next page of resources. + */ +export interface UsageCollection extends Array { + readonly nextLink?: string; +} + +/** + * @class + * Initializes a new instance of the AppServicePlanCollection class. + * @constructor + * Collection of App Service plans. + * + * @member {string} [nextLink] Link to next page of resources. + */ +export interface AppServicePlanCollection extends Array { + readonly nextLink?: string; +} + +/** + * @class + * Initializes a new instance of the ResourceCollection class. + * @constructor + * Collection of resources. + * + * @member {string} [nextLink] Link to next page of resources. + */ +export interface ResourceCollection extends Array { + readonly nextLink?: string; +} + +/** + * @class + * Initializes a new instance of the HybridConnectionCollection class. + * @constructor + * Collection of hostname bindings. + * + * @member {string} [nextLink] Link to next page of resources. + */ +export interface HybridConnectionCollection extends Array { + readonly nextLink?: string; +} + +/** + * @class + * Initializes a new instance of the ResourceHealthMetadataCollection class. + * @constructor + * Collection of resource health metadata. + * + * @member {string} [nextLink] Link to next page of resources. + */ +export interface ResourceHealthMetadataCollection extends Array { + readonly nextLink?: string; +} diff --git a/lib/services/websiteManagement2/lib/models/index.js b/lib/services/websiteManagement2/lib/models/index.js new file mode 100644 index 0000000000..e298b66554 --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/index.js @@ -0,0 +1,292 @@ +/* + * 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. + */ + +/* jshint latedef:false */ +/* jshint forin:false */ +/* jshint noempty:false */ + +'use strict'; + +var msRestAzure = require('ms-rest-azure'); + +exports.BaseResource = msRestAzure.BaseResource; +exports.CloudError = msRestAzure.CloudError; +exports.AppServiceCertificate = require('./appServiceCertificate'); +exports.Resource = require('./resource'); +exports.AppServiceCertificateResource = require('./appServiceCertificateResource'); +exports.CertificateDetails = require('./certificateDetails'); +exports.AppServiceCertificateOrder = require('./appServiceCertificateOrder'); +exports.ProxyOnlyResource = require('./proxyOnlyResource'); +exports.AppServiceCertificateOrderPatchResource = require('./appServiceCertificateOrderPatchResource'); +exports.AppServiceCertificatePatchResource = require('./appServiceCertificatePatchResource'); +exports.CertificateEmail = require('./certificateEmail'); +exports.CertificateOrderAction = require('./certificateOrderAction'); +exports.ReissueCertificateOrderRequest = require('./reissueCertificateOrderRequest'); +exports.RenewCertificateOrderRequest = require('./renewCertificateOrderRequest'); +exports.SiteSeal = require('./siteSeal'); +exports.SiteSealRequest = require('./siteSealRequest'); +exports.VnetRoute = require('./vnetRoute'); +exports.VnetInfo = require('./vnetInfo'); +exports.VnetGateway = require('./vnetGateway'); +exports.User = require('./user'); +exports.Snapshot = require('./snapshot'); +exports.ResourceMetricAvailability = require('./resourceMetricAvailability'); +exports.ResourceMetricDefinition = require('./resourceMetricDefinition'); +exports.PushSettings = require('./pushSettings'); +exports.Identifier = require('./identifier'); +exports.HybridConnectionKey = require('./hybridConnectionKey'); +exports.HybridConnection = require('./hybridConnection'); +exports.DeletedSite = require('./deletedSite'); +exports.ManagedServiceIdentity = require('./managedServiceIdentity'); +exports.SlotSwapStatus = require('./slotSwapStatus'); +exports.CloningInfo = require('./cloningInfo'); +exports.HostingEnvironmentProfile = require('./hostingEnvironmentProfile'); +exports.IpSecurityRestriction = require('./ipSecurityRestriction'); +exports.ApiDefinitionInfo = require('./apiDefinitionInfo'); +exports.CorsSettings = require('./corsSettings'); +exports.AutoHealCustomAction = require('./autoHealCustomAction'); +exports.AutoHealActions = require('./autoHealActions'); +exports.SlowRequestsBasedTrigger = require('./slowRequestsBasedTrigger'); +exports.StatusCodesBasedTrigger = require('./statusCodesBasedTrigger'); +exports.RequestsBasedTrigger = require('./requestsBasedTrigger'); +exports.AutoHealTriggers = require('./autoHealTriggers'); +exports.AutoHealRules = require('./autoHealRules'); +exports.SiteLimits = require('./siteLimits'); +exports.RampUpRule = require('./rampUpRule'); +exports.Experiments = require('./experiments'); +exports.VirtualDirectory = require('./virtualDirectory'); +exports.VirtualApplication = require('./virtualApplication'); +exports.HandlerMapping = require('./handlerMapping'); +exports.SiteMachineKey = require('./siteMachineKey'); +exports.ConnStringInfo = require('./connStringInfo'); +exports.AzureStorageInfoValue = require('./azureStorageInfoValue'); +exports.NameValuePair = require('./nameValuePair'); +exports.SiteConfig = require('./siteConfig'); +exports.HostNameSslState = require('./hostNameSslState'); +exports.Site = require('./site'); +exports.Capability = require('./capability'); +exports.SkuCapacity = require('./skuCapacity'); +exports.SkuDescription = require('./skuDescription'); +exports.AppServicePlan = require('./appServicePlan'); +exports.DefaultErrorResponseErrorDetailsItem = require('./defaultErrorResponseErrorDetailsItem'); +exports.DefaultErrorResponseError = require('./defaultErrorResponseError'); +exports.DefaultErrorResponse = require('./defaultErrorResponse'); +exports.NameIdentifier = require('./nameIdentifier'); +exports.LogSpecification = require('./logSpecification'); +exports.MetricAvailability = require('./metricAvailability'); +exports.Dimension = require('./dimension'); +exports.MetricSpecification = require('./metricSpecification'); +exports.ServiceSpecification = require('./serviceSpecification'); +exports.CsmOperationDescriptionProperties = require('./csmOperationDescriptionProperties'); +exports.CsmOperationDisplay = require('./csmOperationDisplay'); +exports.CsmOperationDescription = require('./csmOperationDescription'); +exports.Address = require('./address'); +exports.Contact = require('./contact'); +exports.HostName = require('./hostName'); +exports.DomainPurchaseConsent = require('./domainPurchaseConsent'); +exports.Domain = require('./domain'); +exports.DomainAvailablilityCheckResult = require('./domainAvailablilityCheckResult'); +exports.DomainControlCenterSsoRequest = require('./domainControlCenterSsoRequest'); +exports.DomainOwnershipIdentifier = require('./domainOwnershipIdentifier'); +exports.DomainPatchResource = require('./domainPatchResource'); +exports.DomainRecommendationSearchParameters = require('./domainRecommendationSearchParameters'); +exports.TldLegalAgreement = require('./tldLegalAgreement'); +exports.TopLevelDomain = require('./topLevelDomain'); +exports.TopLevelDomainAgreementOption = require('./topLevelDomainAgreementOption'); +exports.Certificate = require('./certificate'); +exports.CertificatePatchResource = require('./certificatePatchResource'); +exports.VirtualNetworkProfile = require('./virtualNetworkProfile'); +exports.WorkerPool = require('./workerPool'); +exports.VirtualIPMapping = require('./virtualIPMapping'); +exports.StampCapacity = require('./stampCapacity'); +exports.NetworkAccessControlEntry = require('./networkAccessControlEntry'); +exports.AppServiceEnvironment = require('./appServiceEnvironment'); +exports.LocalizableString = require('./localizableString'); +exports.CsmUsageQuota = require('./csmUsageQuota'); +exports.ErrorEntity = require('./errorEntity'); +exports.Operation = require('./operation'); +exports.ResourceMetricName = require('./resourceMetricName'); +exports.ResourceMetricProperty = require('./resourceMetricProperty'); +exports.ResourceMetricValue = require('./resourceMetricValue'); +exports.ResourceMetric = require('./resourceMetric'); +exports.Solution = require('./solution'); +exports.DetectorAbnormalTimePeriod = require('./detectorAbnormalTimePeriod'); +exports.AbnormalTimePeriod = require('./abnormalTimePeriod'); +exports.DetectorDefinition = require('./detectorDefinition'); +exports.DiagnosticMetricSample = require('./diagnosticMetricSample'); +exports.DiagnosticMetricSet = require('./diagnosticMetricSet'); +exports.DataSource = require('./dataSource'); +exports.ResponseMetaData = require('./responseMetaData'); +exports.AnalysisData = require('./analysisData'); +exports.AnalysisDefinition = require('./analysisDefinition'); +exports.DataTableResponseColumn = require('./dataTableResponseColumn'); +exports.DataTableResponseObject = require('./dataTableResponseObject'); +exports.DetectorInfo = require('./detectorInfo'); +exports.Rendering = require('./rendering'); +exports.DiagnosticData = require('./diagnosticData'); +exports.DetectorResponse = require('./detectorResponse'); +exports.DiagnosticAnalysis = require('./diagnosticAnalysis'); +exports.DiagnosticCategory = require('./diagnosticCategory'); +exports.DiagnosticDetectorResponse = require('./diagnosticDetectorResponse'); +exports.StackMinorVersion = require('./stackMinorVersion'); +exports.StackMajorVersion = require('./stackMajorVersion'); +exports.ApplicationStack = require('./applicationStack'); +exports.Recommendation = require('./recommendation'); +exports.RecommendationRule = require('./recommendationRule'); +exports.BillingMeter = require('./billingMeter'); +exports.CsmMoveResourceEnvelope = require('./csmMoveResourceEnvelope'); +exports.GeoRegion = require('./geoRegion'); +exports.HostingEnvironmentDeploymentInfo = require('./hostingEnvironmentDeploymentInfo'); +exports.DeploymentLocations = require('./deploymentLocations'); +exports.GlobalCsmSkuDescription = require('./globalCsmSkuDescription'); +exports.PremierAddOnOffer = require('./premierAddOnOffer'); +exports.ResourceNameAvailability = require('./resourceNameAvailability'); +exports.ResourceNameAvailabilityRequest = require('./resourceNameAvailabilityRequest'); +exports.SkuInfos = require('./skuInfos'); +exports.SourceControl = require('./sourceControl'); +exports.ValidateRequest = require('./validateRequest'); +exports.ValidateResponseError = require('./validateResponseError'); +exports.ValidateResponse = require('./validateResponse'); +exports.VnetParameters = require('./vnetParameters'); +exports.VnetValidationTestFailure = require('./vnetValidationTestFailure'); +exports.VnetValidationFailureDetails = require('./vnetValidationFailureDetails'); +exports.FileSystemApplicationLogsConfig = require('./fileSystemApplicationLogsConfig'); +exports.AzureTableStorageApplicationLogsConfig = require('./azureTableStorageApplicationLogsConfig'); +exports.AzureBlobStorageApplicationLogsConfig = require('./azureBlobStorageApplicationLogsConfig'); +exports.ApplicationLogsConfig = require('./applicationLogsConfig'); +exports.AzureBlobStorageHttpLogsConfig = require('./azureBlobStorageHttpLogsConfig'); +exports.AzureStoragePropertyDictionaryResource = require('./azureStoragePropertyDictionaryResource'); +exports.DatabaseBackupSetting = require('./databaseBackupSetting'); +exports.BackupItem = require('./backupItem'); +exports.BackupSchedule = require('./backupSchedule'); +exports.BackupRequest = require('./backupRequest'); +exports.ConnStringValueTypePair = require('./connStringValueTypePair'); +exports.ConnectionStringDictionary = require('./connectionStringDictionary'); +exports.ContinuousWebJob = require('./continuousWebJob'); +exports.CsmPublishingProfileOptions = require('./csmPublishingProfileOptions'); +exports.CsmSlotEntity = require('./csmSlotEntity'); +exports.CustomHostnameAnalysisResult = require('./customHostnameAnalysisResult'); +exports.DeletedAppRestoreRequest = require('./deletedAppRestoreRequest'); +exports.Deployment = require('./deployment'); +exports.EnabledConfig = require('./enabledConfig'); +exports.FileSystemHttpLogsConfig = require('./fileSystemHttpLogsConfig'); +exports.FunctionEnvelope = require('./functionEnvelope'); +exports.FunctionSecrets = require('./functionSecrets'); +exports.HostNameBinding = require('./hostNameBinding'); +exports.HttpLogsConfig = require('./httpLogsConfig'); +exports.MSDeploy = require('./mSDeploy'); +exports.MSDeployLogEntry = require('./mSDeployLogEntry'); +exports.MSDeployLog = require('./mSDeployLog'); +exports.MSDeployStatus = require('./mSDeployStatus'); +exports.MigrateMySqlRequest = require('./migrateMySqlRequest'); +exports.MigrateMySqlStatus = require('./migrateMySqlStatus'); +exports.RelayServiceConnectionEntity = require('./relayServiceConnectionEntity'); +exports.NetworkFeatures = require('./networkFeatures'); +exports.PerfMonSample = require('./perfMonSample'); +exports.PerfMonSet = require('./perfMonSet'); +exports.PerfMonResponse = require('./perfMonResponse'); +exports.PremierAddOn = require('./premierAddOn'); +exports.PremierAddOnPatchResource = require('./premierAddOnPatchResource'); +exports.PrivateAccessSubnet = require('./privateAccessSubnet'); +exports.PrivateAccessVirtualNetwork = require('./privateAccessVirtualNetwork'); +exports.PrivateAccess = require('./privateAccess'); +exports.ProcessThreadInfo = require('./processThreadInfo'); +exports.ProcessModuleInfo = require('./processModuleInfo'); +exports.ProcessInfo = require('./processInfo'); +exports.PublicCertificate = require('./publicCertificate'); +exports.RestoreRequest = require('./restoreRequest'); +exports.SiteAuthSettings = require('./siteAuthSettings'); +exports.SiteCloneabilityCriterion = require('./siteCloneabilityCriterion'); +exports.SiteCloneability = require('./siteCloneability'); +exports.SiteConfigResource = require('./siteConfigResource'); +exports.SiteConfigurationSnapshotInfo = require('./siteConfigurationSnapshotInfo'); +exports.SiteExtensionInfo = require('./siteExtensionInfo'); +exports.SiteInstance = require('./siteInstance'); +exports.SiteLogsConfig = require('./siteLogsConfig'); +exports.SitePatchResource = require('./sitePatchResource'); +exports.SitePhpErrorLogFlag = require('./sitePhpErrorLogFlag'); +exports.SiteSourceControl = require('./siteSourceControl'); +exports.SlotConfigNamesResource = require('./slotConfigNamesResource'); +exports.SlotDifference = require('./slotDifference'); +exports.SnapshotRecoverySource = require('./snapshotRecoverySource'); +exports.SnapshotRestoreRequest = require('./snapshotRestoreRequest'); +exports.StorageMigrationOptions = require('./storageMigrationOptions'); +exports.StorageMigrationResponse = require('./storageMigrationResponse'); +exports.StringDictionary = require('./stringDictionary'); +exports.SwiftVirtualNetwork = require('./swiftVirtualNetwork'); +exports.TriggeredJobRun = require('./triggeredJobRun'); +exports.TriggeredJobHistory = require('./triggeredJobHistory'); +exports.TriggeredWebJob = require('./triggeredWebJob'); +exports.WebJob = require('./webJob'); +exports.AddressResponse = require('./addressResponse'); +exports.AppServiceEnvironmentResource = require('./appServiceEnvironmentResource'); +exports.AppServiceEnvironmentPatchResource = require('./appServiceEnvironmentPatchResource'); +exports.HostingEnvironmentDiagnostics = require('./hostingEnvironmentDiagnostics'); +exports.MetricAvailabilily = require('./metricAvailabilily'); +exports.MetricDefinition = require('./metricDefinition'); +exports.SkuInfo = require('./skuInfo'); +exports.Usage = require('./usage'); +exports.WorkerPoolResource = require('./workerPoolResource'); +exports.AppServicePlanPatchResource = require('./appServicePlanPatchResource'); +exports.HybridConnectionLimits = require('./hybridConnectionLimits'); +exports.ResourceHealthMetadata = require('./resourceHealthMetadata'); +exports.AppServiceCertificateOrderCollection = require('./appServiceCertificateOrderCollection'); +exports.AppServiceCertificateCollection = require('./appServiceCertificateCollection'); +exports.CsmOperationCollection = require('./csmOperationCollection'); +exports.DomainCollection = require('./domainCollection'); +exports.NameIdentifierCollection = require('./nameIdentifierCollection'); +exports.DomainOwnershipIdentifierCollection = require('./domainOwnershipIdentifierCollection'); +exports.TopLevelDomainCollection = require('./topLevelDomainCollection'); +exports.TldLegalAgreementCollection = require('./tldLegalAgreementCollection'); +exports.CertificateCollection = require('./certificateCollection'); +exports.DeletedWebAppCollection = require('./deletedWebAppCollection'); +exports.DetectorResponseCollection = require('./detectorResponseCollection'); +exports.DiagnosticCategoryCollection = require('./diagnosticCategoryCollection'); +exports.DiagnosticAnalysisCollection = require('./diagnosticAnalysisCollection'); +exports.DiagnosticDetectorCollection = require('./diagnosticDetectorCollection'); +exports.ApplicationStackCollection = require('./applicationStackCollection'); +exports.RecommendationCollection = require('./recommendationCollection'); +exports.SourceControlCollection = require('./sourceControlCollection'); +exports.BillingMeterCollection = require('./billingMeterCollection'); +exports.GeoRegionCollection = require('./geoRegionCollection'); +exports.IdentifierCollection = require('./identifierCollection'); +exports.PremierAddOnOfferCollection = require('./premierAddOnOfferCollection'); +exports.WebAppCollection = require('./webAppCollection'); +exports.BackupItemCollection = require('./backupItemCollection'); +exports.SiteConfigResourceCollection = require('./siteConfigResourceCollection'); +exports.SiteConfigurationSnapshotInfoCollection = require('./siteConfigurationSnapshotInfoCollection'); +exports.ContinuousWebJobCollection = require('./continuousWebJobCollection'); +exports.DeploymentCollection = require('./deploymentCollection'); +exports.FunctionEnvelopeCollection = require('./functionEnvelopeCollection'); +exports.HostNameBindingCollection = require('./hostNameBindingCollection'); +exports.WebAppInstanceCollection = require('./webAppInstanceCollection'); +exports.ProcessInfoCollection = require('./processInfoCollection'); +exports.ProcessModuleInfoCollection = require('./processModuleInfoCollection'); +exports.ProcessThreadInfoCollection = require('./processThreadInfoCollection'); +exports.ResourceMetricDefinitionCollection = require('./resourceMetricDefinitionCollection'); +exports.ResourceMetricCollection = require('./resourceMetricCollection'); +exports.PerfMonCounterCollection = require('./perfMonCounterCollection'); +exports.PublicCertificateCollection = require('./publicCertificateCollection'); +exports.SiteExtensionInfoCollection = require('./siteExtensionInfoCollection'); +exports.SlotDifferenceCollection = require('./slotDifferenceCollection'); +exports.SnapshotCollection = require('./snapshotCollection'); +exports.TriggeredWebJobCollection = require('./triggeredWebJobCollection'); +exports.TriggeredJobHistoryCollection = require('./triggeredJobHistoryCollection'); +exports.CsmUsageQuotaCollection = require('./csmUsageQuotaCollection'); +exports.WebJobCollection = require('./webJobCollection'); +exports.AppServiceEnvironmentCollection = require('./appServiceEnvironmentCollection'); +exports.StampCapacityCollection = require('./stampCapacityCollection'); +exports.WorkerPoolCollection = require('./workerPoolCollection'); +exports.SkuInfoCollection = require('./skuInfoCollection'); +exports.UsageCollection = require('./usageCollection'); +exports.AppServicePlanCollection = require('./appServicePlanCollection'); +exports.ResourceCollection = require('./resourceCollection'); +exports.HybridConnectionCollection = require('./hybridConnectionCollection'); +exports.ResourceHealthMetadataCollection = require('./resourceHealthMetadataCollection'); diff --git a/lib/services/websiteManagement2/lib/models/ipSecurityRestriction.js b/lib/services/websiteManagement2/lib/models/ipSecurityRestriction.js new file mode 100644 index 0000000000..7442dc0ebd --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/ipSecurityRestriction.js @@ -0,0 +1,108 @@ +/* + * 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'; + +/** + * IP security restriction on an app. + * + */ +class IpSecurityRestriction { + /** + * Create a IpSecurityRestriction. + * @member {string} ipAddress IP address the security restriction is valid + * for. + * It can be in form of pure ipv4 address (required SubnetMask property) or + * CIDR notation such as ipv4/mask (leading bit match). For CIDR, + * SubnetMask property must not be specified. + * @member {string} [subnetMask] Subnet mask for the range of IP addresses + * the restriction is valid for. + * @member {string} [action] Allow or Deny access for this IP range. + * @member {string} [tag] Defines what this IP filter will be used for. This + * is to support IP filtering on proxies. Possible values include: 'Default', + * 'XffProxy' + * @member {number} [priority] Priority of IP restriction rule. + * @member {string} [name] IP restriction rule name. + * @member {string} [description] IP restriction rule description. + */ + constructor() { + } + + /** + * Defines the metadata of IpSecurityRestriction + * + * @returns {object} metadata of IpSecurityRestriction + * + */ + mapper() { + return { + required: false, + serializedName: 'IpSecurityRestriction', + type: { + name: 'Composite', + className: 'IpSecurityRestriction', + modelProperties: { + ipAddress: { + required: true, + serializedName: 'ipAddress', + type: { + name: 'String' + } + }, + subnetMask: { + required: false, + serializedName: 'subnetMask', + type: { + name: 'String' + } + }, + action: { + required: false, + serializedName: 'action', + type: { + name: 'String' + } + }, + tag: { + required: false, + serializedName: 'tag', + type: { + name: 'Enum', + allowedValues: [ 'Default', 'XffProxy' ] + } + }, + priority: { + required: false, + serializedName: 'priority', + type: { + name: 'Number' + } + }, + name: { + required: false, + serializedName: 'name', + type: { + name: 'String' + } + }, + description: { + required: false, + serializedName: 'description', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = IpSecurityRestriction; diff --git a/lib/services/websiteManagement2/lib/models/managedServiceIdentity.js b/lib/services/websiteManagement2/lib/models/managedServiceIdentity.js new file mode 100644 index 0000000000..1729031497 --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/managedServiceIdentity.js @@ -0,0 +1,87 @@ +/* + * 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'; + +/** + * Managed service identity. + * + */ +class ManagedServiceIdentity { + /** + * Create a ManagedServiceIdentity. + * @member {string} [type] Type of managed service identity. Possible values + * include: 'SystemAssigned', 'UserAssigned' + * @member {string} [tenantId] Tenant of managed service identity. + * @member {string} [principalId] Principal Id of managed service identity. + * @member {array} [identityIds] Array of UserAssigned managed service + * identities. + */ + constructor() { + } + + /** + * Defines the metadata of ManagedServiceIdentity + * + * @returns {object} metadata of ManagedServiceIdentity + * + */ + mapper() { + return { + required: false, + serializedName: 'ManagedServiceIdentity', + type: { + name: 'Composite', + className: 'ManagedServiceIdentity', + modelProperties: { + type: { + required: false, + serializedName: 'type', + type: { + name: 'String' + } + }, + tenantId: { + required: false, + readOnly: true, + serializedName: 'tenantId', + type: { + name: 'String' + } + }, + principalId: { + required: false, + readOnly: true, + serializedName: 'principalId', + type: { + name: 'String' + } + }, + identityIds: { + required: false, + serializedName: 'identityIds', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + } + } + } + }; + } +} + +module.exports = ManagedServiceIdentity; diff --git a/lib/services/websiteManagement2/lib/models/metricDefinition.js b/lib/services/websiteManagement2/lib/models/metricDefinition.js new file mode 100644 index 0000000000..e42fa83b2a --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/metricDefinition.js @@ -0,0 +1,124 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Metadata for a metric. + * + * @extends models['ProxyOnlyResource'] + */ +class MetricDefinition extends models['ProxyOnlyResource'] { + /** + * Create a MetricDefinition. + * @member {string} [unit] Unit of the metric. + * @member {string} [primaryAggregationType] Primary aggregation type. + * @member {array} [metricAvailabilities] List of time grains supported for + * the metric together with retention period. + * @member {string} [displayName] Friendly name shown in the UI. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of MetricDefinition + * + * @returns {object} metadata of MetricDefinition + * + */ + mapper() { + return { + required: false, + serializedName: 'MetricDefinition', + type: { + name: 'Composite', + className: 'MetricDefinition', + 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' + } + }, + unit: { + required: false, + readOnly: true, + serializedName: 'properties.unit', + type: { + name: 'String' + } + }, + primaryAggregationType: { + required: false, + readOnly: true, + serializedName: 'properties.primaryAggregationType', + type: { + name: 'String' + } + }, + metricAvailabilities: { + required: false, + readOnly: true, + serializedName: 'properties.metricAvailabilities', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'MetricAvailabililyElementType', + type: { + name: 'Composite', + className: 'MetricAvailabilily' + } + } + } + }, + displayName: { + required: false, + readOnly: true, + serializedName: 'properties.displayName', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = MetricDefinition; diff --git a/lib/services/websiteManagement2/lib/models/metricSpecification.js b/lib/services/websiteManagement2/lib/models/metricSpecification.js index f181fc189b..354439107c 100644 --- a/lib/services/websiteManagement2/lib/models/metricSpecification.js +++ b/lib/services/websiteManagement2/lib/models/metricSpecification.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * Definition of a single resource metric. * diff --git a/lib/services/websiteManagement2/lib/models/operation.js b/lib/services/websiteManagement2/lib/models/operation.js index 4a24b281f8..a48c392107 100644 --- a/lib/services/websiteManagement2/lib/models/operation.js +++ b/lib/services/websiteManagement2/lib/models/operation.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * An operation on a resource. * diff --git a/lib/services/websiteManagement2/lib/models/perfMonResponse.js b/lib/services/websiteManagement2/lib/models/perfMonResponse.js index a4badd3919..6eb5b04ffa 100644 --- a/lib/services/websiteManagement2/lib/models/perfMonResponse.js +++ b/lib/services/websiteManagement2/lib/models/perfMonResponse.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * Performance monitor API response. * diff --git a/lib/services/websiteManagement2/lib/models/perfMonSample.js b/lib/services/websiteManagement2/lib/models/perfMonSample.js new file mode 100644 index 0000000000..e88148d9b9 --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/perfMonSample.js @@ -0,0 +1,69 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Performance monitor sample in a set. + * + */ +class PerfMonSample { + /** + * Create a PerfMonSample. + * @member {date} [time] Point in time for which counter was measured. + * @member {string} [instanceName] Name of the server on which the + * measurement is made. + * @member {number} [value] Value of counter at a certain time. + */ + constructor() { + } + + /** + * Defines the metadata of PerfMonSample + * + * @returns {object} metadata of PerfMonSample + * + */ + mapper() { + return { + required: false, + serializedName: 'PerfMonSample', + type: { + name: 'Composite', + className: 'PerfMonSample', + modelProperties: { + time: { + required: false, + serializedName: 'time', + type: { + name: 'DateTime' + } + }, + instanceName: { + required: false, + serializedName: 'instanceName', + type: { + name: 'String' + } + }, + value: { + required: false, + serializedName: 'value', + type: { + name: 'Number' + } + } + } + } + }; + } +} + +module.exports = PerfMonSample; diff --git a/lib/services/websiteManagement2/lib/models/perfMonSet.js b/lib/services/websiteManagement2/lib/models/perfMonSet.js index 8a24e0d373..28beb00fd0 100644 --- a/lib/services/websiteManagement2/lib/models/perfMonSet.js +++ b/lib/services/websiteManagement2/lib/models/perfMonSet.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * Metric information. * diff --git a/lib/services/websiteManagement2/lib/models/premierAddOn.js b/lib/services/websiteManagement2/lib/models/premierAddOn.js new file mode 100644 index 0000000000..c0db87d43b --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/premierAddOn.js @@ -0,0 +1,141 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Premier add-on. + * + * @extends models['Resource'] + */ +class PremierAddOn extends models['Resource'] { + /** + * Create a PremierAddOn. + * @member {string} [sku] Premier add on SKU. + * @member {string} [product] Premier add on Product. + * @member {string} [vendor] Premier add on Vendor. + * @member {string} [marketplacePublisher] Premier add on Marketplace + * publisher. + * @member {string} [marketplaceOffer] Premier add on Marketplace offer. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of PremierAddOn + * + * @returns {object} metadata of PremierAddOn + * + */ + mapper() { + return { + required: false, + serializedName: 'PremierAddOn', + type: { + name: 'Composite', + className: 'PremierAddOn', + 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' + } + }, + location: { + required: true, + serializedName: 'location', + type: { + name: 'String' + } + }, + type: { + required: false, + readOnly: true, + serializedName: 'type', + type: { + name: 'String' + } + }, + tags: { + required: false, + serializedName: 'tags', + type: { + name: 'Dictionary', + value: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + sku: { + required: false, + serializedName: 'properties.sku', + type: { + name: 'String' + } + }, + product: { + required: false, + serializedName: 'properties.product', + type: { + name: 'String' + } + }, + vendor: { + required: false, + serializedName: 'properties.vendor', + type: { + name: 'String' + } + }, + marketplacePublisher: { + required: false, + serializedName: 'properties.marketplacePublisher', + type: { + name: 'String' + } + }, + marketplaceOffer: { + required: false, + serializedName: 'properties.marketplaceOffer', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = PremierAddOn; diff --git a/lib/services/websiteManagement2/lib/models/premierAddOnOffer.js b/lib/services/websiteManagement2/lib/models/premierAddOnOffer.js new file mode 100644 index 0000000000..919328a6d8 --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/premierAddOnOffer.js @@ -0,0 +1,163 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Premier add-on offer. + * + * @extends models['ProxyOnlyResource'] + */ +class PremierAddOnOffer extends models['ProxyOnlyResource'] { + /** + * Create a PremierAddOnOffer. + * @member {string} [sku] Premier add on SKU. + * @member {string} [product] Premier add on offer Product. + * @member {string} [vendor] Premier add on offer Vendor. + * @member {boolean} [promoCodeRequired] true if promotion code + * is required; otherwise, false. + * @member {number} [quota] Premier add on offer Quota. + * @member {string} [webHostingPlanRestrictions] App Service plans this offer + * is restricted to. Possible values include: 'None', 'Free', 'Shared', + * 'Basic', 'Standard', 'Premium' + * @member {string} [privacyPolicyUrl] Privacy policy URL. + * @member {string} [legalTermsUrl] Legal terms URL. + * @member {string} [marketplacePublisher] Marketplace publisher. + * @member {string} [marketplaceOffer] Marketplace offer. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of PremierAddOnOffer + * + * @returns {object} metadata of PremierAddOnOffer + * + */ + mapper() { + return { + required: false, + serializedName: 'PremierAddOnOffer', + type: { + name: 'Composite', + className: 'PremierAddOnOffer', + 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' + } + }, + sku: { + required: false, + serializedName: 'properties.sku', + type: { + name: 'String' + } + }, + product: { + required: false, + serializedName: 'properties.product', + type: { + name: 'String' + } + }, + vendor: { + required: false, + serializedName: 'properties.vendor', + type: { + name: 'String' + } + }, + promoCodeRequired: { + required: false, + serializedName: 'properties.promoCodeRequired', + type: { + name: 'Boolean' + } + }, + quota: { + required: false, + serializedName: 'properties.quota', + type: { + name: 'Number' + } + }, + webHostingPlanRestrictions: { + required: false, + serializedName: 'properties.webHostingPlanRestrictions', + type: { + name: 'Enum', + allowedValues: [ 'None', 'Free', 'Shared', 'Basic', 'Standard', 'Premium' ] + } + }, + privacyPolicyUrl: { + required: false, + serializedName: 'properties.privacyPolicyUrl', + type: { + name: 'String' + } + }, + legalTermsUrl: { + required: false, + serializedName: 'properties.legalTermsUrl', + type: { + name: 'String' + } + }, + marketplacePublisher: { + required: false, + serializedName: 'properties.marketplacePublisher', + type: { + name: 'String' + } + }, + marketplaceOffer: { + required: false, + serializedName: 'properties.marketplaceOffer', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = PremierAddOnOffer; diff --git a/lib/services/websiteManagement2/lib/models/privateAccessVirtualNetwork.js b/lib/services/websiteManagement2/lib/models/privateAccessVirtualNetwork.js index 635dd40054..d3b7f3161f 100644 --- a/lib/services/websiteManagement2/lib/models/privateAccessVirtualNetwork.js +++ b/lib/services/websiteManagement2/lib/models/privateAccessVirtualNetwork.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * Description of a Virtual Network that is useable for private site access. * diff --git a/lib/services/websiteManagement2/lib/models/processInfo.js b/lib/services/websiteManagement2/lib/models/processInfo.js new file mode 100644 index 0000000000..1fc4d90c98 --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/processInfo.js @@ -0,0 +1,406 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Process Information. + * + * @extends models['ProxyOnlyResource'] + */ +class ProcessInfo extends models['ProxyOnlyResource'] { + /** + * Create a ProcessInfo. + * @member {number} [identifier] ARM Identifier for deployment. + * @member {string} [deploymentName] Deployment name. + * @member {string} [href] HRef URI. + * @member {string} [minidump] Minidump URI. + * @member {boolean} [isProfileRunning] Is profile running? + * @member {boolean} [isIisProfileRunning] Is the IIS Profile running? + * @member {number} [iisProfileTimeoutInSeconds] IIS Profile timeout + * (seconds). + * @member {string} [parent] Parent process. + * @member {array} [children] Child process list. + * @member {array} [threads] Thread list. + * @member {array} [openFileHandles] List of open files. + * @member {array} [modules] List of modules. + * @member {string} [fileName] File name of this process. + * @member {string} [commandLine] Command line. + * @member {string} [userName] User name. + * @member {number} [handleCount] Handle count. + * @member {number} [moduleCount] Module count. + * @member {number} [threadCount] Thread count. + * @member {date} [startTime] Start time. + * @member {string} [totalCpuTime] Total CPU time. + * @member {string} [userCpuTime] User CPU time. + * @member {string} [privilegedCpuTime] Privileged CPU time. + * @member {number} [workingSet] Working set. + * @member {number} [peakWorkingSet] Peak working set. + * @member {number} [privateMemory] Private memory size. + * @member {number} [virtualMemory] Virtual memory size. + * @member {number} [peakVirtualMemory] Peak virtual memory usage. + * @member {number} [pagedSystemMemory] Paged system memory. + * @member {number} [nonPagedSystemMemory] Non-paged system memory. + * @member {number} [pagedMemory] Paged memory. + * @member {number} [peakPagedMemory] Peak paged memory. + * @member {date} [timeStamp] Time stamp. + * @member {object} [environmentVariables] List of environment variables. + * @member {boolean} [isScmSite] Is this the SCM site? + * @member {boolean} [isWebjob] Is this a Web Job? + * @member {string} [description] Description of process. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of ProcessInfo + * + * @returns {object} metadata of ProcessInfo + * + */ + mapper() { + return { + required: false, + serializedName: 'ProcessInfo', + type: { + name: 'Composite', + className: 'ProcessInfo', + 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' + } + }, + identifier: { + required: false, + readOnly: true, + serializedName: 'properties.identifier', + type: { + name: 'Number' + } + }, + deploymentName: { + required: false, + serializedName: 'properties.deployment_name', + type: { + name: 'String' + } + }, + href: { + required: false, + serializedName: 'properties.href', + type: { + name: 'String' + } + }, + minidump: { + required: false, + serializedName: 'properties.minidump', + type: { + name: 'String' + } + }, + isProfileRunning: { + required: false, + serializedName: 'properties.is_profile_running', + type: { + name: 'Boolean' + } + }, + isIisProfileRunning: { + required: false, + serializedName: 'properties.is_iis_profile_running', + type: { + name: 'Boolean' + } + }, + iisProfileTimeoutInSeconds: { + required: false, + serializedName: 'properties.iis_profile_timeout_in_seconds', + type: { + name: 'Number' + } + }, + parent: { + required: false, + serializedName: 'properties.parent', + type: { + name: 'String' + } + }, + children: { + required: false, + serializedName: 'properties.children', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + threads: { + required: false, + serializedName: 'properties.threads', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ProcessThreadInfoElementType', + type: { + name: 'Composite', + className: 'ProcessThreadInfo' + } + } + } + }, + openFileHandles: { + required: false, + serializedName: 'properties.open_file_handles', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + modules: { + required: false, + serializedName: 'properties.modules', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ProcessModuleInfoElementType', + type: { + name: 'Composite', + className: 'ProcessModuleInfo' + } + } + } + }, + fileName: { + required: false, + serializedName: 'properties.file_name', + type: { + name: 'String' + } + }, + commandLine: { + required: false, + serializedName: 'properties.command_line', + type: { + name: 'String' + } + }, + userName: { + required: false, + serializedName: 'properties.user_name', + type: { + name: 'String' + } + }, + handleCount: { + required: false, + serializedName: 'properties.handle_count', + type: { + name: 'Number' + } + }, + moduleCount: { + required: false, + serializedName: 'properties.module_count', + type: { + name: 'Number' + } + }, + threadCount: { + required: false, + serializedName: 'properties.thread_count', + type: { + name: 'Number' + } + }, + startTime: { + required: false, + serializedName: 'properties.start_time', + type: { + name: 'DateTime' + } + }, + totalCpuTime: { + required: false, + serializedName: 'properties.total_cpu_time', + type: { + name: 'String' + } + }, + userCpuTime: { + required: false, + serializedName: 'properties.user_cpu_time', + type: { + name: 'String' + } + }, + privilegedCpuTime: { + required: false, + serializedName: 'properties.privileged_cpu_time', + type: { + name: 'String' + } + }, + workingSet: { + required: false, + serializedName: 'properties.working_set', + type: { + name: 'Number' + } + }, + peakWorkingSet: { + required: false, + serializedName: 'properties.peak_working_set', + type: { + name: 'Number' + } + }, + privateMemory: { + required: false, + serializedName: 'properties.private_memory', + type: { + name: 'Number' + } + }, + virtualMemory: { + required: false, + serializedName: 'properties.virtual_memory', + type: { + name: 'Number' + } + }, + peakVirtualMemory: { + required: false, + serializedName: 'properties.peak_virtual_memory', + type: { + name: 'Number' + } + }, + pagedSystemMemory: { + required: false, + serializedName: 'properties.paged_system_memory', + type: { + name: 'Number' + } + }, + nonPagedSystemMemory: { + required: false, + serializedName: 'properties.non_paged_system_memory', + type: { + name: 'Number' + } + }, + pagedMemory: { + required: false, + serializedName: 'properties.paged_memory', + type: { + name: 'Number' + } + }, + peakPagedMemory: { + required: false, + serializedName: 'properties.peak_paged_memory', + type: { + name: 'Number' + } + }, + timeStamp: { + required: false, + serializedName: 'properties.time_stamp', + type: { + name: 'DateTime' + } + }, + environmentVariables: { + required: false, + serializedName: 'properties.environment_variables', + type: { + name: 'Dictionary', + value: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + isScmSite: { + required: false, + serializedName: 'properties.is_scm_site', + type: { + name: 'Boolean' + } + }, + isWebjob: { + required: false, + serializedName: 'properties.is_webjob', + type: { + name: 'Boolean' + } + }, + description: { + required: false, + serializedName: 'properties.description', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ProcessInfo; diff --git a/lib/services/websiteManagement2/lib/models/processModuleInfo.js b/lib/services/websiteManagement2/lib/models/processModuleInfo.js new file mode 100644 index 0000000000..610d4bf843 --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/processModuleInfo.js @@ -0,0 +1,168 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Process Module Information. + * + * @extends models['ProxyOnlyResource'] + */ +class ProcessModuleInfo extends models['ProxyOnlyResource'] { + /** + * Create a ProcessModuleInfo. + * @member {string} [baseAddress] Base address. Used as module identifier in + * ARM resource URI. + * @member {string} [fileName] File name. + * @member {string} [href] HRef URI. + * @member {string} [filePath] File path. + * @member {number} [moduleMemorySize] Module memory size. + * @member {string} [fileVersion] File version. + * @member {string} [fileDescription] File description. + * @member {string} [product] Product name. + * @member {string} [productVersion] Product version. + * @member {boolean} [isDebug] Is debug? + * @member {string} [language] Module language (locale). + */ + constructor() { + super(); + } + + /** + * Defines the metadata of ProcessModuleInfo + * + * @returns {object} metadata of ProcessModuleInfo + * + */ + mapper() { + return { + required: false, + serializedName: 'ProcessModuleInfo', + type: { + name: 'Composite', + className: 'ProcessModuleInfo', + 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' + } + }, + baseAddress: { + required: false, + serializedName: 'properties.base_address', + type: { + name: 'String' + } + }, + fileName: { + required: false, + serializedName: 'properties.file_name', + type: { + name: 'String' + } + }, + href: { + required: false, + serializedName: 'properties.href', + type: { + name: 'String' + } + }, + filePath: { + required: false, + serializedName: 'properties.file_path', + type: { + name: 'String' + } + }, + moduleMemorySize: { + required: false, + serializedName: 'properties.module_memory_size', + type: { + name: 'Number' + } + }, + fileVersion: { + required: false, + serializedName: 'properties.file_version', + type: { + name: 'String' + } + }, + fileDescription: { + required: false, + serializedName: 'properties.file_description', + type: { + name: 'String' + } + }, + product: { + required: false, + serializedName: 'properties.product', + type: { + name: 'String' + } + }, + productVersion: { + required: false, + serializedName: 'properties.product_version', + type: { + name: 'String' + } + }, + isDebug: { + required: false, + serializedName: 'properties.is_debug', + type: { + name: 'Boolean' + } + }, + language: { + required: false, + serializedName: 'properties.language', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ProcessModuleInfo; diff --git a/lib/services/websiteManagement2/lib/models/processThreadInfo.js b/lib/services/websiteManagement2/lib/models/processThreadInfo.js new file mode 100644 index 0000000000..3594604e66 --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/processThreadInfo.js @@ -0,0 +1,184 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Process Thread Information. + * + * @extends models['ProxyOnlyResource'] + */ +class ProcessThreadInfo extends models['ProxyOnlyResource'] { + /** + * Create a ProcessThreadInfo. + * @member {number} [identifier] Site extension ID. + * @member {string} [href] HRef URI. + * @member {string} [process] Process URI. + * @member {string} [startAddress] Start address. + * @member {number} [currentPriority] Current thread priority. + * @member {string} [priorityLevel] Thread priority level. + * @member {number} [basePriority] Base priority. + * @member {date} [startTime] Start time. + * @member {string} [totalProcessorTime] Total processor time. + * @member {string} [userProcessorTime] User processor time. + * @member {string} [priviledgedProcessorTime] Priviledged processor time. + * @member {string} [state] Thread state. + * @member {string} [waitReason] Wait reason. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of ProcessThreadInfo + * + * @returns {object} metadata of ProcessThreadInfo + * + */ + mapper() { + return { + required: false, + serializedName: 'ProcessThreadInfo', + type: { + name: 'Composite', + className: 'ProcessThreadInfo', + 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' + } + }, + identifier: { + required: false, + readOnly: true, + serializedName: 'properties.identifier', + type: { + name: 'Number' + } + }, + href: { + required: false, + serializedName: 'properties.href', + type: { + name: 'String' + } + }, + process: { + required: false, + serializedName: 'properties.process', + type: { + name: 'String' + } + }, + startAddress: { + required: false, + serializedName: 'properties.start_address', + type: { + name: 'String' + } + }, + currentPriority: { + required: false, + serializedName: 'properties.current_priority', + type: { + name: 'Number' + } + }, + priorityLevel: { + required: false, + serializedName: 'properties.priority_level', + type: { + name: 'String' + } + }, + basePriority: { + required: false, + serializedName: 'properties.base_priority', + type: { + name: 'Number' + } + }, + startTime: { + required: false, + serializedName: 'properties.start_time', + type: { + name: 'DateTime' + } + }, + totalProcessorTime: { + required: false, + serializedName: 'properties.total_processor_time', + type: { + name: 'String' + } + }, + userProcessorTime: { + required: false, + serializedName: 'properties.user_processor_time', + type: { + name: 'String' + } + }, + priviledgedProcessorTime: { + required: false, + serializedName: 'properties.priviledged_processor_time', + type: { + name: 'String' + } + }, + state: { + required: false, + serializedName: 'properties.state', + type: { + name: 'String' + } + }, + waitReason: { + required: false, + serializedName: 'properties.wait_reason', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ProcessThreadInfo; diff --git a/lib/services/websiteManagement2/lib/models/recommendation.js b/lib/services/websiteManagement2/lib/models/recommendation.js new file mode 100644 index 0000000000..8f61433673 --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/recommendation.js @@ -0,0 +1,300 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Represents a recommendation result generated by the recommendation engine. + * + * @extends models['ProxyOnlyResource'] + */ +class Recommendation extends models['ProxyOnlyResource'] { + /** + * Create a Recommendation. + * @member {date} [creationTime] Timestamp when this instance was created. + * @member {uuid} [recommendationId] A GUID value that each recommendation + * object is associated with. + * @member {string} [resourceId] Full ARM resource ID string that this + * recommendation object is associated with. + * @member {string} [resourceScope] Name of a resource type this + * recommendation applies, e.g. Subscription, ServerFarm, Site. Possible + * values include: 'ServerFarm', 'Subscription', 'WebSite' + * @member {string} [ruleName] Unique name of the rule. + * @member {string} [displayName] UI friendly name of the rule (may not be + * unique). + * @member {string} [message] Recommendation text. + * @member {string} [level] Level indicating how critical this recommendation + * can impact. Possible values include: 'Critical', 'Warning', 'Information', + * 'NonUrgentSuggestion' + * @member {string} [channels] List of channels that this recommendation can + * apply. Possible values include: 'Notification', 'Api', 'Email', 'Webhook', + * 'All' + * @member {array} [categoryTags] The list of category tags that this + * recommendation belongs to. + * @member {string} [actionName] Name of action recommended by this object. + * @member {number} [enabled] True if this recommendation is still valid + * (i.e. "actionable"). False if it is invalid. + * @member {array} [states] The list of states of this recommendation. If + * it's null then it shoud be considered "Active". + * @member {date} [startTime] The beginning time in UTC of a range that the + * recommendation refers to. + * @member {date} [endTime] The end time in UTC of a range that the + * recommendation refers to. + * @member {date} [nextNotificationTime] When to notify this recommendation + * next in UTC. Null means that this will never be notified anymore. + * @member {date} [notificationExpirationTime] Date and time in UTC when this + * notification expires. + * @member {date} [notifiedTime] Last timestamp in UTC this instance was + * actually notified. Null means that this recommendation hasn't been + * notified yet. + * @member {number} [score] A metric value measured by the rule. + * @member {boolean} [isDynamic] True if this is associated with a + * dynamically added rule + * @member {string} [extensionName] Extension name of the portal if exists. + * @member {string} [bladeName] Deep link to a blade on the portal. + * @member {string} [forwardLink] Forward link to an external document + * associated with the rule. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of Recommendation + * + * @returns {object} metadata of Recommendation + * + */ + mapper() { + return { + required: false, + serializedName: 'Recommendation', + type: { + name: 'Composite', + className: 'Recommendation', + 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' + } + }, + creationTime: { + required: false, + serializedName: 'properties.creationTime', + type: { + name: 'DateTime' + } + }, + recommendationId: { + required: false, + serializedName: 'properties.recommendationId', + type: { + name: 'String' + } + }, + resourceId: { + required: false, + serializedName: 'properties.resourceId', + type: { + name: 'String' + } + }, + resourceScope: { + required: false, + serializedName: 'properties.resourceScope', + type: { + name: 'String' + } + }, + ruleName: { + required: false, + serializedName: 'properties.ruleName', + type: { + name: 'String' + } + }, + displayName: { + required: false, + serializedName: 'properties.displayName', + type: { + name: 'String' + } + }, + message: { + required: false, + serializedName: 'properties.message', + type: { + name: 'String' + } + }, + level: { + required: false, + serializedName: 'properties.level', + type: { + name: 'Enum', + allowedValues: [ 'Critical', 'Warning', 'Information', 'NonUrgentSuggestion' ] + } + }, + channels: { + required: false, + serializedName: 'properties.channels', + type: { + name: 'Enum', + allowedValues: [ 'Notification', 'Api', 'Email', 'Webhook', 'All' ] + } + }, + categoryTags: { + required: false, + readOnly: true, + serializedName: 'properties.categoryTags', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + actionName: { + required: false, + serializedName: 'properties.actionName', + type: { + name: 'String' + } + }, + enabled: { + required: false, + serializedName: 'properties.enabled', + type: { + name: 'Number' + } + }, + states: { + required: false, + serializedName: 'properties.states', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + startTime: { + required: false, + serializedName: 'properties.startTime', + type: { + name: 'DateTime' + } + }, + endTime: { + required: false, + serializedName: 'properties.endTime', + type: { + name: 'DateTime' + } + }, + nextNotificationTime: { + required: false, + serializedName: 'properties.nextNotificationTime', + type: { + name: 'DateTime' + } + }, + notificationExpirationTime: { + required: false, + serializedName: 'properties.notificationExpirationTime', + type: { + name: 'DateTime' + } + }, + notifiedTime: { + required: false, + serializedName: 'properties.notifiedTime', + type: { + name: 'DateTime' + } + }, + score: { + required: false, + serializedName: 'properties.score', + type: { + name: 'Number' + } + }, + isDynamic: { + required: false, + serializedName: 'properties.isDynamic', + type: { + name: 'Boolean' + } + }, + extensionName: { + required: false, + serializedName: 'properties.extensionName', + type: { + name: 'String' + } + }, + bladeName: { + required: false, + serializedName: 'properties.bladeName', + type: { + name: 'String' + } + }, + forwardLink: { + required: false, + serializedName: 'properties.forwardLink', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = Recommendation; diff --git a/lib/services/websiteManagement2/lib/models/recommendationRule.js b/lib/services/websiteManagement2/lib/models/recommendationRule.js new file mode 100644 index 0000000000..98fedcaa74 --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/recommendationRule.js @@ -0,0 +1,205 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Represents a recommendation rule that the recommendation engine can perform. + * + * @extends models['ProxyOnlyResource'] + */ +class RecommendationRule extends models['ProxyOnlyResource'] { + /** + * Create a RecommendationRule. + * @member {string} [recommendationName] Unique name of the rule. + * @member {string} [displayName] UI friendly name of the rule. + * @member {string} [message] Localized name of the rule (Good for UI). + * @member {uuid} [recommendationId] Recommendation ID of an associated + * recommendation object tied to the rule, if exists. + * If such an object doesn't exist, it is set to null. + * @member {string} [description] Localized detailed description of the rule. + * @member {string} [actionName] Name of action that is recommended by this + * rule in string. + * @member {string} [level] Level of impact indicating how critical this rule + * is. Possible values include: 'Critical', 'Warning', 'Information', + * 'NonUrgentSuggestion' + * @member {string} [channels] List of available channels that this rule + * applies. Possible values include: 'Notification', 'Api', 'Email', + * 'Webhook', 'All' + * @member {array} [categoryTags] The list of category tags that this + * recommendation rule belongs to. + * @member {boolean} [isDynamic] True if this is associated with a + * dynamically added rule + * @member {string} [extensionName] Extension name of the portal if exists. + * Applicable to dynamic rule only. + * @member {string} [bladeName] Deep link to a blade on the portal. + * Applicable to dynamic rule only. + * @member {string} [forwardLink] Forward link to an external document + * associated with the rule. Applicable to dynamic rule only. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of RecommendationRule + * + * @returns {object} metadata of RecommendationRule + * + */ + mapper() { + return { + required: false, + serializedName: 'RecommendationRule', + type: { + name: 'Composite', + className: 'RecommendationRule', + 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' + } + }, + recommendationName: { + required: false, + serializedName: 'properties.recommendationName', + type: { + name: 'String' + } + }, + displayName: { + required: false, + serializedName: 'properties.displayName', + type: { + name: 'String' + } + }, + message: { + required: false, + serializedName: 'properties.message', + type: { + name: 'String' + } + }, + recommendationId: { + required: false, + serializedName: 'properties.recommendationId', + type: { + name: 'String' + } + }, + description: { + required: false, + serializedName: 'properties.description', + type: { + name: 'String' + } + }, + actionName: { + required: false, + serializedName: 'properties.actionName', + type: { + name: 'String' + } + }, + level: { + required: false, + serializedName: 'properties.level', + type: { + name: 'Enum', + allowedValues: [ 'Critical', 'Warning', 'Information', 'NonUrgentSuggestion' ] + } + }, + channels: { + required: false, + serializedName: 'properties.channels', + type: { + name: 'Enum', + allowedValues: [ 'Notification', 'Api', 'Email', 'Webhook', 'All' ] + } + }, + categoryTags: { + required: false, + readOnly: true, + serializedName: 'properties.categoryTags', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + isDynamic: { + required: false, + serializedName: 'properties.isDynamic', + type: { + name: 'Boolean' + } + }, + extensionName: { + required: false, + serializedName: 'properties.extensionName', + type: { + name: 'String' + } + }, + bladeName: { + required: false, + serializedName: 'properties.bladeName', + type: { + name: 'String' + } + }, + forwardLink: { + required: false, + serializedName: 'properties.forwardLink', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = RecommendationRule; diff --git a/lib/services/websiteManagement2/lib/models/resourceHealthMetadata.js b/lib/services/websiteManagement2/lib/models/resourceHealthMetadata.js new file mode 100644 index 0000000000..7c8d1c457d --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/resourceHealthMetadata.js @@ -0,0 +1,97 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Used for getting ResourceHealthCheck settings. + * + * @extends models['ProxyOnlyResource'] + */ +class ResourceHealthMetadata extends models['ProxyOnlyResource'] { + /** + * Create a ResourceHealthMetadata. + * @member {string} [category] The category that the resource matches in the + * RHC Policy File + * @member {boolean} [signalAvailability] Is there a health signal for the + * resource + */ + constructor() { + super(); + } + + /** + * Defines the metadata of ResourceHealthMetadata + * + * @returns {object} metadata of ResourceHealthMetadata + * + */ + mapper() { + return { + required: false, + serializedName: 'ResourceHealthMetadata', + type: { + name: 'Composite', + className: 'ResourceHealthMetadata', + 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' + } + }, + category: { + required: false, + serializedName: 'properties.category', + type: { + name: 'String' + } + }, + signalAvailability: { + required: false, + serializedName: 'properties.signalAvailability', + type: { + name: 'Boolean' + } + } + } + } + }; + } +} + +module.exports = ResourceHealthMetadata; diff --git a/lib/services/websiteManagement2/lib/models/resourceHealthMetadataCollection.js b/lib/services/websiteManagement2/lib/models/resourceHealthMetadataCollection.js new file mode 100644 index 0000000000..b4be12e889 --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/resourceHealthMetadataCollection.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 resource health metadata. + */ +class ResourceHealthMetadataCollection extends Array { + /** + * Create a ResourceHealthMetadataCollection. + * @member {string} [nextLink] Link to next page of resources. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of ResourceHealthMetadataCollection + * + * @returns {object} metadata of ResourceHealthMetadataCollection + * + */ + mapper() { + return { + required: false, + serializedName: 'ResourceHealthMetadataCollection', + type: { + name: 'Composite', + className: 'ResourceHealthMetadataCollection', + modelProperties: { + value: { + required: true, + serializedName: '', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ResourceHealthMetadataElementType', + type: { + name: 'Composite', + className: 'ResourceHealthMetadata' + } + } + } + }, + nextLink: { + required: false, + readOnly: true, + serializedName: 'nextLink', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ResourceHealthMetadataCollection; diff --git a/lib/services/websiteManagement2/lib/models/resourceMetric.js b/lib/services/websiteManagement2/lib/models/resourceMetric.js index bc89c6dc3d..5ae05578bc 100644 --- a/lib/services/websiteManagement2/lib/models/resourceMetric.js +++ b/lib/services/websiteManagement2/lib/models/resourceMetric.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * Object representing a metric for any resource . * diff --git a/lib/services/websiteManagement2/lib/models/resourceMetricDefinition.js b/lib/services/websiteManagement2/lib/models/resourceMetricDefinition.js new file mode 100644 index 0000000000..8dbe89e1bf --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/resourceMetricDefinition.js @@ -0,0 +1,140 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Metadata for the metrics. + * + * @extends models['ProxyOnlyResource'] + */ +class ResourceMetricDefinition extends models['ProxyOnlyResource'] { + /** + * Create a ResourceMetricDefinition. + * @member {string} [unit] Unit of the metric. + * @member {string} [primaryAggregationType] Primary aggregation type. + * @member {array} [metricAvailabilities] List of time grains supported for + * the metric together with retention period. + * @member {string} [resourceUri] Resource URI. + * @member {object} [properties] Resource metric definition properties. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of ResourceMetricDefinition + * + * @returns {object} metadata of ResourceMetricDefinition + * + */ + mapper() { + return { + required: false, + serializedName: 'ResourceMetricDefinition', + type: { + name: 'Composite', + className: 'ResourceMetricDefinition', + 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' + } + }, + unit: { + required: false, + readOnly: true, + serializedName: 'properties.unit', + type: { + name: 'String' + } + }, + primaryAggregationType: { + required: false, + readOnly: true, + serializedName: 'properties.primaryAggregationType', + type: { + name: 'String' + } + }, + metricAvailabilities: { + required: false, + readOnly: true, + serializedName: 'properties.metricAvailabilities', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ResourceMetricAvailabilityElementType', + type: { + name: 'Composite', + className: 'ResourceMetricAvailability' + } + } + } + }, + resourceUri: { + required: false, + readOnly: true, + serializedName: 'properties.resourceUri', + type: { + name: 'String' + } + }, + properties: { + required: false, + readOnly: true, + serializedName: 'properties.properties', + type: { + name: 'Dictionary', + value: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + } + } + } + }; + } +} + +module.exports = ResourceMetricDefinition; diff --git a/lib/services/websiteManagement2/lib/models/resourceMetricValue.js b/lib/services/websiteManagement2/lib/models/resourceMetricValue.js index 6bc292af85..83e20dd398 100644 --- a/lib/services/websiteManagement2/lib/models/resourceMetricValue.js +++ b/lib/services/websiteManagement2/lib/models/resourceMetricValue.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * Value of resource metric. * diff --git a/lib/services/websiteManagement2/lib/models/responseMetaData.js b/lib/services/websiteManagement2/lib/models/responseMetaData.js index 1887a5d84a..9215d9bd53 100644 --- a/lib/services/websiteManagement2/lib/models/responseMetaData.js +++ b/lib/services/websiteManagement2/lib/models/responseMetaData.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * Class representing a ResponseMetaData. */ diff --git a/lib/services/websiteManagement2/lib/models/restoreRequest.js b/lib/services/websiteManagement2/lib/models/restoreRequest.js new file mode 100644 index 0000000000..7ae8aa728c --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/restoreRequest.js @@ -0,0 +1,194 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Description of a restore request. + * + * @extends models['ProxyOnlyResource'] + */ +class RestoreRequest extends models['ProxyOnlyResource'] { + /** + * Create a RestoreRequest. + * @member {string} storageAccountUrl SAS URL to the container. + * @member {string} [blobName] Name of a blob which contains the backup. + * @member {boolean} overwrite true if the restore operation can + * overwrite target app; otherwise, false. true is + * needed if trying to restore over an existing app. + * @member {string} [siteName] Name of an app. + * @member {array} [databases] Collection of databases which should be + * restored. This list has to match the list of databases included in the + * backup. + * @member {boolean} [ignoreConflictingHostNames] Changes a logic when + * restoring an app with custom domains. true to remove custom + * domains automatically. If false, custom domains are added to + * the app's object when it is being restored, but that might fail due to + * conflicts during the operation. Default value: false . + * @member {boolean} [ignoreDatabases] Ignore the databases and only restore + * the site content. Default value: false . + * @member {string} [appServicePlan] Specify app service plan that will own + * restored site. + * @member {string} [operationType] Operation type. Possible values include: + * 'Default', 'Clone', 'Relocation', 'Snapshot', 'CloudFS'. Default value: + * 'Default' . + * @member {boolean} [adjustConnectionStrings] true if + * SiteConfig.ConnectionStrings should be set in new app; otherwise, + * false. + * @member {string} [hostingEnvironment] App Service Environment name, if + * needed (only when restoring an app to an App Service Environment). + */ + constructor() { + super(); + } + + /** + * Defines the metadata of RestoreRequest + * + * @returns {object} metadata of RestoreRequest + * + */ + mapper() { + return { + required: false, + serializedName: 'RestoreRequest', + type: { + name: 'Composite', + className: 'RestoreRequest', + 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' + } + }, + storageAccountUrl: { + required: true, + serializedName: 'properties.storageAccountUrl', + type: { + name: 'String' + } + }, + blobName: { + required: false, + serializedName: 'properties.blobName', + type: { + name: 'String' + } + }, + overwrite: { + required: true, + serializedName: 'properties.overwrite', + type: { + name: 'Boolean' + } + }, + siteName: { + required: false, + serializedName: 'properties.siteName', + type: { + name: 'String' + } + }, + databases: { + required: false, + serializedName: 'properties.databases', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'DatabaseBackupSettingElementType', + type: { + name: 'Composite', + className: 'DatabaseBackupSetting' + } + } + } + }, + ignoreConflictingHostNames: { + required: false, + serializedName: 'properties.ignoreConflictingHostNames', + defaultValue: false, + type: { + name: 'Boolean' + } + }, + ignoreDatabases: { + required: false, + serializedName: 'properties.ignoreDatabases', + defaultValue: false, + type: { + name: 'Boolean' + } + }, + appServicePlan: { + required: false, + serializedName: 'properties.appServicePlan', + type: { + name: 'String' + } + }, + operationType: { + required: false, + serializedName: 'properties.operationType', + defaultValue: 'Default', + type: { + name: 'Enum', + allowedValues: [ 'Default', 'Clone', 'Relocation', 'Snapshot', 'CloudFS' ] + } + }, + adjustConnectionStrings: { + required: false, + serializedName: 'properties.adjustConnectionStrings', + type: { + name: 'Boolean' + } + }, + hostingEnvironment: { + required: false, + serializedName: 'properties.hostingEnvironment', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = RestoreRequest; diff --git a/lib/services/websiteManagement2/lib/models/serviceSpecification.js b/lib/services/websiteManagement2/lib/models/serviceSpecification.js new file mode 100644 index 0000000000..8473a1eaa6 --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/serviceSpecification.js @@ -0,0 +1,76 @@ +/* + * 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'; + +/** + * Resource metrics service provided by Microsoft.Insights resource provider. + * + */ +class ServiceSpecification { + /** + * Create a ServiceSpecification. + * @member {array} [metricSpecifications] + * @member {array} [logSpecifications] + */ + constructor() { + } + + /** + * Defines the metadata of ServiceSpecification + * + * @returns {object} metadata of ServiceSpecification + * + */ + mapper() { + return { + required: false, + serializedName: 'ServiceSpecification', + type: { + name: 'Composite', + className: 'ServiceSpecification', + modelProperties: { + metricSpecifications: { + required: false, + serializedName: 'metricSpecifications', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'MetricSpecificationElementType', + type: { + name: 'Composite', + className: 'MetricSpecification' + } + } + } + }, + logSpecifications: { + required: false, + serializedName: 'logSpecifications', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'LogSpecificationElementType', + type: { + name: 'Composite', + className: 'LogSpecification' + } + } + } + } + } + } + }; + } +} + +module.exports = ServiceSpecification; diff --git a/lib/services/websiteManagement2/lib/models/site.js b/lib/services/websiteManagement2/lib/models/site.js new file mode 100644 index 0000000000..10ef4cbd6d --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/site.js @@ -0,0 +1,672 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * A web app, a mobile app backend, or an API app. + * + * @extends models['Resource'] + */ +class Site extends models['Resource'] { + /** + * Create a Site. + * @member {string} [state] Current state of the app. + * @member {array} [hostNames] Hostnames associated with the app. + * @member {string} [repositorySiteName] Name of the repository site. + * @member {string} [usageState] State indicating whether the app has + * exceeded its quota usage. Read-only. Possible values include: 'Normal', + * 'Exceeded' + * @member {boolean} [enabled] true if the app is enabled; + * otherwise, false. Setting this value to false disables the + * app (takes the app offline). + * @member {array} [enabledHostNames] Enabled hostnames for the app.Hostnames + * need to be assigned (see HostNames) AND enabled. Otherwise, + * the app is not served on those hostnames. + * @member {string} [availabilityState] Management information availability + * state for the app. Possible values include: 'Normal', 'Limited', + * 'DisasterRecoveryMode' + * @member {array} [hostNameSslStates] Hostname SSL states are used to manage + * the SSL bindings for app's hostnames. + * @member {string} [serverFarmId] Resource ID of the associated App Service + * plan, formatted as: + * "/subscriptions/{subscriptionID}/resourceGroups/{groupName}/providers/Microsoft.Web/serverfarms/{appServicePlanName}". + * @member {boolean} [reserved] true if reserved; otherwise, + * false. Default value: false . + * @member {boolean} [isXenon] Obsolete: Hyper-V sandbox. Default value: + * false . + * @member {boolean} [hyperV] Hyper-V sandbox. Default value: false . + * @member {date} [lastModifiedTimeUtc] Last time the app was modified, in + * UTC. Read-only. + * @member {object} [siteConfig] Configuration of the app. + * @member {number} [siteConfig.numberOfWorkers] Number of workers. + * @member {array} [siteConfig.defaultDocuments] Default documents. + * @member {string} [siteConfig.netFrameworkVersion] .NET Framework version. + * @member {string} [siteConfig.phpVersion] Version of PHP. + * @member {string} [siteConfig.pythonVersion] Version of Python. + * @member {string} [siteConfig.nodeVersion] Version of Node.js. + * @member {string} [siteConfig.linuxFxVersion] Linux App Framework and + * version + * @member {string} [siteConfig.windowsFxVersion] Xenon App Framework and + * version + * @member {boolean} [siteConfig.requestTracingEnabled] true if + * request tracing is enabled; otherwise, false. + * @member {date} [siteConfig.requestTracingExpirationTime] Request tracing + * expiration time. + * @member {boolean} [siteConfig.remoteDebuggingEnabled] true if + * remote debugging is enabled; otherwise, false. + * @member {string} [siteConfig.remoteDebuggingVersion] Remote debugging + * version. + * @member {boolean} [siteConfig.httpLoggingEnabled] true if + * HTTP logging is enabled; otherwise, false. + * @member {number} [siteConfig.logsDirectorySizeLimit] HTTP logs directory + * size limit. + * @member {boolean} [siteConfig.detailedErrorLoggingEnabled] + * true if detailed error logging is enabled; otherwise, + * false. + * @member {string} [siteConfig.publishingUsername] Publishing user name. + * @member {array} [siteConfig.appSettings] Application settings. + * @member {object} [siteConfig.azureStorageAccounts] User-provided Azure + * storage accounts. + * @member {array} [siteConfig.connectionStrings] Connection strings. + * @member {object} [siteConfig.machineKey] Site MachineKey. + * @member {string} [siteConfig.machineKey.validation] MachineKey validation. + * @member {string} [siteConfig.machineKey.validationKey] Validation key. + * @member {string} [siteConfig.machineKey.decryption] Algorithm used for + * decryption. + * @member {string} [siteConfig.machineKey.decryptionKey] Decryption key. + * @member {array} [siteConfig.handlerMappings] Handler mappings. + * @member {string} [siteConfig.documentRoot] Document root. + * @member {string} [siteConfig.scmType] SCM type. Possible values include: + * 'None', 'Dropbox', 'Tfs', 'LocalGit', 'GitHub', 'CodePlexGit', + * 'CodePlexHg', 'BitbucketGit', 'BitbucketHg', 'ExternalGit', 'ExternalHg', + * 'OneDrive', 'VSO' + * @member {boolean} [siteConfig.use32BitWorkerProcess] true to + * use 32-bit worker process; otherwise, false. + * @member {boolean} [siteConfig.webSocketsEnabled] true if + * WebSocket is enabled; otherwise, false. + * @member {boolean} [siteConfig.alwaysOn] true if Always On is + * enabled; otherwise, false. + * @member {string} [siteConfig.javaVersion] Java version. + * @member {string} [siteConfig.javaContainer] Java container. + * @member {string} [siteConfig.javaContainerVersion] Java container version. + * @member {string} [siteConfig.appCommandLine] App command line to launch. + * @member {string} [siteConfig.managedPipelineMode] Managed pipeline mode. + * Possible values include: 'Integrated', 'Classic' + * @member {array} [siteConfig.virtualApplications] Virtual applications. + * @member {string} [siteConfig.loadBalancing] Site load balancing. Possible + * values include: 'WeightedRoundRobin', 'LeastRequests', + * 'LeastResponseTime', 'WeightedTotalTraffic', 'RequestHash' + * @member {object} [siteConfig.experiments] This is work around for + * polymophic types. + * @member {array} [siteConfig.experiments.rampUpRules] List of ramp-up + * rules. + * @member {object} [siteConfig.limits] Site limits. + * @member {number} [siteConfig.limits.maxPercentageCpu] Maximum allowed CPU + * usage percentage. + * @member {number} [siteConfig.limits.maxMemoryInMb] Maximum allowed memory + * usage in MB. + * @member {number} [siteConfig.limits.maxDiskSizeInMb] Maximum allowed disk + * size usage in MB. + * @member {boolean} [siteConfig.autoHealEnabled] true if Auto + * Heal is enabled; otherwise, false. + * @member {object} [siteConfig.autoHealRules] Auto Heal rules. + * @member {object} [siteConfig.autoHealRules.triggers] Conditions that + * describe when to execute the auto-heal actions. + * @member {object} [siteConfig.autoHealRules.triggers.requests] A rule based + * on total requests. + * @member {number} [siteConfig.autoHealRules.triggers.requests.count] + * Request Count. + * @member {string} [siteConfig.autoHealRules.triggers.requests.timeInterval] + * Time interval. + * @member {number} [siteConfig.autoHealRules.triggers.privateBytesInKB] A + * rule based on private bytes. + * @member {array} [siteConfig.autoHealRules.triggers.statusCodes] A rule + * based on status codes. + * @member {object} [siteConfig.autoHealRules.triggers.slowRequests] A rule + * based on request execution time. + * @member {string} + * [siteConfig.autoHealRules.triggers.slowRequests.timeTaken] Time taken. + * @member {number} [siteConfig.autoHealRules.triggers.slowRequests.count] + * Request Count. + * @member {string} + * [siteConfig.autoHealRules.triggers.slowRequests.timeInterval] Time + * interval. + * @member {object} [siteConfig.autoHealRules.actions] Actions to be executed + * when a rule is triggered. + * @member {string} [siteConfig.autoHealRules.actions.actionType] Predefined + * action to be taken. Possible values include: 'Recycle', 'LogEvent', + * 'CustomAction' + * @member {object} [siteConfig.autoHealRules.actions.customAction] Custom + * action to be taken. + * @member {string} [siteConfig.autoHealRules.actions.customAction.exe] + * Executable to be run. + * @member {string} + * [siteConfig.autoHealRules.actions.customAction.parameters] Parameters for + * the executable. + * @member {string} + * [siteConfig.autoHealRules.actions.minProcessExecutionTime] Minimum time + * the process must execute + * before taking the action + * @member {string} [siteConfig.tracingOptions] Tracing options. + * @member {string} [siteConfig.vnetName] Virtual Network name. + * @member {object} [siteConfig.cors] Cross-Origin Resource Sharing (CORS) + * settings. + * @member {array} [siteConfig.cors.allowedOrigins] Gets or sets the list of + * origins that should be allowed to make cross-origin + * calls (for example: http://example.com:12345). Use "*" to allow all. + * @member {object} [siteConfig.push] Push endpoint settings. + * @member {boolean} [siteConfig.push.isPushEnabled] Gets or sets a flag + * indicating whether the Push endpoint is enabled. + * @member {string} [siteConfig.push.tagWhitelistJson] Gets or sets a JSON + * string containing a list of tags that are whitelisted for use by the push + * registration endpoint. + * @member {string} [siteConfig.push.tagsRequiringAuth] Gets or sets a JSON + * string containing a list of tags that require user authentication to be + * used in the push registration endpoint. + * Tags can consist of alphanumeric characters and the following: + * '_', '@', '#', '.', ':', '-'. + * Validation should be performed at the PushRequestHandler. + * @member {string} [siteConfig.push.dynamicTagsJson] Gets or sets a JSON + * string containing a list of dynamic tags that will be evaluated from user + * claims in the push registration endpoint. + * @member {object} [siteConfig.apiDefinition] Information about the formal + * API definition for the app. + * @member {string} [siteConfig.apiDefinition.url] The URL of the API + * definition. + * @member {string} [siteConfig.autoSwapSlotName] Auto-swap slot name. + * @member {boolean} [siteConfig.localMySqlEnabled] true to + * enable local MySQL; otherwise, false. + * @member {number} [siteConfig.managedServiceIdentityId] Managed Service + * Identity Id + * @member {number} [siteConfig.xManagedServiceIdentityId] Explicit Managed + * Service Identity Id + * @member {array} [siteConfig.ipSecurityRestrictions] IP security + * restrictions. + * @member {boolean} [siteConfig.http20Enabled] Http20Enabled: configures a + * web site to allow clients to connect over http2.0 + * @member {string} [siteConfig.minTlsVersion] MinTlsVersion: configures the + * minimum version of TLS required for SSL requests. Possible values include: + * '1.0', '1.1', '1.2' + * @member {string} [siteConfig.ftpsState] State of FTP / FTPS service. + * Possible values include: 'AllAllowed', 'FtpsOnly', 'Disabled' + * @member {number} [siteConfig.reservedInstanceCount] Number of reserved + * instances. + * This setting only applies to the Consumption Plan + * @member {array} [trafficManagerHostNames] Azure Traffic Manager hostnames + * associated with the app. Read-only. + * @member {boolean} [scmSiteAlsoStopped] true to stop SCM + * (KUDU) site when the app is stopped; otherwise, false. The + * default is false. Default value: false . + * @member {string} [targetSwapSlot] Specifies which deployment slot this app + * will swap into. Read-only. + * @member {object} [hostingEnvironmentProfile] App Service Environment to + * use for the app. + * @member {string} [hostingEnvironmentProfile.id] Resource ID of the App + * Service Environment. + * @member {string} [hostingEnvironmentProfile.name] Name of the App Service + * Environment. + * @member {string} [hostingEnvironmentProfile.type] Resource type of the App + * Service Environment. + * @member {boolean} [clientAffinityEnabled] true to enable + * client affinity; false to stop sending session affinity + * cookies, which route client requests in the same session to the same + * instance. Default is true. + * @member {boolean} [clientCertEnabled] true to enable client + * certificate authentication (TLS mutual authentication); otherwise, + * false. Default is false. + * @member {boolean} [hostNamesDisabled] true to disable the + * public hostnames of the app; otherwise, false. + * If true, the app is only accessible via API management + * process. + * @member {string} [outboundIpAddresses] List of IP addresses that the app + * uses for outbound connections (e.g. database access). Includes VIPs from + * tenants that site can be hosted with current settings. Read-only. + * @member {string} [possibleOutboundIpAddresses] List of IP addresses that + * the app uses for outbound connections (e.g. database access). Includes + * VIPs from all tenants. Read-only. + * @member {number} [containerSize] Size of the function container. + * @member {number} [dailyMemoryTimeQuota] Maximum allowed daily memory-time + * quota (applicable on dynamic apps only). + * @member {date} [suspendedTill] App suspended till in case memory-time + * quota is exceeded. + * @member {number} [maxNumberOfWorkers] Maximum number of workers. + * This only applies to Functions container. + * @member {object} [cloningInfo] If specified during app creation, the app + * is cloned from a source app. + * @member {uuid} [cloningInfo.correlationId] Correlation ID of cloning + * operation. This ID ties multiple cloning operations + * together to use the same snapshot. + * @member {boolean} [cloningInfo.overwrite] true to overwrite + * destination app; otherwise, false. + * @member {boolean} [cloningInfo.cloneCustomHostNames] true to + * clone custom hostnames from source app; otherwise, false. + * @member {boolean} [cloningInfo.cloneSourceControl] true to + * clone source control from source app; otherwise, false. + * @member {string} [cloningInfo.sourceWebAppId] ARM resource ID of the + * source app. App resource ID is of the form + * /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName} + * for production slots and + * /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/slots/{slotName} + * for other slots. + * @member {string} [cloningInfo.hostingEnvironment] App Service Environment. + * @member {object} [cloningInfo.appSettingsOverrides] Application setting + * overrides for cloned app. If specified, these settings override the + * settings cloned + * from source app. Otherwise, application settings from source app are + * retained. + * @member {boolean} [cloningInfo.configureLoadBalancing] true + * to configure load balancing for source and destination app. + * @member {string} [cloningInfo.trafficManagerProfileId] ARM resource ID of + * the Traffic Manager profile to use, if it exists. Traffic Manager resource + * ID is of the form + * /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/trafficManagerProfiles/{profileName}. + * @member {string} [cloningInfo.trafficManagerProfileName] Name of Traffic + * Manager profile to create. This is only needed if Traffic Manager profile + * does not already exist. + * @member {string} [resourceGroup] Name of the resource group the app + * belongs to. Read-only. + * @member {boolean} [isDefaultContainer] true if the app is a + * default container; otherwise, false. + * @member {string} [defaultHostName] Default hostname of the app. Read-only. + * @member {object} [slotSwapStatus] Status of the last deployment slot swap + * operation. + * @member {date} [slotSwapStatus.timestampUtc] The time the last successful + * slot swap completed. + * @member {string} [slotSwapStatus.sourceSlotName] The source slot of the + * last swap operation. + * @member {string} [slotSwapStatus.destinationSlotName] The destination slot + * of the last swap operation. + * @member {boolean} [httpsOnly] HttpsOnly: configures a web site to accept + * only https requests. Issues redirect for + * http requests + * @member {object} [identity] + * @member {string} [identity.type] Type of managed service identity. + * Possible values include: 'SystemAssigned', 'UserAssigned' + * @member {string} [identity.tenantId] Tenant of managed service identity. + * @member {string} [identity.principalId] Principal Id of managed service + * identity. + * @member {array} [identity.identityIds] Array of UserAssigned managed + * service identities. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of Site + * + * @returns {object} metadata of Site + * + */ + mapper() { + return { + required: false, + serializedName: 'Site', + type: { + name: 'Composite', + className: 'Site', + 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' + } + }, + location: { + required: true, + serializedName: 'location', + type: { + name: 'String' + } + }, + type: { + required: false, + readOnly: true, + serializedName: 'type', + type: { + name: 'String' + } + }, + tags: { + required: false, + serializedName: 'tags', + type: { + name: 'Dictionary', + value: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + state: { + required: false, + readOnly: true, + serializedName: 'properties.state', + type: { + name: 'String' + } + }, + hostNames: { + required: false, + readOnly: true, + serializedName: 'properties.hostNames', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + repositorySiteName: { + required: false, + readOnly: true, + serializedName: 'properties.repositorySiteName', + type: { + name: 'String' + } + }, + usageState: { + required: false, + readOnly: true, + serializedName: 'properties.usageState', + type: { + name: 'Enum', + allowedValues: [ 'Normal', 'Exceeded' ] + } + }, + enabled: { + required: false, + serializedName: 'properties.enabled', + type: { + name: 'Boolean' + } + }, + enabledHostNames: { + required: false, + readOnly: true, + serializedName: 'properties.enabledHostNames', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + availabilityState: { + required: false, + readOnly: true, + serializedName: 'properties.availabilityState', + type: { + name: 'Enum', + allowedValues: [ 'Normal', 'Limited', 'DisasterRecoveryMode' ] + } + }, + hostNameSslStates: { + required: false, + serializedName: 'properties.hostNameSslStates', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'HostNameSslStateElementType', + type: { + name: 'Composite', + className: 'HostNameSslState' + } + } + } + }, + serverFarmId: { + required: false, + serializedName: 'properties.serverFarmId', + type: { + name: 'String' + } + }, + reserved: { + required: false, + serializedName: 'properties.reserved', + defaultValue: false, + type: { + name: 'Boolean' + } + }, + isXenon: { + required: false, + serializedName: 'properties.isXenon', + defaultValue: false, + type: { + name: 'Boolean' + } + }, + hyperV: { + required: false, + serializedName: 'properties.hyperV', + defaultValue: false, + type: { + name: 'Boolean' + } + }, + lastModifiedTimeUtc: { + required: false, + readOnly: true, + serializedName: 'properties.lastModifiedTimeUtc', + type: { + name: 'DateTime' + } + }, + siteConfig: { + required: false, + serializedName: 'properties.siteConfig', + type: { + name: 'Composite', + className: 'SiteConfig' + } + }, + trafficManagerHostNames: { + required: false, + readOnly: true, + serializedName: 'properties.trafficManagerHostNames', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + scmSiteAlsoStopped: { + required: false, + serializedName: 'properties.scmSiteAlsoStopped', + defaultValue: false, + type: { + name: 'Boolean' + } + }, + targetSwapSlot: { + required: false, + readOnly: true, + serializedName: 'properties.targetSwapSlot', + type: { + name: 'String' + } + }, + hostingEnvironmentProfile: { + required: false, + serializedName: 'properties.hostingEnvironmentProfile', + type: { + name: 'Composite', + className: 'HostingEnvironmentProfile' + } + }, + clientAffinityEnabled: { + required: false, + serializedName: 'properties.clientAffinityEnabled', + type: { + name: 'Boolean' + } + }, + clientCertEnabled: { + required: false, + serializedName: 'properties.clientCertEnabled', + type: { + name: 'Boolean' + } + }, + hostNamesDisabled: { + required: false, + serializedName: 'properties.hostNamesDisabled', + type: { + name: 'Boolean' + } + }, + outboundIpAddresses: { + required: false, + readOnly: true, + serializedName: 'properties.outboundIpAddresses', + type: { + name: 'String' + } + }, + possibleOutboundIpAddresses: { + required: false, + readOnly: true, + serializedName: 'properties.possibleOutboundIpAddresses', + type: { + name: 'String' + } + }, + containerSize: { + required: false, + serializedName: 'properties.containerSize', + type: { + name: 'Number' + } + }, + dailyMemoryTimeQuota: { + required: false, + serializedName: 'properties.dailyMemoryTimeQuota', + type: { + name: 'Number' + } + }, + suspendedTill: { + required: false, + readOnly: true, + serializedName: 'properties.suspendedTill', + type: { + name: 'DateTime' + } + }, + maxNumberOfWorkers: { + required: false, + readOnly: true, + serializedName: 'properties.maxNumberOfWorkers', + type: { + name: 'Number' + } + }, + cloningInfo: { + required: false, + serializedName: 'properties.cloningInfo', + type: { + name: 'Composite', + className: 'CloningInfo' + } + }, + resourceGroup: { + required: false, + readOnly: true, + serializedName: 'properties.resourceGroup', + type: { + name: 'String' + } + }, + isDefaultContainer: { + required: false, + readOnly: true, + serializedName: 'properties.isDefaultContainer', + type: { + name: 'Boolean' + } + }, + defaultHostName: { + required: false, + readOnly: true, + serializedName: 'properties.defaultHostName', + type: { + name: 'String' + } + }, + slotSwapStatus: { + required: false, + readOnly: true, + serializedName: 'properties.slotSwapStatus', + type: { + name: 'Composite', + className: 'SlotSwapStatus' + } + }, + httpsOnly: { + required: false, + serializedName: 'properties.httpsOnly', + type: { + name: 'Boolean' + } + }, + identity: { + required: false, + serializedName: 'identity', + type: { + name: 'Composite', + className: 'ManagedServiceIdentity' + } + } + } + } + }; + } +} + +module.exports = Site; diff --git a/lib/services/websiteManagement2/lib/models/siteAuthSettings.js b/lib/services/websiteManagement2/lib/models/siteAuthSettings.js new file mode 100644 index 0000000000..f35b25393d --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/siteAuthSettings.js @@ -0,0 +1,410 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Configuration settings for the Azure App Service Authentication / + * Authorization feature. + * + * @extends models['ProxyOnlyResource'] + */ +class SiteAuthSettings extends models['ProxyOnlyResource'] { + /** + * Create a SiteAuthSettings. + * @member {boolean} [enabled] true if the Authentication / + * Authorization feature is enabled for the current app; otherwise, + * false. + * @member {string} [runtimeVersion] The RuntimeVersion of the Authentication + * / Authorization feature in use for the current app. + * The setting in this value can control the behavior of certain features in + * the Authentication / Authorization module. + * @member {string} [unauthenticatedClientAction] The action to take when an + * unauthenticated client attempts to access the app. Possible values + * include: 'RedirectToLoginPage', 'AllowAnonymous' + * @member {boolean} [tokenStoreEnabled] true to durably store + * platform-specific security tokens that are obtained during login flows; + * otherwise, false. + * The default is false. + * @member {array} [allowedExternalRedirectUrls] External URLs that can be + * redirected to as part of logging in or logging out of the app. Note that + * the query string part of the URL is ignored. + * This is an advanced setting typically only needed by Windows Store + * application backends. + * Note that URLs within the current domain are always implicitly allowed. + * @member {string} [defaultProvider] The default authentication provider to + * use when multiple providers are configured. + * This setting is only needed if multiple providers are configured and the + * unauthenticated client + * action is set to "RedirectToLoginPage". Possible values include: + * 'AzureActiveDirectory', 'Facebook', 'Google', 'MicrosoftAccount', + * 'Twitter' + * @member {number} [tokenRefreshExtensionHours] The number of hours after + * session token expiration that a session token can be used to + * call the token refresh API. The default is 72 hours. + * @member {string} [clientId] The Client ID of this relying party + * application, known as the client_id. + * This setting is required for enabling OpenID Connection authentication + * with Azure Active Directory or + * other 3rd party OpenID Connect providers. + * More information on OpenID Connect: + * http://openid.net/specs/openid-connect-core-1_0.html + * @member {string} [clientSecret] The Client Secret of this relying party + * application (in Azure Active Directory, this is also referred to as the + * Key). + * This setting is optional. If no client secret is configured, the OpenID + * Connect implicit auth flow is used to authenticate end users. + * Otherwise, the OpenID Connect Authorization Code Flow is used to + * authenticate end users. + * More information on OpenID Connect: + * http://openid.net/specs/openid-connect-core-1_0.html + * @member {string} [issuer] The OpenID Connect Issuer URI that represents + * the entity which issues access tokens for this application. + * When using Azure Active Directory, this value is the URI of the directory + * tenant, e.g. https://sts.windows.net/{tenant-guid}/. + * This URI is a case-sensitive identifier for the token issuer. + * More information on OpenID Connect Discovery: + * http://openid.net/specs/openid-connect-discovery-1_0.html + * @member {boolean} [validateIssuer] Gets a value indicating whether the + * issuer should be a valid HTTPS url and be validated as such. + * @member {array} [allowedAudiences] Allowed audience values to consider + * when validating JWTs issued by + * Azure Active Directory. Note that the ClientID value is + * always considered an + * allowed audience, regardless of this setting. + * @member {array} [additionalLoginParams] Login parameters to send to the + * OpenID Connect authorization endpoint when + * a user logs in. Each parameter must be in the form "key=value". + * @member {string} [googleClientId] The OpenID Connect Client ID for the + * Google web application. + * This setting is required for enabling Google Sign-In. + * Google Sign-In documentation: + * https://developers.google.com/identity/sign-in/web/ + * @member {string} [googleClientSecret] The client secret associated with + * the Google web application. + * This setting is required for enabling Google Sign-In. + * Google Sign-In documentation: + * https://developers.google.com/identity/sign-in/web/ + * @member {array} [googleOAuthScopes] The OAuth 2.0 scopes that will be + * requested as part of Google Sign-In authentication. + * This setting is optional. If not specified, "openid", "profile", and + * "email" are used as default scopes. + * Google Sign-In documentation: + * https://developers.google.com/identity/sign-in/web/ + * @member {string} [facebookAppId] The App ID of the Facebook app used for + * login. + * This setting is required for enabling Facebook Login. + * Facebook Login documentation: + * https://developers.facebook.com/docs/facebook-login + * @member {string} [facebookAppSecret] The App Secret of the Facebook app + * used for Facebook Login. + * This setting is required for enabling Facebook Login. + * Facebook Login documentation: + * https://developers.facebook.com/docs/facebook-login + * @member {array} [facebookOAuthScopes] The OAuth 2.0 scopes that will be + * requested as part of Facebook Login authentication. + * This setting is optional. + * Facebook Login documentation: + * https://developers.facebook.com/docs/facebook-login + * @member {string} [twitterConsumerKey] The OAuth 1.0a consumer key of the + * Twitter application used for sign-in. + * This setting is required for enabling Twitter Sign-In. + * Twitter Sign-In documentation: https://dev.twitter.com/web/sign-in + * @member {string} [twitterConsumerSecret] The OAuth 1.0a consumer secret of + * the Twitter application used for sign-in. + * This setting is required for enabling Twitter Sign-In. + * Twitter Sign-In documentation: https://dev.twitter.com/web/sign-in + * @member {string} [microsoftAccountClientId] The OAuth 2.0 client ID that + * was created for the app used for authentication. + * This setting is required for enabling Microsoft Account authentication. + * Microsoft Account OAuth documentation: + * https://dev.onedrive.com/auth/msa_oauth.htm + * @member {string} [microsoftAccountClientSecret] The OAuth 2.0 client + * secret that was created for the app used for authentication. + * This setting is required for enabling Microsoft Account authentication. + * Microsoft Account OAuth documentation: + * https://dev.onedrive.com/auth/msa_oauth.htm + * @member {array} [microsoftAccountOAuthScopes] The OAuth 2.0 scopes that + * will be requested as part of Microsoft Account authentication. + * This setting is optional. If not specified, "wl.basic" is used as the + * default scope. + * Microsoft Account Scopes and permissions documentation: + * https://msdn.microsoft.com/en-us/library/dn631845.aspx + */ + constructor() { + super(); + } + + /** + * Defines the metadata of SiteAuthSettings + * + * @returns {object} metadata of SiteAuthSettings + * + */ + mapper() { + return { + required: false, + serializedName: 'SiteAuthSettings', + type: { + name: 'Composite', + className: 'SiteAuthSettings', + 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' + } + }, + enabled: { + required: false, + serializedName: 'properties.enabled', + type: { + name: 'Boolean' + } + }, + runtimeVersion: { + required: false, + serializedName: 'properties.runtimeVersion', + type: { + name: 'String' + } + }, + unauthenticatedClientAction: { + required: false, + serializedName: 'properties.unauthenticatedClientAction', + type: { + name: 'Enum', + allowedValues: [ 'RedirectToLoginPage', 'AllowAnonymous' ] + } + }, + tokenStoreEnabled: { + required: false, + serializedName: 'properties.tokenStoreEnabled', + type: { + name: 'Boolean' + } + }, + allowedExternalRedirectUrls: { + required: false, + serializedName: 'properties.allowedExternalRedirectUrls', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + defaultProvider: { + required: false, + serializedName: 'properties.defaultProvider', + type: { + name: 'Enum', + allowedValues: [ 'AzureActiveDirectory', 'Facebook', 'Google', 'MicrosoftAccount', 'Twitter' ] + } + }, + tokenRefreshExtensionHours: { + required: false, + serializedName: 'properties.tokenRefreshExtensionHours', + type: { + name: 'Number' + } + }, + clientId: { + required: false, + serializedName: 'properties.clientId', + type: { + name: 'String' + } + }, + clientSecret: { + required: false, + serializedName: 'properties.clientSecret', + type: { + name: 'String' + } + }, + issuer: { + required: false, + serializedName: 'properties.issuer', + type: { + name: 'String' + } + }, + validateIssuer: { + required: false, + serializedName: 'properties.validateIssuer', + type: { + name: 'Boolean' + } + }, + allowedAudiences: { + required: false, + serializedName: 'properties.allowedAudiences', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + additionalLoginParams: { + required: false, + serializedName: 'properties.additionalLoginParams', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + googleClientId: { + required: false, + serializedName: 'properties.googleClientId', + type: { + name: 'String' + } + }, + googleClientSecret: { + required: false, + serializedName: 'properties.googleClientSecret', + type: { + name: 'String' + } + }, + googleOAuthScopes: { + required: false, + serializedName: 'properties.googleOAuthScopes', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + facebookAppId: { + required: false, + serializedName: 'properties.facebookAppId', + type: { + name: 'String' + } + }, + facebookAppSecret: { + required: false, + serializedName: 'properties.facebookAppSecret', + type: { + name: 'String' + } + }, + facebookOAuthScopes: { + required: false, + serializedName: 'properties.facebookOAuthScopes', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + twitterConsumerKey: { + required: false, + serializedName: 'properties.twitterConsumerKey', + type: { + name: 'String' + } + }, + twitterConsumerSecret: { + required: false, + serializedName: 'properties.twitterConsumerSecret', + type: { + name: 'String' + } + }, + microsoftAccountClientId: { + required: false, + serializedName: 'properties.microsoftAccountClientId', + type: { + name: 'String' + } + }, + microsoftAccountClientSecret: { + required: false, + serializedName: 'properties.microsoftAccountClientSecret', + type: { + name: 'String' + } + }, + microsoftAccountOAuthScopes: { + required: false, + serializedName: 'properties.microsoftAccountOAuthScopes', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + } + } + } + }; + } +} + +module.exports = SiteAuthSettings; diff --git a/lib/services/websiteManagement2/lib/models/siteCloneability.js b/lib/services/websiteManagement2/lib/models/siteCloneability.js index 8e5728a618..e006a4d2b2 100644 --- a/lib/services/websiteManagement2/lib/models/siteCloneability.js +++ b/lib/services/websiteManagement2/lib/models/siteCloneability.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * Represents whether or not an app is cloneable. * diff --git a/lib/services/websiteManagement2/lib/models/siteConfig.js b/lib/services/websiteManagement2/lib/models/siteConfig.js new file mode 100644 index 0000000000..5715d374ae --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/siteConfig.js @@ -0,0 +1,610 @@ +/* + * 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'; + +/** + * Configuration of an App Service app. + * + */ +class SiteConfig { + /** + * Create a SiteConfig. + * @member {number} [numberOfWorkers] Number of workers. + * @member {array} [defaultDocuments] Default documents. + * @member {string} [netFrameworkVersion] .NET Framework version. Default + * value: 'v4.6' . + * @member {string} [phpVersion] Version of PHP. + * @member {string} [pythonVersion] Version of Python. + * @member {string} [nodeVersion] Version of Node.js. + * @member {string} [linuxFxVersion] Linux App Framework and version + * @member {string} [windowsFxVersion] Xenon App Framework and version + * @member {boolean} [requestTracingEnabled] true if request + * tracing is enabled; otherwise, false. + * @member {date} [requestTracingExpirationTime] Request tracing expiration + * time. + * @member {boolean} [remoteDebuggingEnabled] true if remote + * debugging is enabled; otherwise, false. + * @member {string} [remoteDebuggingVersion] Remote debugging version. + * @member {boolean} [httpLoggingEnabled] true if HTTP logging + * is enabled; otherwise, false. + * @member {number} [logsDirectorySizeLimit] HTTP logs directory size limit. + * @member {boolean} [detailedErrorLoggingEnabled] true if + * detailed error logging is enabled; otherwise, false. + * @member {string} [publishingUsername] Publishing user name. + * @member {array} [appSettings] Application settings. + * @member {object} [azureStorageAccounts] User-provided Azure storage + * accounts. + * @member {array} [connectionStrings] Connection strings. + * @member {object} [machineKey] Site MachineKey. + * @member {string} [machineKey.validation] MachineKey validation. + * @member {string} [machineKey.validationKey] Validation key. + * @member {string} [machineKey.decryption] Algorithm used for decryption. + * @member {string} [machineKey.decryptionKey] Decryption key. + * @member {array} [handlerMappings] Handler mappings. + * @member {string} [documentRoot] Document root. + * @member {string} [scmType] SCM type. Possible values include: 'None', + * 'Dropbox', 'Tfs', 'LocalGit', 'GitHub', 'CodePlexGit', 'CodePlexHg', + * 'BitbucketGit', 'BitbucketHg', 'ExternalGit', 'ExternalHg', 'OneDrive', + * 'VSO' + * @member {boolean} [use32BitWorkerProcess] true to use 32-bit + * worker process; otherwise, false. + * @member {boolean} [webSocketsEnabled] true if WebSocket is + * enabled; otherwise, false. + * @member {boolean} [alwaysOn] true if Always On is enabled; + * otherwise, false. + * @member {string} [javaVersion] Java version. + * @member {string} [javaContainer] Java container. + * @member {string} [javaContainerVersion] Java container version. + * @member {string} [appCommandLine] App command line to launch. + * @member {string} [managedPipelineMode] Managed pipeline mode. Possible + * values include: 'Integrated', 'Classic' + * @member {array} [virtualApplications] Virtual applications. + * @member {string} [loadBalancing] Site load balancing. Possible values + * include: 'WeightedRoundRobin', 'LeastRequests', 'LeastResponseTime', + * 'WeightedTotalTraffic', 'RequestHash' + * @member {object} [experiments] This is work around for polymophic types. + * @member {array} [experiments.rampUpRules] List of ramp-up rules. + * @member {object} [limits] Site limits. + * @member {number} [limits.maxPercentageCpu] Maximum allowed CPU usage + * percentage. + * @member {number} [limits.maxMemoryInMb] Maximum allowed memory usage in + * MB. + * @member {number} [limits.maxDiskSizeInMb] Maximum allowed disk size usage + * in MB. + * @member {boolean} [autoHealEnabled] true if Auto Heal is + * enabled; otherwise, false. + * @member {object} [autoHealRules] Auto Heal rules. + * @member {object} [autoHealRules.triggers] Conditions that describe when to + * execute the auto-heal actions. + * @member {object} [autoHealRules.triggers.requests] A rule based on total + * requests. + * @member {number} [autoHealRules.triggers.requests.count] Request Count. + * @member {string} [autoHealRules.triggers.requests.timeInterval] Time + * interval. + * @member {number} [autoHealRules.triggers.privateBytesInKB] A rule based on + * private bytes. + * @member {array} [autoHealRules.triggers.statusCodes] A rule based on + * status codes. + * @member {object} [autoHealRules.triggers.slowRequests] A rule based on + * request execution time. + * @member {string} [autoHealRules.triggers.slowRequests.timeTaken] Time + * taken. + * @member {number} [autoHealRules.triggers.slowRequests.count] Request + * Count. + * @member {string} [autoHealRules.triggers.slowRequests.timeInterval] Time + * interval. + * @member {object} [autoHealRules.actions] Actions to be executed when a + * rule is triggered. + * @member {string} [autoHealRules.actions.actionType] Predefined action to + * be taken. Possible values include: 'Recycle', 'LogEvent', 'CustomAction' + * @member {object} [autoHealRules.actions.customAction] Custom action to be + * taken. + * @member {string} [autoHealRules.actions.customAction.exe] Executable to be + * run. + * @member {string} [autoHealRules.actions.customAction.parameters] + * Parameters for the executable. + * @member {string} [autoHealRules.actions.minProcessExecutionTime] Minimum + * time the process must execute + * before taking the action + * @member {string} [tracingOptions] Tracing options. + * @member {string} [vnetName] Virtual Network name. + * @member {object} [cors] Cross-Origin Resource Sharing (CORS) settings. + * @member {array} [cors.allowedOrigins] Gets or sets the list of origins + * that should be allowed to make cross-origin + * calls (for example: http://example.com:12345). Use "*" to allow all. + * @member {object} [push] Push endpoint settings. + * @member {boolean} [push.isPushEnabled] Gets or sets a flag indicating + * whether the Push endpoint is enabled. + * @member {string} [push.tagWhitelistJson] Gets or sets a JSON string + * containing a list of tags that are whitelisted for use by the push + * registration endpoint. + * @member {string} [push.tagsRequiringAuth] Gets or sets a JSON string + * containing a list of tags that require user authentication to be used in + * the push registration endpoint. + * Tags can consist of alphanumeric characters and the following: + * '_', '@', '#', '.', ':', '-'. + * Validation should be performed at the PushRequestHandler. + * @member {string} [push.dynamicTagsJson] Gets or sets a JSON string + * containing a list of dynamic tags that will be evaluated from user claims + * in the push registration endpoint. + * @member {object} [apiDefinition] Information about the formal API + * definition for the app. + * @member {string} [apiDefinition.url] The URL of the API definition. + * @member {string} [autoSwapSlotName] Auto-swap slot name. + * @member {boolean} [localMySqlEnabled] true to enable local + * MySQL; otherwise, false. Default value: false . + * @member {number} [managedServiceIdentityId] Managed Service Identity Id + * @member {number} [xManagedServiceIdentityId] Explicit Managed Service + * Identity Id + * @member {array} [ipSecurityRestrictions] IP security restrictions. + * @member {boolean} [http20Enabled] Http20Enabled: configures a web site to + * allow clients to connect over http2.0. Default value: true . + * @member {string} [minTlsVersion] MinTlsVersion: configures the minimum + * version of TLS required for SSL requests. Possible values include: '1.0', + * '1.1', '1.2' + * @member {string} [ftpsState] State of FTP / FTPS service. Possible values + * include: 'AllAllowed', 'FtpsOnly', 'Disabled' + * @member {number} [reservedInstanceCount] Number of reserved instances. + * This setting only applies to the Consumption Plan + */ + constructor() { + } + + /** + * Defines the metadata of SiteConfig + * + * @returns {object} metadata of SiteConfig + * + */ + mapper() { + return { + required: false, + serializedName: 'SiteConfig', + type: { + name: 'Composite', + className: 'SiteConfig', + modelProperties: { + numberOfWorkers: { + required: false, + serializedName: 'numberOfWorkers', + type: { + name: 'Number' + } + }, + defaultDocuments: { + required: false, + serializedName: 'defaultDocuments', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + netFrameworkVersion: { + required: false, + serializedName: 'netFrameworkVersion', + defaultValue: 'v4.6', + type: { + name: 'String' + } + }, + phpVersion: { + required: false, + serializedName: 'phpVersion', + type: { + name: 'String' + } + }, + pythonVersion: { + required: false, + serializedName: 'pythonVersion', + type: { + name: 'String' + } + }, + nodeVersion: { + required: false, + serializedName: 'nodeVersion', + type: { + name: 'String' + } + }, + linuxFxVersion: { + required: false, + serializedName: 'linuxFxVersion', + type: { + name: 'String' + } + }, + windowsFxVersion: { + required: false, + serializedName: 'windowsFxVersion', + type: { + name: 'String' + } + }, + requestTracingEnabled: { + required: false, + serializedName: 'requestTracingEnabled', + type: { + name: 'Boolean' + } + }, + requestTracingExpirationTime: { + required: false, + serializedName: 'requestTracingExpirationTime', + type: { + name: 'DateTime' + } + }, + remoteDebuggingEnabled: { + required: false, + serializedName: 'remoteDebuggingEnabled', + type: { + name: 'Boolean' + } + }, + remoteDebuggingVersion: { + required: false, + serializedName: 'remoteDebuggingVersion', + type: { + name: 'String' + } + }, + httpLoggingEnabled: { + required: false, + serializedName: 'httpLoggingEnabled', + type: { + name: 'Boolean' + } + }, + logsDirectorySizeLimit: { + required: false, + serializedName: 'logsDirectorySizeLimit', + type: { + name: 'Number' + } + }, + detailedErrorLoggingEnabled: { + required: false, + serializedName: 'detailedErrorLoggingEnabled', + type: { + name: 'Boolean' + } + }, + publishingUsername: { + required: false, + serializedName: 'publishingUsername', + type: { + name: 'String' + } + }, + appSettings: { + required: false, + serializedName: 'appSettings', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'NameValuePairElementType', + type: { + name: 'Composite', + className: 'NameValuePair' + } + } + } + }, + azureStorageAccounts: { + required: false, + serializedName: 'azureStorageAccounts', + type: { + name: 'Dictionary', + value: { + required: false, + serializedName: 'AzureStorageInfoValueElementType', + type: { + name: 'Composite', + className: 'AzureStorageInfoValue' + } + } + } + }, + connectionStrings: { + required: false, + serializedName: 'connectionStrings', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ConnStringInfoElementType', + type: { + name: 'Composite', + className: 'ConnStringInfo' + } + } + } + }, + machineKey: { + required: false, + readOnly: true, + serializedName: 'machineKey', + type: { + name: 'Composite', + className: 'SiteMachineKey' + } + }, + handlerMappings: { + required: false, + serializedName: 'handlerMappings', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'HandlerMappingElementType', + type: { + name: 'Composite', + className: 'HandlerMapping' + } + } + } + }, + documentRoot: { + required: false, + serializedName: 'documentRoot', + type: { + name: 'String' + } + }, + scmType: { + required: false, + serializedName: 'scmType', + type: { + name: 'String' + } + }, + use32BitWorkerProcess: { + required: false, + serializedName: 'use32BitWorkerProcess', + type: { + name: 'Boolean' + } + }, + webSocketsEnabled: { + required: false, + serializedName: 'webSocketsEnabled', + type: { + name: 'Boolean' + } + }, + alwaysOn: { + required: false, + serializedName: 'alwaysOn', + type: { + name: 'Boolean' + } + }, + javaVersion: { + required: false, + serializedName: 'javaVersion', + type: { + name: 'String' + } + }, + javaContainer: { + required: false, + serializedName: 'javaContainer', + type: { + name: 'String' + } + }, + javaContainerVersion: { + required: false, + serializedName: 'javaContainerVersion', + type: { + name: 'String' + } + }, + appCommandLine: { + required: false, + serializedName: 'appCommandLine', + type: { + name: 'String' + } + }, + managedPipelineMode: { + required: false, + serializedName: 'managedPipelineMode', + type: { + name: 'Enum', + allowedValues: [ 'Integrated', 'Classic' ] + } + }, + virtualApplications: { + required: false, + serializedName: 'virtualApplications', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'VirtualApplicationElementType', + type: { + name: 'Composite', + className: 'VirtualApplication' + } + } + } + }, + loadBalancing: { + required: false, + serializedName: 'loadBalancing', + type: { + name: 'Enum', + allowedValues: [ 'WeightedRoundRobin', 'LeastRequests', 'LeastResponseTime', 'WeightedTotalTraffic', 'RequestHash' ] + } + }, + experiments: { + required: false, + serializedName: 'experiments', + type: { + name: 'Composite', + className: 'Experiments' + } + }, + limits: { + required: false, + serializedName: 'limits', + type: { + name: 'Composite', + className: 'SiteLimits' + } + }, + autoHealEnabled: { + required: false, + serializedName: 'autoHealEnabled', + type: { + name: 'Boolean' + } + }, + autoHealRules: { + required: false, + serializedName: 'autoHealRules', + type: { + name: 'Composite', + className: 'AutoHealRules' + } + }, + tracingOptions: { + required: false, + serializedName: 'tracingOptions', + type: { + name: 'String' + } + }, + vnetName: { + required: false, + serializedName: 'vnetName', + type: { + name: 'String' + } + }, + cors: { + required: false, + serializedName: 'cors', + type: { + name: 'Composite', + className: 'CorsSettings' + } + }, + push: { + required: false, + serializedName: 'push', + type: { + name: 'Composite', + className: 'PushSettings' + } + }, + apiDefinition: { + required: false, + serializedName: 'apiDefinition', + type: { + name: 'Composite', + className: 'ApiDefinitionInfo' + } + }, + autoSwapSlotName: { + required: false, + serializedName: 'autoSwapSlotName', + type: { + name: 'String' + } + }, + localMySqlEnabled: { + required: false, + serializedName: 'localMySqlEnabled', + defaultValue: false, + type: { + name: 'Boolean' + } + }, + managedServiceIdentityId: { + required: false, + serializedName: 'managedServiceIdentityId', + type: { + name: 'Number' + } + }, + xManagedServiceIdentityId: { + required: false, + serializedName: 'xManagedServiceIdentityId', + type: { + name: 'Number' + } + }, + ipSecurityRestrictions: { + required: false, + serializedName: 'ipSecurityRestrictions', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'IpSecurityRestrictionElementType', + type: { + name: 'Composite', + className: 'IpSecurityRestriction' + } + } + } + }, + http20Enabled: { + required: false, + serializedName: 'http20Enabled', + defaultValue: true, + type: { + name: 'Boolean' + } + }, + minTlsVersion: { + required: false, + serializedName: 'minTlsVersion', + type: { + name: 'String' + } + }, + ftpsState: { + required: false, + serializedName: 'ftpsState', + type: { + name: 'String' + } + }, + reservedInstanceCount: { + required: false, + serializedName: 'reservedInstanceCount', + constraints: { + InclusiveMaximum: 10, + InclusiveMinimum: 0 + }, + type: { + name: 'Number' + } + } + } + } + }; + } +} + +module.exports = SiteConfig; diff --git a/lib/services/websiteManagement2/lib/models/siteConfigResource.js b/lib/services/websiteManagement2/lib/models/siteConfigResource.js new file mode 100644 index 0000000000..bbfa3cc80c --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/siteConfigResource.js @@ -0,0 +1,645 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Web app configuration ARM resource. + * + * @extends models['ProxyOnlyResource'] + */ +class SiteConfigResource extends models['ProxyOnlyResource'] { + /** + * Create a SiteConfigResource. + * @member {number} [numberOfWorkers] Number of workers. + * @member {array} [defaultDocuments] Default documents. + * @member {string} [netFrameworkVersion] .NET Framework version. Default + * value: 'v4.6' . + * @member {string} [phpVersion] Version of PHP. + * @member {string} [pythonVersion] Version of Python. + * @member {string} [nodeVersion] Version of Node.js. + * @member {string} [linuxFxVersion] Linux App Framework and version + * @member {string} [windowsFxVersion] Xenon App Framework and version + * @member {boolean} [requestTracingEnabled] true if request + * tracing is enabled; otherwise, false. + * @member {date} [requestTracingExpirationTime] Request tracing expiration + * time. + * @member {boolean} [remoteDebuggingEnabled] true if remote + * debugging is enabled; otherwise, false. + * @member {string} [remoteDebuggingVersion] Remote debugging version. + * @member {boolean} [httpLoggingEnabled] true if HTTP logging + * is enabled; otherwise, false. + * @member {number} [logsDirectorySizeLimit] HTTP logs directory size limit. + * @member {boolean} [detailedErrorLoggingEnabled] true if + * detailed error logging is enabled; otherwise, false. + * @member {string} [publishingUsername] Publishing user name. + * @member {array} [appSettings] Application settings. + * @member {object} [azureStorageAccounts] User-provided Azure storage + * accounts. + * @member {array} [connectionStrings] Connection strings. + * @member {object} [machineKey] Site MachineKey. + * @member {string} [machineKey.validation] MachineKey validation. + * @member {string} [machineKey.validationKey] Validation key. + * @member {string} [machineKey.decryption] Algorithm used for decryption. + * @member {string} [machineKey.decryptionKey] Decryption key. + * @member {array} [handlerMappings] Handler mappings. + * @member {string} [documentRoot] Document root. + * @member {string} [scmType] SCM type. Possible values include: 'None', + * 'Dropbox', 'Tfs', 'LocalGit', 'GitHub', 'CodePlexGit', 'CodePlexHg', + * 'BitbucketGit', 'BitbucketHg', 'ExternalGit', 'ExternalHg', 'OneDrive', + * 'VSO' + * @member {boolean} [use32BitWorkerProcess] true to use 32-bit + * worker process; otherwise, false. + * @member {boolean} [webSocketsEnabled] true if WebSocket is + * enabled; otherwise, false. + * @member {boolean} [alwaysOn] true if Always On is enabled; + * otherwise, false. + * @member {string} [javaVersion] Java version. + * @member {string} [javaContainer] Java container. + * @member {string} [javaContainerVersion] Java container version. + * @member {string} [appCommandLine] App command line to launch. + * @member {string} [managedPipelineMode] Managed pipeline mode. Possible + * values include: 'Integrated', 'Classic' + * @member {array} [virtualApplications] Virtual applications. + * @member {string} [loadBalancing] Site load balancing. Possible values + * include: 'WeightedRoundRobin', 'LeastRequests', 'LeastResponseTime', + * 'WeightedTotalTraffic', 'RequestHash' + * @member {object} [experiments] This is work around for polymophic types. + * @member {array} [experiments.rampUpRules] List of ramp-up rules. + * @member {object} [limits] Site limits. + * @member {number} [limits.maxPercentageCpu] Maximum allowed CPU usage + * percentage. + * @member {number} [limits.maxMemoryInMb] Maximum allowed memory usage in + * MB. + * @member {number} [limits.maxDiskSizeInMb] Maximum allowed disk size usage + * in MB. + * @member {boolean} [autoHealEnabled] true if Auto Heal is + * enabled; otherwise, false. + * @member {object} [autoHealRules] Auto Heal rules. + * @member {object} [autoHealRules.triggers] Conditions that describe when to + * execute the auto-heal actions. + * @member {object} [autoHealRules.triggers.requests] A rule based on total + * requests. + * @member {number} [autoHealRules.triggers.requests.count] Request Count. + * @member {string} [autoHealRules.triggers.requests.timeInterval] Time + * interval. + * @member {number} [autoHealRules.triggers.privateBytesInKB] A rule based on + * private bytes. + * @member {array} [autoHealRules.triggers.statusCodes] A rule based on + * status codes. + * @member {object} [autoHealRules.triggers.slowRequests] A rule based on + * request execution time. + * @member {string} [autoHealRules.triggers.slowRequests.timeTaken] Time + * taken. + * @member {number} [autoHealRules.triggers.slowRequests.count] Request + * Count. + * @member {string} [autoHealRules.triggers.slowRequests.timeInterval] Time + * interval. + * @member {object} [autoHealRules.actions] Actions to be executed when a + * rule is triggered. + * @member {string} [autoHealRules.actions.actionType] Predefined action to + * be taken. Possible values include: 'Recycle', 'LogEvent', 'CustomAction' + * @member {object} [autoHealRules.actions.customAction] Custom action to be + * taken. + * @member {string} [autoHealRules.actions.customAction.exe] Executable to be + * run. + * @member {string} [autoHealRules.actions.customAction.parameters] + * Parameters for the executable. + * @member {string} [autoHealRules.actions.minProcessExecutionTime] Minimum + * time the process must execute + * before taking the action + * @member {string} [tracingOptions] Tracing options. + * @member {string} [vnetName] Virtual Network name. + * @member {object} [cors] Cross-Origin Resource Sharing (CORS) settings. + * @member {array} [cors.allowedOrigins] Gets or sets the list of origins + * that should be allowed to make cross-origin + * calls (for example: http://example.com:12345). Use "*" to allow all. + * @member {object} [push] Push endpoint settings. + * @member {boolean} [push.isPushEnabled] Gets or sets a flag indicating + * whether the Push endpoint is enabled. + * @member {string} [push.tagWhitelistJson] Gets or sets a JSON string + * containing a list of tags that are whitelisted for use by the push + * registration endpoint. + * @member {string} [push.tagsRequiringAuth] Gets or sets a JSON string + * containing a list of tags that require user authentication to be used in + * the push registration endpoint. + * Tags can consist of alphanumeric characters and the following: + * '_', '@', '#', '.', ':', '-'. + * Validation should be performed at the PushRequestHandler. + * @member {string} [push.dynamicTagsJson] Gets or sets a JSON string + * containing a list of dynamic tags that will be evaluated from user claims + * in the push registration endpoint. + * @member {object} [apiDefinition] Information about the formal API + * definition for the app. + * @member {string} [apiDefinition.url] The URL of the API definition. + * @member {string} [autoSwapSlotName] Auto-swap slot name. + * @member {boolean} [localMySqlEnabled] true to enable local + * MySQL; otherwise, false. Default value: false . + * @member {number} [managedServiceIdentityId] Managed Service Identity Id + * @member {number} [xManagedServiceIdentityId] Explicit Managed Service + * Identity Id + * @member {array} [ipSecurityRestrictions] IP security restrictions. + * @member {boolean} [http20Enabled] Http20Enabled: configures a web site to + * allow clients to connect over http2.0. Default value: true . + * @member {string} [minTlsVersion] MinTlsVersion: configures the minimum + * version of TLS required for SSL requests. Possible values include: '1.0', + * '1.1', '1.2' + * @member {string} [ftpsState] State of FTP / FTPS service. Possible values + * include: 'AllAllowed', 'FtpsOnly', 'Disabled' + * @member {number} [reservedInstanceCount] Number of reserved instances. + * This setting only applies to the Consumption Plan + */ + constructor() { + super(); + } + + /** + * Defines the metadata of SiteConfigResource + * + * @returns {object} metadata of SiteConfigResource + * + */ + mapper() { + return { + required: false, + serializedName: 'SiteConfigResource', + type: { + name: 'Composite', + className: 'SiteConfigResource', + 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' + } + }, + numberOfWorkers: { + required: false, + serializedName: 'properties.numberOfWorkers', + type: { + name: 'Number' + } + }, + defaultDocuments: { + required: false, + serializedName: 'properties.defaultDocuments', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + netFrameworkVersion: { + required: false, + serializedName: 'properties.netFrameworkVersion', + defaultValue: 'v4.6', + type: { + name: 'String' + } + }, + phpVersion: { + required: false, + serializedName: 'properties.phpVersion', + type: { + name: 'String' + } + }, + pythonVersion: { + required: false, + serializedName: 'properties.pythonVersion', + type: { + name: 'String' + } + }, + nodeVersion: { + required: false, + serializedName: 'properties.nodeVersion', + type: { + name: 'String' + } + }, + linuxFxVersion: { + required: false, + serializedName: 'properties.linuxFxVersion', + type: { + name: 'String' + } + }, + windowsFxVersion: { + required: false, + serializedName: 'properties.windowsFxVersion', + type: { + name: 'String' + } + }, + requestTracingEnabled: { + required: false, + serializedName: 'properties.requestTracingEnabled', + type: { + name: 'Boolean' + } + }, + requestTracingExpirationTime: { + required: false, + serializedName: 'properties.requestTracingExpirationTime', + type: { + name: 'DateTime' + } + }, + remoteDebuggingEnabled: { + required: false, + serializedName: 'properties.remoteDebuggingEnabled', + type: { + name: 'Boolean' + } + }, + remoteDebuggingVersion: { + required: false, + serializedName: 'properties.remoteDebuggingVersion', + type: { + name: 'String' + } + }, + httpLoggingEnabled: { + required: false, + serializedName: 'properties.httpLoggingEnabled', + type: { + name: 'Boolean' + } + }, + logsDirectorySizeLimit: { + required: false, + serializedName: 'properties.logsDirectorySizeLimit', + type: { + name: 'Number' + } + }, + detailedErrorLoggingEnabled: { + required: false, + serializedName: 'properties.detailedErrorLoggingEnabled', + type: { + name: 'Boolean' + } + }, + publishingUsername: { + required: false, + serializedName: 'properties.publishingUsername', + type: { + name: 'String' + } + }, + appSettings: { + required: false, + serializedName: 'properties.appSettings', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'NameValuePairElementType', + type: { + name: 'Composite', + className: 'NameValuePair' + } + } + } + }, + azureStorageAccounts: { + required: false, + serializedName: 'properties.azureStorageAccounts', + type: { + name: 'Dictionary', + value: { + required: false, + serializedName: 'AzureStorageInfoValueElementType', + type: { + name: 'Composite', + className: 'AzureStorageInfoValue' + } + } + } + }, + connectionStrings: { + required: false, + serializedName: 'properties.connectionStrings', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'ConnStringInfoElementType', + type: { + name: 'Composite', + className: 'ConnStringInfo' + } + } + } + }, + machineKey: { + required: false, + readOnly: true, + serializedName: 'properties.machineKey', + type: { + name: 'Composite', + className: 'SiteMachineKey' + } + }, + handlerMappings: { + required: false, + serializedName: 'properties.handlerMappings', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'HandlerMappingElementType', + type: { + name: 'Composite', + className: 'HandlerMapping' + } + } + } + }, + documentRoot: { + required: false, + serializedName: 'properties.documentRoot', + type: { + name: 'String' + } + }, + scmType: { + required: false, + serializedName: 'properties.scmType', + type: { + name: 'String' + } + }, + use32BitWorkerProcess: { + required: false, + serializedName: 'properties.use32BitWorkerProcess', + type: { + name: 'Boolean' + } + }, + webSocketsEnabled: { + required: false, + serializedName: 'properties.webSocketsEnabled', + type: { + name: 'Boolean' + } + }, + alwaysOn: { + required: false, + serializedName: 'properties.alwaysOn', + type: { + name: 'Boolean' + } + }, + javaVersion: { + required: false, + serializedName: 'properties.javaVersion', + type: { + name: 'String' + } + }, + javaContainer: { + required: false, + serializedName: 'properties.javaContainer', + type: { + name: 'String' + } + }, + javaContainerVersion: { + required: false, + serializedName: 'properties.javaContainerVersion', + type: { + name: 'String' + } + }, + appCommandLine: { + required: false, + serializedName: 'properties.appCommandLine', + type: { + name: 'String' + } + }, + managedPipelineMode: { + required: false, + serializedName: 'properties.managedPipelineMode', + type: { + name: 'Enum', + allowedValues: [ 'Integrated', 'Classic' ] + } + }, + virtualApplications: { + required: false, + serializedName: 'properties.virtualApplications', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'VirtualApplicationElementType', + type: { + name: 'Composite', + className: 'VirtualApplication' + } + } + } + }, + loadBalancing: { + required: false, + serializedName: 'properties.loadBalancing', + type: { + name: 'Enum', + allowedValues: [ 'WeightedRoundRobin', 'LeastRequests', 'LeastResponseTime', 'WeightedTotalTraffic', 'RequestHash' ] + } + }, + experiments: { + required: false, + serializedName: 'properties.experiments', + type: { + name: 'Composite', + className: 'Experiments' + } + }, + limits: { + required: false, + serializedName: 'properties.limits', + type: { + name: 'Composite', + className: 'SiteLimits' + } + }, + autoHealEnabled: { + required: false, + serializedName: 'properties.autoHealEnabled', + type: { + name: 'Boolean' + } + }, + autoHealRules: { + required: false, + serializedName: 'properties.autoHealRules', + type: { + name: 'Composite', + className: 'AutoHealRules' + } + }, + tracingOptions: { + required: false, + serializedName: 'properties.tracingOptions', + type: { + name: 'String' + } + }, + vnetName: { + required: false, + serializedName: 'properties.vnetName', + type: { + name: 'String' + } + }, + cors: { + required: false, + serializedName: 'properties.cors', + type: { + name: 'Composite', + className: 'CorsSettings' + } + }, + push: { + required: false, + serializedName: 'properties.push', + type: { + name: 'Composite', + className: 'PushSettings' + } + }, + apiDefinition: { + required: false, + serializedName: 'properties.apiDefinition', + type: { + name: 'Composite', + className: 'ApiDefinitionInfo' + } + }, + autoSwapSlotName: { + required: false, + serializedName: 'properties.autoSwapSlotName', + type: { + name: 'String' + } + }, + localMySqlEnabled: { + required: false, + serializedName: 'properties.localMySqlEnabled', + defaultValue: false, + type: { + name: 'Boolean' + } + }, + managedServiceIdentityId: { + required: false, + serializedName: 'properties.managedServiceIdentityId', + type: { + name: 'Number' + } + }, + xManagedServiceIdentityId: { + required: false, + serializedName: 'properties.xManagedServiceIdentityId', + type: { + name: 'Number' + } + }, + ipSecurityRestrictions: { + required: false, + serializedName: 'properties.ipSecurityRestrictions', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'IpSecurityRestrictionElementType', + type: { + name: 'Composite', + className: 'IpSecurityRestriction' + } + } + } + }, + http20Enabled: { + required: false, + serializedName: 'properties.http20Enabled', + defaultValue: true, + type: { + name: 'Boolean' + } + }, + minTlsVersion: { + required: false, + serializedName: 'properties.minTlsVersion', + type: { + name: 'String' + } + }, + ftpsState: { + required: false, + serializedName: 'properties.ftpsState', + type: { + name: 'String' + } + }, + reservedInstanceCount: { + required: false, + serializedName: 'properties.reservedInstanceCount', + constraints: { + InclusiveMaximum: 10, + InclusiveMinimum: 0 + }, + type: { + name: 'Number' + } + } + } + } + }; + } +} + +module.exports = SiteConfigResource; diff --git a/lib/services/websiteManagement2/lib/models/siteConfigurationSnapshotInfo.js b/lib/services/websiteManagement2/lib/models/siteConfigurationSnapshotInfo.js new file mode 100644 index 0000000000..1317cb4e81 --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/siteConfigurationSnapshotInfo.js @@ -0,0 +1,97 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * A snapshot of a web app configuration. + * + * @extends models['ProxyOnlyResource'] + */ +class SiteConfigurationSnapshotInfo extends models['ProxyOnlyResource'] { + /** + * Create a SiteConfigurationSnapshotInfo. + * @member {date} [time] The time the snapshot was taken. + * @member {number} [snapshotId] The id of the snapshot + */ + constructor() { + super(); + } + + /** + * Defines the metadata of SiteConfigurationSnapshotInfo + * + * @returns {object} metadata of SiteConfigurationSnapshotInfo + * + */ + mapper() { + return { + required: false, + serializedName: 'SiteConfigurationSnapshotInfo', + type: { + name: 'Composite', + className: 'SiteConfigurationSnapshotInfo', + 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' + } + }, + time: { + required: false, + readOnly: true, + serializedName: 'properties.time', + type: { + name: 'DateTime' + } + }, + snapshotId: { + required: false, + readOnly: true, + serializedName: 'properties.snapshotId', + type: { + name: 'Number' + } + } + } + } + }; + } +} + +module.exports = SiteConfigurationSnapshotInfo; diff --git a/lib/services/websiteManagement2/lib/models/siteExtensionInfo.js b/lib/services/websiteManagement2/lib/models/siteExtensionInfo.js new file mode 100644 index 0000000000..a0293ee225 --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/siteExtensionInfo.js @@ -0,0 +1,250 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Site Extension Information. + * + * @extends models['ProxyOnlyResource'] + */ +class SiteExtensionInfo extends models['ProxyOnlyResource'] { + /** + * Create a SiteExtensionInfo. + * @member {string} [extensionId] Site extension ID. + * @member {string} [title] + * @member {string} [extensionType] Site extension type. Possible values + * include: 'Gallery', 'WebRoot' + * @member {string} [summary] Summary description. + * @member {string} [description] Detailed description. + * @member {string} [version] Version information. + * @member {string} [extensionUrl] Extension URL. + * @member {string} [projectUrl] Project URL. + * @member {string} [iconUrl] Icon URL. + * @member {string} [licenseUrl] License URL. + * @member {string} [feedUrl] Feed URL. + * @member {array} [authors] List of authors. + * @member {string} [installerCommandLineParams] Installer command line + * parameters. + * @member {date} [publishedDateTime] Published timestamp. + * @member {number} [downloadCount] Count of downloads. + * @member {boolean} [localIsLatestVersion] true if the local + * version is the latest version; false otherwise. + * @member {string} [localPath] Local path. + * @member {date} [installedDateTime] Installed timestamp. + * @member {string} [provisioningState] Provisioning state. + * @member {string} [comment] Site Extension comment. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of SiteExtensionInfo + * + * @returns {object} metadata of SiteExtensionInfo + * + */ + mapper() { + return { + required: false, + serializedName: 'SiteExtensionInfo', + type: { + name: 'Composite', + className: 'SiteExtensionInfo', + 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' + } + }, + extensionId: { + required: false, + serializedName: 'properties.extension_id', + type: { + name: 'String' + } + }, + title: { + required: false, + serializedName: 'properties.title', + type: { + name: 'String' + } + }, + extensionType: { + required: false, + serializedName: 'properties.extension_type', + type: { + name: 'Enum', + allowedValues: [ 'Gallery', 'WebRoot' ] + } + }, + summary: { + required: false, + serializedName: 'properties.summary', + type: { + name: 'String' + } + }, + description: { + required: false, + serializedName: 'properties.description', + type: { + name: 'String' + } + }, + version: { + required: false, + serializedName: 'properties.version', + type: { + name: 'String' + } + }, + extensionUrl: { + required: false, + serializedName: 'properties.extension_url', + type: { + name: 'String' + } + }, + projectUrl: { + required: false, + serializedName: 'properties.project_url', + type: { + name: 'String' + } + }, + iconUrl: { + required: false, + serializedName: 'properties.icon_url', + type: { + name: 'String' + } + }, + licenseUrl: { + required: false, + serializedName: 'properties.license_url', + type: { + name: 'String' + } + }, + feedUrl: { + required: false, + serializedName: 'properties.feed_url', + type: { + name: 'String' + } + }, + authors: { + required: false, + serializedName: 'properties.authors', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + installerCommandLineParams: { + required: false, + serializedName: 'properties.installer_command_line_params', + type: { + name: 'String' + } + }, + publishedDateTime: { + required: false, + serializedName: 'properties.published_date_time', + type: { + name: 'DateTime' + } + }, + downloadCount: { + required: false, + serializedName: 'properties.download_count', + type: { + name: 'Number' + } + }, + localIsLatestVersion: { + required: false, + serializedName: 'properties.local_is_latest_version', + type: { + name: 'Boolean' + } + }, + localPath: { + required: false, + serializedName: 'properties.local_path', + type: { + name: 'String' + } + }, + installedDateTime: { + required: false, + serializedName: 'properties.installed_date_time', + type: { + name: 'DateTime' + } + }, + provisioningState: { + required: false, + serializedName: 'properties.provisioningState', + type: { + name: 'String' + } + }, + comment: { + required: false, + serializedName: 'properties.comment', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = SiteExtensionInfo; diff --git a/lib/services/websiteManagement2/lib/models/siteInstance.js b/lib/services/websiteManagement2/lib/models/siteInstance.js new file mode 100644 index 0000000000..72635c8844 --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/siteInstance.js @@ -0,0 +1,88 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Instance of an app. + * + * @extends models['ProxyOnlyResource'] + */ +class SiteInstance extends models['ProxyOnlyResource'] { + /** + * Create a SiteInstance. + * @member {string} [siteInstanceName] Name of instance. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of SiteInstance + * + * @returns {object} metadata of SiteInstance + * + */ + mapper() { + return { + required: false, + serializedName: 'SiteInstance', + type: { + name: 'Composite', + className: 'SiteInstance', + 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' + } + }, + siteInstanceName: { + required: false, + readOnly: true, + serializedName: 'properties.siteInstanceName', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = SiteInstance; diff --git a/lib/services/websiteManagement2/lib/models/sitePatchResource.js b/lib/services/websiteManagement2/lib/models/sitePatchResource.js new file mode 100644 index 0000000000..39de10c15e --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/sitePatchResource.js @@ -0,0 +1,635 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * ARM resource for a site. + * + * @extends models['ProxyOnlyResource'] + */ +class SitePatchResource extends models['ProxyOnlyResource'] { + /** + * Create a SitePatchResource. + * @member {string} [state] Current state of the app. + * @member {array} [hostNames] Hostnames associated with the app. + * @member {string} [repositorySiteName] Name of the repository site. + * @member {string} [usageState] State indicating whether the app has + * exceeded its quota usage. Read-only. Possible values include: 'Normal', + * 'Exceeded' + * @member {boolean} [enabled] true if the app is enabled; + * otherwise, false. Setting this value to false disables the + * app (takes the app offline). + * @member {array} [enabledHostNames] Enabled hostnames for the app.Hostnames + * need to be assigned (see HostNames) AND enabled. Otherwise, + * the app is not served on those hostnames. + * @member {string} [availabilityState] Management information availability + * state for the app. Possible values include: 'Normal', 'Limited', + * 'DisasterRecoveryMode' + * @member {array} [hostNameSslStates] Hostname SSL states are used to manage + * the SSL bindings for app's hostnames. + * @member {string} [serverFarmId] Resource ID of the associated App Service + * plan, formatted as: + * "/subscriptions/{subscriptionID}/resourceGroups/{groupName}/providers/Microsoft.Web/serverfarms/{appServicePlanName}". + * @member {boolean} [reserved] true if reserved; otherwise, + * false. Default value: false . + * @member {boolean} [isXenon] Obsolete: Hyper-V sandbox. Default value: + * false . + * @member {boolean} [hyperV] Hyper-V sandbox. Default value: false . + * @member {date} [lastModifiedTimeUtc] Last time the app was modified, in + * UTC. Read-only. + * @member {object} [siteConfig] Configuration of the app. + * @member {number} [siteConfig.numberOfWorkers] Number of workers. + * @member {array} [siteConfig.defaultDocuments] Default documents. + * @member {string} [siteConfig.netFrameworkVersion] .NET Framework version. + * @member {string} [siteConfig.phpVersion] Version of PHP. + * @member {string} [siteConfig.pythonVersion] Version of Python. + * @member {string} [siteConfig.nodeVersion] Version of Node.js. + * @member {string} [siteConfig.linuxFxVersion] Linux App Framework and + * version + * @member {string} [siteConfig.windowsFxVersion] Xenon App Framework and + * version + * @member {boolean} [siteConfig.requestTracingEnabled] true if + * request tracing is enabled; otherwise, false. + * @member {date} [siteConfig.requestTracingExpirationTime] Request tracing + * expiration time. + * @member {boolean} [siteConfig.remoteDebuggingEnabled] true if + * remote debugging is enabled; otherwise, false. + * @member {string} [siteConfig.remoteDebuggingVersion] Remote debugging + * version. + * @member {boolean} [siteConfig.httpLoggingEnabled] true if + * HTTP logging is enabled; otherwise, false. + * @member {number} [siteConfig.logsDirectorySizeLimit] HTTP logs directory + * size limit. + * @member {boolean} [siteConfig.detailedErrorLoggingEnabled] + * true if detailed error logging is enabled; otherwise, + * false. + * @member {string} [siteConfig.publishingUsername] Publishing user name. + * @member {array} [siteConfig.appSettings] Application settings. + * @member {object} [siteConfig.azureStorageAccounts] User-provided Azure + * storage accounts. + * @member {array} [siteConfig.connectionStrings] Connection strings. + * @member {object} [siteConfig.machineKey] Site MachineKey. + * @member {string} [siteConfig.machineKey.validation] MachineKey validation. + * @member {string} [siteConfig.machineKey.validationKey] Validation key. + * @member {string} [siteConfig.machineKey.decryption] Algorithm used for + * decryption. + * @member {string} [siteConfig.machineKey.decryptionKey] Decryption key. + * @member {array} [siteConfig.handlerMappings] Handler mappings. + * @member {string} [siteConfig.documentRoot] Document root. + * @member {string} [siteConfig.scmType] SCM type. Possible values include: + * 'None', 'Dropbox', 'Tfs', 'LocalGit', 'GitHub', 'CodePlexGit', + * 'CodePlexHg', 'BitbucketGit', 'BitbucketHg', 'ExternalGit', 'ExternalHg', + * 'OneDrive', 'VSO' + * @member {boolean} [siteConfig.use32BitWorkerProcess] true to + * use 32-bit worker process; otherwise, false. + * @member {boolean} [siteConfig.webSocketsEnabled] true if + * WebSocket is enabled; otherwise, false. + * @member {boolean} [siteConfig.alwaysOn] true if Always On is + * enabled; otherwise, false. + * @member {string} [siteConfig.javaVersion] Java version. + * @member {string} [siteConfig.javaContainer] Java container. + * @member {string} [siteConfig.javaContainerVersion] Java container version. + * @member {string} [siteConfig.appCommandLine] App command line to launch. + * @member {string} [siteConfig.managedPipelineMode] Managed pipeline mode. + * Possible values include: 'Integrated', 'Classic' + * @member {array} [siteConfig.virtualApplications] Virtual applications. + * @member {string} [siteConfig.loadBalancing] Site load balancing. Possible + * values include: 'WeightedRoundRobin', 'LeastRequests', + * 'LeastResponseTime', 'WeightedTotalTraffic', 'RequestHash' + * @member {object} [siteConfig.experiments] This is work around for + * polymophic types. + * @member {array} [siteConfig.experiments.rampUpRules] List of ramp-up + * rules. + * @member {object} [siteConfig.limits] Site limits. + * @member {number} [siteConfig.limits.maxPercentageCpu] Maximum allowed CPU + * usage percentage. + * @member {number} [siteConfig.limits.maxMemoryInMb] Maximum allowed memory + * usage in MB. + * @member {number} [siteConfig.limits.maxDiskSizeInMb] Maximum allowed disk + * size usage in MB. + * @member {boolean} [siteConfig.autoHealEnabled] true if Auto + * Heal is enabled; otherwise, false. + * @member {object} [siteConfig.autoHealRules] Auto Heal rules. + * @member {object} [siteConfig.autoHealRules.triggers] Conditions that + * describe when to execute the auto-heal actions. + * @member {object} [siteConfig.autoHealRules.triggers.requests] A rule based + * on total requests. + * @member {number} [siteConfig.autoHealRules.triggers.requests.count] + * Request Count. + * @member {string} [siteConfig.autoHealRules.triggers.requests.timeInterval] + * Time interval. + * @member {number} [siteConfig.autoHealRules.triggers.privateBytesInKB] A + * rule based on private bytes. + * @member {array} [siteConfig.autoHealRules.triggers.statusCodes] A rule + * based on status codes. + * @member {object} [siteConfig.autoHealRules.triggers.slowRequests] A rule + * based on request execution time. + * @member {string} + * [siteConfig.autoHealRules.triggers.slowRequests.timeTaken] Time taken. + * @member {number} [siteConfig.autoHealRules.triggers.slowRequests.count] + * Request Count. + * @member {string} + * [siteConfig.autoHealRules.triggers.slowRequests.timeInterval] Time + * interval. + * @member {object} [siteConfig.autoHealRules.actions] Actions to be executed + * when a rule is triggered. + * @member {string} [siteConfig.autoHealRules.actions.actionType] Predefined + * action to be taken. Possible values include: 'Recycle', 'LogEvent', + * 'CustomAction' + * @member {object} [siteConfig.autoHealRules.actions.customAction] Custom + * action to be taken. + * @member {string} [siteConfig.autoHealRules.actions.customAction.exe] + * Executable to be run. + * @member {string} + * [siteConfig.autoHealRules.actions.customAction.parameters] Parameters for + * the executable. + * @member {string} + * [siteConfig.autoHealRules.actions.minProcessExecutionTime] Minimum time + * the process must execute + * before taking the action + * @member {string} [siteConfig.tracingOptions] Tracing options. + * @member {string} [siteConfig.vnetName] Virtual Network name. + * @member {object} [siteConfig.cors] Cross-Origin Resource Sharing (CORS) + * settings. + * @member {array} [siteConfig.cors.allowedOrigins] Gets or sets the list of + * origins that should be allowed to make cross-origin + * calls (for example: http://example.com:12345). Use "*" to allow all. + * @member {object} [siteConfig.push] Push endpoint settings. + * @member {boolean} [siteConfig.push.isPushEnabled] Gets or sets a flag + * indicating whether the Push endpoint is enabled. + * @member {string} [siteConfig.push.tagWhitelistJson] Gets or sets a JSON + * string containing a list of tags that are whitelisted for use by the push + * registration endpoint. + * @member {string} [siteConfig.push.tagsRequiringAuth] Gets or sets a JSON + * string containing a list of tags that require user authentication to be + * used in the push registration endpoint. + * Tags can consist of alphanumeric characters and the following: + * '_', '@', '#', '.', ':', '-'. + * Validation should be performed at the PushRequestHandler. + * @member {string} [siteConfig.push.dynamicTagsJson] Gets or sets a JSON + * string containing a list of dynamic tags that will be evaluated from user + * claims in the push registration endpoint. + * @member {object} [siteConfig.apiDefinition] Information about the formal + * API definition for the app. + * @member {string} [siteConfig.apiDefinition.url] The URL of the API + * definition. + * @member {string} [siteConfig.autoSwapSlotName] Auto-swap slot name. + * @member {boolean} [siteConfig.localMySqlEnabled] true to + * enable local MySQL; otherwise, false. + * @member {number} [siteConfig.managedServiceIdentityId] Managed Service + * Identity Id + * @member {number} [siteConfig.xManagedServiceIdentityId] Explicit Managed + * Service Identity Id + * @member {array} [siteConfig.ipSecurityRestrictions] IP security + * restrictions. + * @member {boolean} [siteConfig.http20Enabled] Http20Enabled: configures a + * web site to allow clients to connect over http2.0 + * @member {string} [siteConfig.minTlsVersion] MinTlsVersion: configures the + * minimum version of TLS required for SSL requests. Possible values include: + * '1.0', '1.1', '1.2' + * @member {string} [siteConfig.ftpsState] State of FTP / FTPS service. + * Possible values include: 'AllAllowed', 'FtpsOnly', 'Disabled' + * @member {number} [siteConfig.reservedInstanceCount] Number of reserved + * instances. + * This setting only applies to the Consumption Plan + * @member {array} [trafficManagerHostNames] Azure Traffic Manager hostnames + * associated with the app. Read-only. + * @member {boolean} [scmSiteAlsoStopped] true to stop SCM + * (KUDU) site when the app is stopped; otherwise, false. The + * default is false. Default value: false . + * @member {string} [targetSwapSlot] Specifies which deployment slot this app + * will swap into. Read-only. + * @member {object} [hostingEnvironmentProfile] App Service Environment to + * use for the app. + * @member {string} [hostingEnvironmentProfile.id] Resource ID of the App + * Service Environment. + * @member {string} [hostingEnvironmentProfile.name] Name of the App Service + * Environment. + * @member {string} [hostingEnvironmentProfile.type] Resource type of the App + * Service Environment. + * @member {boolean} [clientAffinityEnabled] true to enable + * client affinity; false to stop sending session affinity + * cookies, which route client requests in the same session to the same + * instance. Default is true. + * @member {boolean} [clientCertEnabled] true to enable client + * certificate authentication (TLS mutual authentication); otherwise, + * false. Default is false. + * @member {boolean} [hostNamesDisabled] true to disable the + * public hostnames of the app; otherwise, false. + * If true, the app is only accessible via API management + * process. + * @member {string} [outboundIpAddresses] List of IP addresses that the app + * uses for outbound connections (e.g. database access). Includes VIPs from + * tenants that site can be hosted with current settings. Read-only. + * @member {string} [possibleOutboundIpAddresses] List of IP addresses that + * the app uses for outbound connections (e.g. database access). Includes + * VIPs from all tenants. Read-only. + * @member {number} [containerSize] Size of the function container. + * @member {number} [dailyMemoryTimeQuota] Maximum allowed daily memory-time + * quota (applicable on dynamic apps only). + * @member {date} [suspendedTill] App suspended till in case memory-time + * quota is exceeded. + * @member {number} [maxNumberOfWorkers] Maximum number of workers. + * This only applies to Functions container. + * @member {object} [cloningInfo] If specified during app creation, the app + * is cloned from a source app. + * @member {uuid} [cloningInfo.correlationId] Correlation ID of cloning + * operation. This ID ties multiple cloning operations + * together to use the same snapshot. + * @member {boolean} [cloningInfo.overwrite] true to overwrite + * destination app; otherwise, false. + * @member {boolean} [cloningInfo.cloneCustomHostNames] true to + * clone custom hostnames from source app; otherwise, false. + * @member {boolean} [cloningInfo.cloneSourceControl] true to + * clone source control from source app; otherwise, false. + * @member {string} [cloningInfo.sourceWebAppId] ARM resource ID of the + * source app. App resource ID is of the form + * /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName} + * for production slots and + * /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/slots/{slotName} + * for other slots. + * @member {string} [cloningInfo.hostingEnvironment] App Service Environment. + * @member {object} [cloningInfo.appSettingsOverrides] Application setting + * overrides for cloned app. If specified, these settings override the + * settings cloned + * from source app. Otherwise, application settings from source app are + * retained. + * @member {boolean} [cloningInfo.configureLoadBalancing] true + * to configure load balancing for source and destination app. + * @member {string} [cloningInfo.trafficManagerProfileId] ARM resource ID of + * the Traffic Manager profile to use, if it exists. Traffic Manager resource + * ID is of the form + * /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/trafficManagerProfiles/{profileName}. + * @member {string} [cloningInfo.trafficManagerProfileName] Name of Traffic + * Manager profile to create. This is only needed if Traffic Manager profile + * does not already exist. + * @member {string} [resourceGroup] Name of the resource group the app + * belongs to. Read-only. + * @member {boolean} [isDefaultContainer] true if the app is a + * default container; otherwise, false. + * @member {string} [defaultHostName] Default hostname of the app. Read-only. + * @member {object} [slotSwapStatus] Status of the last deployment slot swap + * operation. + * @member {date} [slotSwapStatus.timestampUtc] The time the last successful + * slot swap completed. + * @member {string} [slotSwapStatus.sourceSlotName] The source slot of the + * last swap operation. + * @member {string} [slotSwapStatus.destinationSlotName] The destination slot + * of the last swap operation. + * @member {boolean} [httpsOnly] HttpsOnly: configures a web site to accept + * only https requests. Issues redirect for + * http requests + */ + constructor() { + super(); + } + + /** + * Defines the metadata of SitePatchResource + * + * @returns {object} metadata of SitePatchResource + * + */ + mapper() { + return { + required: false, + serializedName: 'SitePatchResource', + type: { + name: 'Composite', + className: 'SitePatchResource', + 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' + } + }, + state: { + required: false, + readOnly: true, + serializedName: 'properties.state', + type: { + name: 'String' + } + }, + hostNames: { + required: false, + readOnly: true, + serializedName: 'properties.hostNames', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + repositorySiteName: { + required: false, + readOnly: true, + serializedName: 'properties.repositorySiteName', + type: { + name: 'String' + } + }, + usageState: { + required: false, + readOnly: true, + serializedName: 'properties.usageState', + type: { + name: 'Enum', + allowedValues: [ 'Normal', 'Exceeded' ] + } + }, + enabled: { + required: false, + serializedName: 'properties.enabled', + type: { + name: 'Boolean' + } + }, + enabledHostNames: { + required: false, + readOnly: true, + serializedName: 'properties.enabledHostNames', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + availabilityState: { + required: false, + readOnly: true, + serializedName: 'properties.availabilityState', + type: { + name: 'Enum', + allowedValues: [ 'Normal', 'Limited', 'DisasterRecoveryMode' ] + } + }, + hostNameSslStates: { + required: false, + serializedName: 'properties.hostNameSslStates', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'HostNameSslStateElementType', + type: { + name: 'Composite', + className: 'HostNameSslState' + } + } + } + }, + serverFarmId: { + required: false, + serializedName: 'properties.serverFarmId', + type: { + name: 'String' + } + }, + reserved: { + required: false, + serializedName: 'properties.reserved', + defaultValue: false, + type: { + name: 'Boolean' + } + }, + isXenon: { + required: false, + serializedName: 'properties.isXenon', + defaultValue: false, + type: { + name: 'Boolean' + } + }, + hyperV: { + required: false, + serializedName: 'properties.hyperV', + defaultValue: false, + type: { + name: 'Boolean' + } + }, + lastModifiedTimeUtc: { + required: false, + readOnly: true, + serializedName: 'properties.lastModifiedTimeUtc', + type: { + name: 'DateTime' + } + }, + siteConfig: { + required: false, + serializedName: 'properties.siteConfig', + type: { + name: 'Composite', + className: 'SiteConfig' + } + }, + trafficManagerHostNames: { + required: false, + readOnly: true, + serializedName: 'properties.trafficManagerHostNames', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + scmSiteAlsoStopped: { + required: false, + serializedName: 'properties.scmSiteAlsoStopped', + defaultValue: false, + type: { + name: 'Boolean' + } + }, + targetSwapSlot: { + required: false, + readOnly: true, + serializedName: 'properties.targetSwapSlot', + type: { + name: 'String' + } + }, + hostingEnvironmentProfile: { + required: false, + serializedName: 'properties.hostingEnvironmentProfile', + type: { + name: 'Composite', + className: 'HostingEnvironmentProfile' + } + }, + clientAffinityEnabled: { + required: false, + serializedName: 'properties.clientAffinityEnabled', + type: { + name: 'Boolean' + } + }, + clientCertEnabled: { + required: false, + serializedName: 'properties.clientCertEnabled', + type: { + name: 'Boolean' + } + }, + hostNamesDisabled: { + required: false, + serializedName: 'properties.hostNamesDisabled', + type: { + name: 'Boolean' + } + }, + outboundIpAddresses: { + required: false, + readOnly: true, + serializedName: 'properties.outboundIpAddresses', + type: { + name: 'String' + } + }, + possibleOutboundIpAddresses: { + required: false, + readOnly: true, + serializedName: 'properties.possibleOutboundIpAddresses', + type: { + name: 'String' + } + }, + containerSize: { + required: false, + serializedName: 'properties.containerSize', + type: { + name: 'Number' + } + }, + dailyMemoryTimeQuota: { + required: false, + serializedName: 'properties.dailyMemoryTimeQuota', + type: { + name: 'Number' + } + }, + suspendedTill: { + required: false, + readOnly: true, + serializedName: 'properties.suspendedTill', + type: { + name: 'DateTime' + } + }, + maxNumberOfWorkers: { + required: false, + readOnly: true, + serializedName: 'properties.maxNumberOfWorkers', + type: { + name: 'Number' + } + }, + cloningInfo: { + required: false, + serializedName: 'properties.cloningInfo', + type: { + name: 'Composite', + className: 'CloningInfo' + } + }, + resourceGroup: { + required: false, + readOnly: true, + serializedName: 'properties.resourceGroup', + type: { + name: 'String' + } + }, + isDefaultContainer: { + required: false, + readOnly: true, + serializedName: 'properties.isDefaultContainer', + type: { + name: 'Boolean' + } + }, + defaultHostName: { + required: false, + readOnly: true, + serializedName: 'properties.defaultHostName', + type: { + name: 'String' + } + }, + slotSwapStatus: { + required: false, + readOnly: true, + serializedName: 'properties.slotSwapStatus', + type: { + name: 'Composite', + className: 'SlotSwapStatus' + } + }, + httpsOnly: { + required: false, + serializedName: 'properties.httpsOnly', + type: { + name: 'Boolean' + } + } + } + } + }; + } +} + +module.exports = SitePatchResource; diff --git a/lib/services/websiteManagement2/lib/models/skuDescription.js b/lib/services/websiteManagement2/lib/models/skuDescription.js index 25c3b62002..ae5f70eaaf 100644 --- a/lib/services/websiteManagement2/lib/models/skuDescription.js +++ b/lib/services/websiteManagement2/lib/models/skuDescription.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * Description of a SKU for a scalable resource. * diff --git a/lib/services/websiteManagement2/lib/models/skuInfo.js b/lib/services/websiteManagement2/lib/models/skuInfo.js index ccf4d0de83..1af7a35617 100644 --- a/lib/services/websiteManagement2/lib/models/skuInfo.js +++ b/lib/services/websiteManagement2/lib/models/skuInfo.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * SKU discovery information. * diff --git a/lib/services/websiteManagement2/lib/models/skuInfos.js b/lib/services/websiteManagement2/lib/models/skuInfos.js index 229a953e50..30d2ba0b63 100644 --- a/lib/services/websiteManagement2/lib/models/skuInfos.js +++ b/lib/services/websiteManagement2/lib/models/skuInfos.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * Collection of SKU information. * diff --git a/lib/services/websiteManagement2/lib/models/slotConfigNamesResource.js b/lib/services/websiteManagement2/lib/models/slotConfigNamesResource.js index e64eb91f19..7bdcaa83e2 100644 --- a/lib/services/websiteManagement2/lib/models/slotConfigNamesResource.js +++ b/lib/services/websiteManagement2/lib/models/slotConfigNamesResource.js @@ -22,6 +22,8 @@ class SlotConfigNamesResource extends models['ProxyOnlyResource'] { * Create a SlotConfigNamesResource. * @member {array} [connectionStringNames] List of connection string names. * @member {array} [appSettingNames] List of application settings names. + * @member {array} [azureStorageConfigNames] List of external Azure storage + * account identifiers. */ constructor() { super(); @@ -99,6 +101,20 @@ class SlotConfigNamesResource extends models['ProxyOnlyResource'] { } } } + }, + azureStorageConfigNames: { + required: false, + serializedName: 'properties.azureStorageConfigNames', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } } } } diff --git a/lib/services/websiteManagement2/lib/models/slotDifference.js b/lib/services/websiteManagement2/lib/models/slotDifference.js new file mode 100644 index 0000000000..49d154fc4c --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/slotDifference.js @@ -0,0 +1,147 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * A setting difference between two deployment slots of an app. + * + * @extends models['ProxyOnlyResource'] + */ +class SlotDifference extends models['ProxyOnlyResource'] { + /** + * Create a SlotDifference. + * @member {string} [level] Level of the difference: Information, Warning or + * Error. + * @member {string} [settingType] The type of the setting: General, + * AppSetting or ConnectionString. + * @member {string} [diffRule] Rule that describes how to process the setting + * difference during a slot swap. + * @member {string} [settingName] Name of the setting. + * @member {string} [valueInCurrentSlot] Value of the setting in the current + * slot. + * @member {string} [valueInTargetSlot] Value of the setting in the target + * slot. + * @member {string} [description] Description of the setting difference. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of SlotDifference + * + * @returns {object} metadata of SlotDifference + * + */ + mapper() { + return { + required: false, + serializedName: 'SlotDifference', + type: { + name: 'Composite', + className: 'SlotDifference', + 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' + } + }, + level: { + required: false, + readOnly: true, + serializedName: 'properties.level', + type: { + name: 'String' + } + }, + settingType: { + required: false, + readOnly: true, + serializedName: 'properties.settingType', + type: { + name: 'String' + } + }, + diffRule: { + required: false, + readOnly: true, + serializedName: 'properties.diffRule', + type: { + name: 'String' + } + }, + settingName: { + required: false, + readOnly: true, + serializedName: 'properties.settingName', + type: { + name: 'String' + } + }, + valueInCurrentSlot: { + required: false, + readOnly: true, + serializedName: 'properties.valueInCurrentSlot', + type: { + name: 'String' + } + }, + valueInTargetSlot: { + required: false, + readOnly: true, + serializedName: 'properties.valueInTargetSlot', + type: { + name: 'String' + } + }, + description: { + required: false, + readOnly: true, + serializedName: 'properties.description', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = SlotDifference; diff --git a/lib/services/websiteManagement2/lib/models/solution.js b/lib/services/websiteManagement2/lib/models/solution.js index 1b42d6409a..31d4126612 100644 --- a/lib/services/websiteManagement2/lib/models/solution.js +++ b/lib/services/websiteManagement2/lib/models/solution.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * Class Representing Solution for problems detected. * diff --git a/lib/services/websiteManagement2/lib/models/sourceControl.js b/lib/services/websiteManagement2/lib/models/sourceControl.js new file mode 100644 index 0000000000..3e7a294e88 --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/sourceControl.js @@ -0,0 +1,111 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * The source control OAuth token. + * + * @extends models['ProxyOnlyResource'] + */ +class SourceControl extends models['ProxyOnlyResource'] { + /** + * Create a SourceControl. + * @member {string} [token] OAuth access token. + * @member {string} [tokenSecret] OAuth access token secret. + * @member {string} [refreshToken] OAuth refresh token. + * @member {date} [expirationTime] OAuth token expiration. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of SourceControl + * + * @returns {object} metadata of SourceControl + * + */ + mapper() { + return { + required: false, + serializedName: 'SourceControl', + type: { + name: 'Composite', + className: 'SourceControl', + 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' + } + }, + token: { + required: false, + serializedName: 'properties.token', + type: { + name: 'String' + } + }, + tokenSecret: { + required: false, + serializedName: 'properties.tokenSecret', + type: { + name: 'String' + } + }, + refreshToken: { + required: false, + serializedName: 'properties.refreshToken', + type: { + name: 'String' + } + }, + expirationTime: { + required: false, + serializedName: 'properties.expirationTime', + type: { + name: 'DateTime' + } + } + } + } + }; + } +} + +module.exports = SourceControl; diff --git a/lib/services/websiteManagement2/lib/models/stackMajorVersion.js b/lib/services/websiteManagement2/lib/models/stackMajorVersion.js index f8a3e54984..6e76522dfb 100644 --- a/lib/services/websiteManagement2/lib/models/stackMajorVersion.js +++ b/lib/services/websiteManagement2/lib/models/stackMajorVersion.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * Application stack major version. * diff --git a/lib/services/websiteManagement2/lib/models/stampCapacity.js b/lib/services/websiteManagement2/lib/models/stampCapacity.js new file mode 100644 index 0000000000..9227735918 --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/stampCapacity.js @@ -0,0 +1,144 @@ +/* + * 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'; + +/** + * Stamp capacity information. + * + */ +class StampCapacity { + /** + * Create a StampCapacity. + * @member {string} [name] Name of the stamp. + * @member {number} [availableCapacity] Available capacity (# of machines, + * bytes of storage etc...). + * @member {number} [totalCapacity] Total capacity (# of machines, bytes of + * storage etc...). + * @member {string} [unit] Name of the unit. + * @member {string} [computeMode] Shared/dedicated workers. Possible values + * include: 'Shared', 'Dedicated', 'Dynamic' + * @member {string} [workerSize] Size of the machines. Possible values + * include: 'Small', 'Medium', 'Large', 'D1', 'D2', 'D3', 'Default' + * @member {number} [workerSizeId] Size ID of machines: + * 0 - Small + * 1 - Medium + * 2 - Large + * @member {boolean} [excludeFromCapacityAllocation] If true, it + * includes basic apps. + * Basic apps are not used for capacity allocation. + * @member {boolean} [isApplicableForAllComputeModes] true if + * capacity is applicable for all apps; otherwise, false. + * @member {string} [siteMode] Shared or Dedicated. + * @member {boolean} [isLinux] Is this a linux stamp capacity + */ + constructor() { + } + + /** + * Defines the metadata of StampCapacity + * + * @returns {object} metadata of StampCapacity + * + */ + mapper() { + return { + required: false, + serializedName: 'StampCapacity', + type: { + name: 'Composite', + className: 'StampCapacity', + modelProperties: { + name: { + required: false, + serializedName: 'name', + type: { + name: 'String' + } + }, + availableCapacity: { + required: false, + serializedName: 'availableCapacity', + type: { + name: 'Number' + } + }, + totalCapacity: { + required: false, + serializedName: 'totalCapacity', + type: { + name: 'Number' + } + }, + unit: { + required: false, + serializedName: 'unit', + type: { + name: 'String' + } + }, + computeMode: { + required: false, + serializedName: 'computeMode', + type: { + name: 'Enum', + allowedValues: [ 'Shared', 'Dedicated', 'Dynamic' ] + } + }, + workerSize: { + required: false, + serializedName: 'workerSize', + type: { + name: 'Enum', + allowedValues: [ 'Small', 'Medium', 'Large', 'D1', 'D2', 'D3', 'Default' ] + } + }, + workerSizeId: { + required: false, + serializedName: 'workerSizeId', + type: { + name: 'Number' + } + }, + excludeFromCapacityAllocation: { + required: false, + serializedName: 'excludeFromCapacityAllocation', + type: { + name: 'Boolean' + } + }, + isApplicableForAllComputeModes: { + required: false, + serializedName: 'isApplicableForAllComputeModes', + type: { + name: 'Boolean' + } + }, + siteMode: { + required: false, + serializedName: 'siteMode', + type: { + name: 'String' + } + }, + isLinux: { + required: false, + serializedName: 'isLinux', + type: { + name: 'Boolean' + } + } + } + } + }; + } +} + +module.exports = StampCapacity; diff --git a/lib/services/websiteManagement2/lib/models/topLevelDomain.js b/lib/services/websiteManagement2/lib/models/topLevelDomain.js new file mode 100644 index 0000000000..d5e0a3c95c --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/topLevelDomain.js @@ -0,0 +1,88 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * A top level domain object. + * + * @extends models['ProxyOnlyResource'] + */ +class TopLevelDomain extends models['ProxyOnlyResource'] { + /** + * Create a TopLevelDomain. + * @member {boolean} [privacy] If true, then the top level + * domain supports domain privacy; otherwise, false. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of TopLevelDomain + * + * @returns {object} metadata of TopLevelDomain + * + */ + mapper() { + return { + required: false, + serializedName: 'TopLevelDomain', + type: { + name: 'Composite', + className: 'TopLevelDomain', + 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' + } + }, + privacy: { + required: false, + serializedName: 'properties.privacy', + type: { + name: 'Boolean' + } + } + } + } + }; + } +} + +module.exports = TopLevelDomain; diff --git a/lib/services/websiteManagement2/lib/models/triggeredJobHistory.js b/lib/services/websiteManagement2/lib/models/triggeredJobHistory.js new file mode 100644 index 0000000000..7623db0417 --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/triggeredJobHistory.js @@ -0,0 +1,96 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Triggered Web Job History. List of Triggered Web Job Run Information + * elements. + * + * @extends models['ProxyOnlyResource'] + */ +class TriggeredJobHistory extends models['ProxyOnlyResource'] { + /** + * Create a TriggeredJobHistory. + * @member {array} [runs] List of triggered web job runs. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of TriggeredJobHistory + * + * @returns {object} metadata of TriggeredJobHistory + * + */ + mapper() { + return { + required: false, + serializedName: 'TriggeredJobHistory', + type: { + name: 'Composite', + className: 'TriggeredJobHistory', + 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' + } + }, + runs: { + required: false, + serializedName: 'properties.runs', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'TriggeredJobRunElementType', + type: { + name: 'Composite', + className: 'TriggeredJobRun' + } + } + } + } + } + } + }; + } +} + +module.exports = TriggeredJobHistory; diff --git a/lib/services/websiteManagement2/lib/models/triggeredJobRun.js b/lib/services/websiteManagement2/lib/models/triggeredJobRun.js new file mode 100644 index 0000000000..ef4774b6e4 --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/triggeredJobRun.js @@ -0,0 +1,169 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Triggered Web Job Run Information. + * + * @extends models['ProxyOnlyResource'] + */ +class TriggeredJobRun extends models['ProxyOnlyResource'] { + /** + * Create a TriggeredJobRun. + * @member {string} [webJobId] Job ID. + * @member {string} [webJobName] Job name. + * @member {string} [status] Job status. Possible values include: 'Success', + * 'Failed', 'Error' + * @member {date} [startTime] Start time. + * @member {date} [endTime] End time. + * @member {string} [duration] Job duration. + * @member {string} [outputUrl] Output URL. + * @member {string} [errorUrl] Error URL. + * @member {string} [url] Job URL. + * @member {string} [jobName] Job name. + * @member {string} [trigger] Job trigger. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of TriggeredJobRun + * + * @returns {object} metadata of TriggeredJobRun + * + */ + mapper() { + return { + required: false, + serializedName: 'TriggeredJobRun', + type: { + name: 'Composite', + className: 'TriggeredJobRun', + 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' + } + }, + webJobId: { + required: false, + serializedName: 'properties.web_job_id', + type: { + name: 'String' + } + }, + webJobName: { + required: false, + serializedName: 'properties.web_job_name', + type: { + name: 'String' + } + }, + status: { + required: false, + serializedName: 'properties.status', + type: { + name: 'Enum', + allowedValues: [ 'Success', 'Failed', 'Error' ] + } + }, + startTime: { + required: false, + serializedName: 'properties.start_time', + type: { + name: 'DateTime' + } + }, + endTime: { + required: false, + serializedName: 'properties.end_time', + type: { + name: 'DateTime' + } + }, + duration: { + required: false, + serializedName: 'properties.duration', + type: { + name: 'String' + } + }, + outputUrl: { + required: false, + serializedName: 'properties.output_url', + type: { + name: 'String' + } + }, + errorUrl: { + required: false, + serializedName: 'properties.error_url', + type: { + name: 'String' + } + }, + url: { + required: false, + serializedName: 'properties.url', + type: { + name: 'String' + } + }, + jobName: { + required: false, + serializedName: 'properties.job_name', + type: { + name: 'String' + } + }, + trigger: { + required: false, + serializedName: 'properties.trigger', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = TriggeredJobRun; diff --git a/lib/services/websiteManagement2/lib/models/triggeredWebJob.js b/lib/services/websiteManagement2/lib/models/triggeredWebJob.js new file mode 100644 index 0000000000..b062eb3eb4 --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/triggeredWebJob.js @@ -0,0 +1,181 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Triggered Web Job Information. + * + * @extends models['ProxyOnlyResource'] + */ +class TriggeredWebJob extends models['ProxyOnlyResource'] { + /** + * Create a TriggeredWebJob. + * @member {object} [latestRun] Latest job run information. + * @member {string} [latestRun.webJobId] Job ID. + * @member {string} [latestRun.webJobName] Job name. + * @member {string} [latestRun.status] Job status. Possible values include: + * 'Success', 'Failed', 'Error' + * @member {date} [latestRun.startTime] Start time. + * @member {date} [latestRun.endTime] End time. + * @member {string} [latestRun.duration] Job duration. + * @member {string} [latestRun.outputUrl] Output URL. + * @member {string} [latestRun.errorUrl] Error URL. + * @member {string} [latestRun.url] Job URL. + * @member {string} [latestRun.jobName] Job name. + * @member {string} [latestRun.trigger] Job trigger. + * @member {string} [historyUrl] History URL. + * @member {string} [schedulerLogsUrl] Scheduler Logs URL. + * @member {string} [runCommand] Run command. + * @member {string} [url] Job URL. + * @member {string} [extraInfoUrl] Extra Info URL. + * @member {string} [webJobType] Job type. Possible values include: + * 'Continuous', 'Triggered' + * @member {string} [error] Error information. + * @member {boolean} [usingSdk] Using SDK? + * @member {object} [settings] Job settings. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of TriggeredWebJob + * + * @returns {object} metadata of TriggeredWebJob + * + */ + mapper() { + return { + required: false, + serializedName: 'TriggeredWebJob', + type: { + name: 'Composite', + className: 'TriggeredWebJob', + 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' + } + }, + latestRun: { + required: false, + serializedName: 'properties.latest_run', + type: { + name: 'Composite', + className: 'TriggeredJobRun' + } + }, + historyUrl: { + required: false, + serializedName: 'properties.history_url', + type: { + name: 'String' + } + }, + schedulerLogsUrl: { + required: false, + serializedName: 'properties.scheduler_logs_url', + type: { + name: 'String' + } + }, + runCommand: { + required: false, + serializedName: 'properties.run_command', + type: { + name: 'String' + } + }, + url: { + required: false, + serializedName: 'properties.url', + type: { + name: 'String' + } + }, + extraInfoUrl: { + required: false, + serializedName: 'properties.extra_info_url', + type: { + name: 'String' + } + }, + webJobType: { + required: false, + serializedName: 'properties.web_job_type', + type: { + name: 'Enum', + allowedValues: [ 'Continuous', 'Triggered' ] + } + }, + error: { + required: false, + serializedName: 'properties.error', + type: { + name: 'String' + } + }, + usingSdk: { + required: false, + serializedName: 'properties.using_sdk', + type: { + name: 'Boolean' + } + }, + settings: { + required: false, + serializedName: 'properties.settings', + type: { + name: 'Dictionary', + value: { + required: false, + serializedName: 'ObjectElementType', + type: { + name: 'Object' + } + } + } + } + } + } + }; + } +} + +module.exports = TriggeredWebJob; diff --git a/lib/services/websiteManagement2/lib/models/usage.js b/lib/services/websiteManagement2/lib/models/usage.js new file mode 100644 index 0000000000..b030fdbfde --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/usage.js @@ -0,0 +1,153 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Usage of the quota resource. + * + * @extends models['ProxyOnlyResource'] + */ +class Usage extends models['ProxyOnlyResource'] { + /** + * Create a Usage. + * @member {string} [displayName] Friendly name shown in the UI. + * @member {string} [resourceName] Name of the quota resource. + * @member {string} [unit] Units of measurement for the quota resource. + * @member {number} [currentValue] The current value of the resource counter. + * @member {number} [limit] The resource limit. + * @member {date} [nextResetTime] Next reset time for the resource counter. + * @member {string} [computeMode] Compute mode used for this usage. Possible + * values include: 'Shared', 'Dedicated', 'Dynamic' + * @member {string} [siteMode] Site mode used for this usage. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of Usage + * + * @returns {object} metadata of Usage + * + */ + mapper() { + return { + required: false, + serializedName: 'Usage', + type: { + name: 'Composite', + className: 'Usage', + 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' + } + }, + displayName: { + required: false, + readOnly: true, + serializedName: 'properties.displayName', + type: { + name: 'String' + } + }, + resourceName: { + required: false, + readOnly: true, + serializedName: 'properties.resourceName', + type: { + name: 'String' + } + }, + unit: { + required: false, + readOnly: true, + serializedName: 'properties.unit', + type: { + name: 'String' + } + }, + currentValue: { + required: false, + readOnly: true, + serializedName: 'properties.currentValue', + type: { + name: 'Number' + } + }, + limit: { + required: false, + readOnly: true, + serializedName: 'properties.limit', + type: { + name: 'Number' + } + }, + nextResetTime: { + required: false, + readOnly: true, + serializedName: 'properties.nextResetTime', + type: { + name: 'DateTime' + } + }, + computeMode: { + required: false, + readOnly: true, + serializedName: 'properties.computeMode', + type: { + name: 'Enum', + allowedValues: [ 'Shared', 'Dedicated', 'Dynamic' ] + } + }, + siteMode: { + required: false, + readOnly: true, + serializedName: 'properties.siteMode', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = Usage; diff --git a/lib/services/websiteManagement2/lib/models/user.js b/lib/services/websiteManagement2/lib/models/user.js new file mode 100644 index 0000000000..ec8071fce3 --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/user.js @@ -0,0 +1,121 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * User crendentials used for publishing activity. + * + * @extends models['ProxyOnlyResource'] + */ +class User extends models['ProxyOnlyResource'] { + /** + * Create a User. + * @member {string} publishingUserName Username used for publishing. + * @member {string} [publishingPassword] Password used for publishing. + * @member {string} [publishingPasswordHash] Password hash used for + * publishing. + * @member {string} [publishingPasswordHashSalt] Password hash salt used for + * publishing. + * @member {string} [scmUri] Url of SCM site. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of User + * + * @returns {object} metadata of User + * + */ + mapper() { + return { + required: false, + serializedName: 'User', + type: { + name: 'Composite', + className: 'User', + 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' + } + }, + publishingUserName: { + required: true, + serializedName: 'properties.publishingUserName', + type: { + name: 'String' + } + }, + publishingPassword: { + required: false, + serializedName: 'properties.publishingPassword', + type: { + name: 'String' + } + }, + publishingPasswordHash: { + required: false, + serializedName: 'properties.publishingPasswordHash', + type: { + name: 'String' + } + }, + publishingPasswordHashSalt: { + required: false, + serializedName: 'properties.publishingPasswordHashSalt', + type: { + name: 'String' + } + }, + scmUri: { + required: false, + serializedName: 'properties.scmUri', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = User; diff --git a/lib/services/websiteManagement2/lib/models/validateRequest.js b/lib/services/websiteManagement2/lib/models/validateRequest.js new file mode 100644 index 0000000000..3ca18ee528 --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/validateRequest.js @@ -0,0 +1,135 @@ +/* + * 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'; + +/** + * Resource validation request content. + * + */ +class ValidateRequest { + /** + * Create a ValidateRequest. + * @member {string} name Resource name to verify. + * @member {string} type Resource type used for verification. Possible values + * include: 'ServerFarm', 'Site' + * @member {string} location Expected location of the resource. + * @member {string} [serverFarmId] ARM resource ID of an App Service plan + * that would host the app. + * @member {string} [skuName] Name of the target SKU for the App Service + * plan. + * @member {boolean} [needLinuxWorkers] true if App Service plan + * is for Linux workers; otherwise, false. + * @member {boolean} [isSpot] true if App Service plan is for + * Spot instances; otherwise, false. + * @member {number} [capacity] Target capacity of the App Service plan + * (number of VM's). + * @member {string} [hostingEnvironment] Name of App Service Environment + * where app or App Service plan should be created. + * @member {boolean} [isXenon] true if App Service plan is + * running as a windows container + */ + constructor() { + } + + /** + * Defines the metadata of ValidateRequest + * + * @returns {object} metadata of ValidateRequest + * + */ + mapper() { + return { + required: false, + serializedName: 'ValidateRequest', + type: { + name: 'Composite', + className: 'ValidateRequest', + modelProperties: { + name: { + required: true, + serializedName: 'name', + type: { + name: 'String' + } + }, + type: { + required: true, + serializedName: 'type', + type: { + name: 'String' + } + }, + location: { + required: true, + serializedName: 'location', + type: { + name: 'String' + } + }, + serverFarmId: { + required: false, + serializedName: 'properties.serverFarmId', + type: { + name: 'String' + } + }, + skuName: { + required: false, + serializedName: 'properties.skuName', + type: { + name: 'String' + } + }, + needLinuxWorkers: { + required: false, + serializedName: 'properties.needLinuxWorkers', + type: { + name: 'Boolean' + } + }, + isSpot: { + required: false, + serializedName: 'properties.isSpot', + type: { + name: 'Boolean' + } + }, + capacity: { + required: false, + serializedName: 'properties.capacity', + constraints: { + InclusiveMinimum: 1 + }, + type: { + name: 'Number' + } + }, + hostingEnvironment: { + required: false, + serializedName: 'properties.hostingEnvironment', + type: { + name: 'String' + } + }, + isXenon: { + required: false, + serializedName: 'properties.isXenon', + type: { + name: 'Boolean' + } + } + } + } + }; + } +} + +module.exports = ValidateRequest; diff --git a/lib/services/websiteManagement2/lib/models/validateResponse.js b/lib/services/websiteManagement2/lib/models/validateResponse.js index e36d4735e4..f5bc588415 100644 --- a/lib/services/websiteManagement2/lib/models/validateResponse.js +++ b/lib/services/websiteManagement2/lib/models/validateResponse.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * Describes the result of resource validation. * diff --git a/lib/services/websiteManagement2/lib/models/virtualApplication.js b/lib/services/websiteManagement2/lib/models/virtualApplication.js index c85bbd6402..0f5a6a66e4 100644 --- a/lib/services/websiteManagement2/lib/models/virtualApplication.js +++ b/lib/services/websiteManagement2/lib/models/virtualApplication.js @@ -10,8 +10,6 @@ 'use strict'; -const models = require('./index'); - /** * Virtual application in an app. * diff --git a/lib/services/websiteManagement2/lib/models/vnetRoute.js b/lib/services/websiteManagement2/lib/models/vnetRoute.js new file mode 100644 index 0000000000..5dfe8a762e --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/vnetRoute.js @@ -0,0 +1,114 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Virtual Network route contract used to pass routing information for a + * Virtual Network. + * + * @extends models['ProxyOnlyResource'] + */ +class VnetRoute extends models['ProxyOnlyResource'] { + /** + * Create a VnetRoute. + * @member {string} [startAddress] The starting address for this route. This + * may also include a CIDR notation, in which case the end address must not + * be specified. + * @member {string} [endAddress] The ending address for this route. If the + * start address is specified in CIDR notation, this must be omitted. + * @member {string} [routeType] The type of route this is: + * DEFAULT - By default, every app has routes to the local address ranges + * specified by RFC1918 + * INHERITED - Routes inherited from the real Virtual Network routes + * STATIC - Static route set on the app only + * + * These values will be used for syncing an app's routes with those from a + * Virtual Network. Possible values include: 'DEFAULT', 'INHERITED', 'STATIC' + */ + constructor() { + super(); + } + + /** + * Defines the metadata of VnetRoute + * + * @returns {object} metadata of VnetRoute + * + */ + mapper() { + return { + required: false, + serializedName: 'VnetRoute', + type: { + name: 'Composite', + className: 'VnetRoute', + 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' + } + }, + startAddress: { + required: false, + serializedName: 'properties.startAddress', + type: { + name: 'String' + } + }, + endAddress: { + required: false, + serializedName: 'properties.endAddress', + type: { + name: 'String' + } + }, + routeType: { + required: false, + serializedName: 'properties.routeType', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = VnetRoute; diff --git a/lib/services/websiteManagement2/lib/models/webJob.js b/lib/services/websiteManagement2/lib/models/webJob.js new file mode 100644 index 0000000000..071625ad9b --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/webJob.js @@ -0,0 +1,144 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Web Job Information. + * + * @extends models['ProxyOnlyResource'] + */ +class WebJob extends models['ProxyOnlyResource'] { + /** + * Create a WebJob. + * @member {string} [runCommand] Run command. + * @member {string} [url] Job URL. + * @member {string} [extraInfoUrl] Extra Info URL. + * @member {string} [webJobType] Job type. Possible values include: + * 'Continuous', 'Triggered' + * @member {string} [error] Error information. + * @member {boolean} [usingSdk] Using SDK? + * @member {object} [settings] Job settings. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of WebJob + * + * @returns {object} metadata of WebJob + * + */ + mapper() { + return { + required: false, + serializedName: 'WebJob', + type: { + name: 'Composite', + className: 'WebJob', + 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' + } + }, + runCommand: { + required: false, + serializedName: 'properties.run_command', + type: { + name: 'String' + } + }, + url: { + required: false, + serializedName: 'properties.url', + type: { + name: 'String' + } + }, + extraInfoUrl: { + required: false, + serializedName: 'properties.extra_info_url', + type: { + name: 'String' + } + }, + webJobType: { + required: false, + serializedName: 'properties.web_job_type', + type: { + name: 'Enum', + allowedValues: [ 'Continuous', 'Triggered' ] + } + }, + error: { + required: false, + serializedName: 'properties.error', + type: { + name: 'String' + } + }, + usingSdk: { + required: false, + serializedName: 'properties.using_sdk', + type: { + name: 'Boolean' + } + }, + settings: { + required: false, + serializedName: 'properties.settings', + type: { + name: 'Dictionary', + value: { + required: false, + serializedName: 'ObjectElementType', + type: { + name: 'Object' + } + } + } + } + } + } + }; + } +} + +module.exports = WebJob; diff --git a/lib/services/websiteManagement2/lib/operations/appServiceCertificateOrders.js b/lib/services/websiteManagement2/lib/operations/appServiceCertificateOrders.js new file mode 100644 index 0000000000..c61d1b4c3d --- /dev/null +++ b/lib/services/websiteManagement2/lib/operations/appServiceCertificateOrders.js @@ -0,0 +1,6829 @@ +/* + * 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 List all certificate orders in a subscription. + * + * List all certificate orders in a subscription. + * + * @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 AppServiceCertificateOrderCollection} 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.'); + } + // Validate + try { + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/providers/Microsoft.CertificateRegistration/certificateOrders'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['AppServiceCertificateOrderCollection']().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 Validate information for a certificate order. + * + * Validate information for a certificate order. + * + * @param {object} appServiceCertificateOrder Information for a certificate + * order. + * + * @param {object} [appServiceCertificateOrder.certificates] State of the Key + * Vault secret. + * + * @param {string} [appServiceCertificateOrder.distinguishedName] Certificate + * distinguished name. + * + * @param {number} [appServiceCertificateOrder.validityInYears] Duration in + * years (must be between 1 and 3). + * + * @param {number} [appServiceCertificateOrder.keySize] Certificate key size. + * + * @param {string} appServiceCertificateOrder.productType Certificate product + * type. Possible values include: 'StandardDomainValidatedSsl', + * 'StandardDomainValidatedWildCardSsl' + * + * @param {boolean} [appServiceCertificateOrder.autoRenew] true if + * the certificate should be automatically renewed when it expires; otherwise, + * false. + * + * @param {string} [appServiceCertificateOrder.csr] Last CSR that was created + * for this order. + * + * @param {string} [appServiceCertificateOrder.kind] Kind of resource. + * + * @param {string} appServiceCertificateOrder.location Resource Location. + * + * @param {object} [appServiceCertificateOrder.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _validatePurchaseInformation(appServiceCertificateOrder, 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 (appServiceCertificateOrder === null || appServiceCertificateOrder === undefined) { + throw new Error('appServiceCertificateOrder cannot be null or undefined.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/providers/Microsoft.CertificateRegistration/validateCertificateRegistrationInformation'; + 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 (appServiceCertificateOrder !== null && appServiceCertificateOrder !== undefined) { + let requestModelMapper = new client.models['AppServiceCertificateOrder']().mapper(); + requestModel = client.serialize(requestModelMapper, appServiceCertificateOrder, 'appServiceCertificateOrder'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(appServiceCertificateOrder, 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 !== 204) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + + return callback(null, result, httpRequest, response); + }); +} + +/** + * @summary Get certificate orders in a resource group. + * + * Get certificate orders in a resource group. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @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 AppServiceCertificateOrderCollection} 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 _listByResourceGroup(resourceGroupName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CertificateRegistration/certificateOrders'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['AppServiceCertificateOrderCollection']().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 Get a certificate order. + * + * Get a certificate order. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} certificateOrderName Name of the certificate order.. + * + * @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 AppServiceCertificateOrder} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _get(resourceGroupName, certificateOrderName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (certificateOrderName === null || certificateOrderName === undefined || typeof certificateOrderName.valueOf() !== 'string') { + throw new Error('certificateOrderName cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CertificateRegistration/certificateOrders/{certificateOrderName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{certificateOrderName}', encodeURIComponent(certificateOrderName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['AppServiceCertificateOrder']().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 Create or update a certificate purchase order. + * + * Create or update a certificate purchase order. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} certificateOrderName Name of the certificate order. + * + * @param {object} certificateDistinguishedName Distinguished name to to use + * for the certificate order. + * + * @param {object} [certificateDistinguishedName.certificates] State of the Key + * Vault secret. + * + * @param {string} [certificateDistinguishedName.distinguishedName] Certificate + * distinguished name. + * + * @param {number} [certificateDistinguishedName.validityInYears] Duration in + * years (must be between 1 and 3). + * + * @param {number} [certificateDistinguishedName.keySize] Certificate key size. + * + * @param {string} certificateDistinguishedName.productType Certificate product + * type. Possible values include: 'StandardDomainValidatedSsl', + * 'StandardDomainValidatedWildCardSsl' + * + * @param {boolean} [certificateDistinguishedName.autoRenew] true + * if the certificate should be automatically renewed when it expires; + * otherwise, false. + * + * @param {string} [certificateDistinguishedName.csr] Last CSR that was created + * for this order. + * + * @param {string} [certificateDistinguishedName.kind] Kind of resource. + * + * @param {string} certificateDistinguishedName.location Resource Location. + * + * @param {object} [certificateDistinguishedName.tags] Resource tags. + * + * @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 AppServiceCertificateOrder} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _createOrUpdate(resourceGroupName, certificateOrderName, certificateDistinguishedName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + + if (!callback) { + throw new Error('callback cannot be null.'); + } + + // Send request + this.beginCreateOrUpdate(resourceGroupName, certificateOrderName, certificateDistinguishedName, options, (err, parsedResult, httpRequest, response) => { + if (err) return callback(err); + + let initialResult = new msRest.HttpOperationResponse(); + initialResult.request = httpRequest; + initialResult.response = response; + initialResult.body = response.body; + client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { + if (err) return callback(err); + + // Create Result + let result = null; + + httpRequest = pollingResult.request; + response = pollingResult.response; + let responseBody = pollingResult.body; + if (responseBody === '') responseBody = null; + + // Deserialize Response + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['AppServiceCertificateOrder']().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 Delete an existing certificate order. + * + * Delete an existing certificate order. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} certificateOrderName Name of the certificate order. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _deleteMethod(resourceGroupName, certificateOrderName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (certificateOrderName === null || certificateOrderName === undefined || typeof certificateOrderName.valueOf() !== 'string') { + throw new Error('certificateOrderName cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CertificateRegistration/certificateOrders/{certificateOrderName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{certificateOrderName}', encodeURIComponent(certificateOrderName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'DELETE'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 204) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + + return callback(null, result, httpRequest, response); + }); +} + +/** + * @summary Create or update a certificate purchase order. + * + * Create or update a certificate purchase order. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} certificateOrderName Name of the certificate order. + * + * @param {object} certificateDistinguishedName Distinguished name to to use + * for the certificate order. + * + * @param {object} [certificateDistinguishedName.certificates] State of the Key + * Vault secret. + * + * @param {string} [certificateDistinguishedName.distinguishedName] Certificate + * distinguished name. + * + * @param {number} [certificateDistinguishedName.validityInYears] Duration in + * years (must be between 1 and 3). + * + * @param {number} [certificateDistinguishedName.keySize] Certificate key size. + * + * @param {string} certificateDistinguishedName.productType Certificate product + * type. Possible values include: 'StandardDomainValidatedSsl', + * 'StandardDomainValidatedWildCardSsl' + * + * @param {boolean} [certificateDistinguishedName.autoRenew] true + * if the certificate should be automatically renewed when it expires; + * otherwise, false. + * + * @param {string} [certificateDistinguishedName.csr] Last CSR that was created + * for this order. + * + * @param {string} [certificateDistinguishedName.kind] Kind of resource. + * + * @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 AppServiceCertificateOrder} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _update(resourceGroupName, certificateOrderName, certificateDistinguishedName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (certificateOrderName === null || certificateOrderName === undefined || typeof certificateOrderName.valueOf() !== 'string') { + throw new Error('certificateOrderName cannot be null or undefined and it must be of type string.'); + } + if (certificateDistinguishedName === null || certificateDistinguishedName === undefined) { + throw new Error('certificateDistinguishedName cannot be null or undefined.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CertificateRegistration/certificateOrders/{certificateOrderName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{certificateOrderName}', encodeURIComponent(certificateOrderName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'PATCH'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (certificateDistinguishedName !== null && certificateDistinguishedName !== undefined) { + let requestModelMapper = new client.models['AppServiceCertificateOrderPatchResource']().mapper(); + requestModel = client.serialize(requestModelMapper, certificateDistinguishedName, 'certificateDistinguishedName'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(certificateDistinguishedName, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 201) { + 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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['AppServiceCertificateOrder']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + // Deserialize Response + if (statusCode === 201) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['AppServiceCertificateOrder']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError1 = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError1.request = msRest.stripRequest(httpRequest); + deserializationError1.response = msRest.stripResponse(response); + return callback(deserializationError1); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * @summary List all certificates associated with a certificate order. + * + * List all certificates associated with a certificate order. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} certificateOrderName Name of the certificate order. + * + * @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 AppServiceCertificateCollection} 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 _listCertificates(resourceGroupName, certificateOrderName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (certificateOrderName === null || certificateOrderName === undefined || typeof certificateOrderName.valueOf() !== 'string') { + throw new Error('certificateOrderName cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CertificateRegistration/certificateOrders/{certificateOrderName}/certificates'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{certificateOrderName}', encodeURIComponent(certificateOrderName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['AppServiceCertificateCollection']().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 Get the certificate associated with a certificate order. + * + * Get the certificate associated with a certificate order. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} certificateOrderName Name of the certificate order. + * + * @param {string} name Name of the certificate. + * + * @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 AppServiceCertificateResource} 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 _getCertificate(resourceGroupName, certificateOrderName, name, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (certificateOrderName === null || certificateOrderName === undefined || typeof certificateOrderName.valueOf() !== 'string') { + throw new Error('certificateOrderName cannot be null or undefined and it must be of type string.'); + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CertificateRegistration/certificateOrders/{certificateOrderName}/certificates/{name}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{certificateOrderName}', encodeURIComponent(certificateOrderName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['AppServiceCertificateResource']().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 Creates or updates a certificate and associates with key vault + * secret. + * + * Creates or updates a certificate and associates with key vault secret. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} certificateOrderName Name of the certificate order. + * + * @param {string} name Name of the certificate. + * + * @param {object} keyVaultCertificate Key vault certificate resource Id. + * + * @param {string} [keyVaultCertificate.keyVaultId] Key Vault resource Id. + * + * @param {string} [keyVaultCertificate.keyVaultSecretName] Key Vault secret + * name. + * + * @param {string} [keyVaultCertificate.kind] Kind of resource. + * + * @param {string} keyVaultCertificate.location Resource Location. + * + * @param {object} [keyVaultCertificate.tags] Resource tags. + * + * @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 AppServiceCertificateResource} 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 _createOrUpdateCertificate(resourceGroupName, certificateOrderName, name, keyVaultCertificate, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + + if (!callback) { + throw new Error('callback cannot be null.'); + } + + // Send request + this.beginCreateOrUpdateCertificate(resourceGroupName, certificateOrderName, name, keyVaultCertificate, options, (err, parsedResult, httpRequest, response) => { + if (err) return callback(err); + + let initialResult = new msRest.HttpOperationResponse(); + initialResult.request = httpRequest; + initialResult.response = response; + initialResult.body = response.body; + client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { + if (err) return callback(err); + + // Create Result + let result = null; + + httpRequest = pollingResult.request; + response = pollingResult.response; + let responseBody = pollingResult.body; + if (responseBody === '') responseBody = null; + + // Deserialize Response + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['AppServiceCertificateResource']().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 Delete the certificate associated with a certificate order. + * + * Delete the certificate associated with a certificate order. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} certificateOrderName Name of the certificate order. + * + * @param {string} name Name of the certificate. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _deleteCertificate(resourceGroupName, certificateOrderName, name, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (certificateOrderName === null || certificateOrderName === undefined || typeof certificateOrderName.valueOf() !== 'string') { + throw new Error('certificateOrderName cannot be null or undefined and it must be of type string.'); + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CertificateRegistration/certificateOrders/{certificateOrderName}/certificates/{name}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{certificateOrderName}', encodeURIComponent(certificateOrderName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'DELETE'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 204) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + + return callback(null, result, httpRequest, response); + }); +} + +/** + * @summary Creates or updates a certificate and associates with key vault + * secret. + * + * Creates or updates a certificate and associates with key vault secret. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} certificateOrderName Name of the certificate order. + * + * @param {string} name Name of the certificate. + * + * @param {object} keyVaultCertificate Key vault certificate resource Id. + * + * @param {string} [keyVaultCertificate.keyVaultId] Key Vault resource Id. + * + * @param {string} [keyVaultCertificate.keyVaultSecretName] Key Vault secret + * name. + * + * @param {string} [keyVaultCertificate.kind] Kind of resource. + * + * @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 AppServiceCertificateResource} 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 _updateCertificate(resourceGroupName, certificateOrderName, name, keyVaultCertificate, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (certificateOrderName === null || certificateOrderName === undefined || typeof certificateOrderName.valueOf() !== 'string') { + throw new Error('certificateOrderName cannot be null or undefined and it must be of type string.'); + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (keyVaultCertificate === null || keyVaultCertificate === undefined) { + throw new Error('keyVaultCertificate cannot be null or undefined.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CertificateRegistration/certificateOrders/{certificateOrderName}/certificates/{name}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{certificateOrderName}', encodeURIComponent(certificateOrderName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'PATCH'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (keyVaultCertificate !== null && keyVaultCertificate !== undefined) { + let requestModelMapper = new client.models['AppServiceCertificatePatchResource']().mapper(); + requestModel = client.serialize(requestModelMapper, keyVaultCertificate, 'keyVaultCertificate'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(keyVaultCertificate, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 201) { + 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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['AppServiceCertificateResource']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + // Deserialize Response + if (statusCode === 201) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['AppServiceCertificateResource']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError1 = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError1.request = msRest.stripRequest(httpRequest); + deserializationError1.response = msRest.stripResponse(response); + return callback(deserializationError1); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * @summary Reissue an existing certificate order. + * + * Reissue an existing certificate order. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} certificateOrderName Name of the certificate order. + * + * @param {object} reissueCertificateOrderRequest Parameters for the reissue. + * + * @param {number} [reissueCertificateOrderRequest.keySize] Certificate Key + * Size. + * + * @param {number} [reissueCertificateOrderRequest.delayExistingRevokeInHours] + * Delay in hours to revoke existing certificate after the new certificate is + * issued. + * + * @param {string} [reissueCertificateOrderRequest.csr] Csr to be used for + * re-key operation. + * + * @param {boolean} [reissueCertificateOrderRequest.isPrivateKeyExternal] + * Should we change the ASC type (from managed private key to external private + * key and vice versa). + * + * @param {string} [reissueCertificateOrderRequest.kind] Kind of resource. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _reissue(resourceGroupName, certificateOrderName, reissueCertificateOrderRequest, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (certificateOrderName === null || certificateOrderName === undefined || typeof certificateOrderName.valueOf() !== 'string') { + throw new Error('certificateOrderName cannot be null or undefined and it must be of type string.'); + } + if (reissueCertificateOrderRequest === null || reissueCertificateOrderRequest === undefined) { + throw new Error('reissueCertificateOrderRequest cannot be null or undefined.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CertificateRegistration/certificateOrders/{certificateOrderName}/reissue'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{certificateOrderName}', encodeURIComponent(certificateOrderName)); + 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 (reissueCertificateOrderRequest !== null && reissueCertificateOrderRequest !== undefined) { + let requestModelMapper = new client.models['ReissueCertificateOrderRequest']().mapper(); + requestModel = client.serialize(requestModelMapper, reissueCertificateOrderRequest, 'reissueCertificateOrderRequest'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(reissueCertificateOrderRequest, 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 !== 204) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + + return callback(null, result, httpRequest, response); + }); +} + +/** + * @summary Renew an existing certificate order. + * + * Renew an existing certificate order. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} certificateOrderName Name of the certificate order. + * + * @param {object} renewCertificateOrderRequest Renew parameters + * + * @param {number} [renewCertificateOrderRequest.keySize] Certificate Key Size. + * + * @param {string} [renewCertificateOrderRequest.csr] Csr to be used for re-key + * operation. + * + * @param {boolean} [renewCertificateOrderRequest.isPrivateKeyExternal] Should + * we change the ASC type (from managed private key to external private key and + * vice versa). + * + * @param {string} [renewCertificateOrderRequest.kind] Kind of resource. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _renew(resourceGroupName, certificateOrderName, renewCertificateOrderRequest, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (certificateOrderName === null || certificateOrderName === undefined || typeof certificateOrderName.valueOf() !== 'string') { + throw new Error('certificateOrderName cannot be null or undefined and it must be of type string.'); + } + if (renewCertificateOrderRequest === null || renewCertificateOrderRequest === undefined) { + throw new Error('renewCertificateOrderRequest cannot be null or undefined.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CertificateRegistration/certificateOrders/{certificateOrderName}/renew'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{certificateOrderName}', encodeURIComponent(certificateOrderName)); + 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 (renewCertificateOrderRequest !== null && renewCertificateOrderRequest !== undefined) { + let requestModelMapper = new client.models['RenewCertificateOrderRequest']().mapper(); + requestModel = client.serialize(requestModelMapper, renewCertificateOrderRequest, 'renewCertificateOrderRequest'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(renewCertificateOrderRequest, 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 !== 204) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + + return callback(null, result, httpRequest, response); + }); +} + +/** + * @summary Resend certificate email. + * + * Resend certificate email. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} certificateOrderName Name of the certificate order. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _resendEmail(resourceGroupName, certificateOrderName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (certificateOrderName === null || certificateOrderName === undefined || typeof certificateOrderName.valueOf() !== 'string') { + throw new Error('certificateOrderName cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CertificateRegistration/certificateOrders/{certificateOrderName}/resendEmail'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{certificateOrderName}', encodeURIComponent(certificateOrderName)); + 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]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 204) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + + return callback(null, result, httpRequest, response); + }); +} + +/** + * @summary Verify domain ownership for this certificate order. + * + * Verify domain ownership for this certificate order. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} certificateOrderName Name of the certificate order. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.name] Name of the object. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _resendRequestEmails(resourceGroupName, certificateOrderName, 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 name = (options && options.name !== undefined) ? options.name : undefined; + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (certificateOrderName === null || certificateOrderName === undefined || typeof certificateOrderName.valueOf() !== 'string') { + throw new Error('certificateOrderName cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (name !== null && name !== undefined && typeof name.valueOf() !== 'string') { + throw new Error('name 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); + } + let nameIdentifier; + if (name !== null && name !== undefined) { + nameIdentifier = new client.models['NameIdentifier'](); + nameIdentifier.name = name; + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CertificateRegistration/certificateOrders/{certificateOrderName}/resendRequestEmails'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{certificateOrderName}', encodeURIComponent(certificateOrderName)); + 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 (nameIdentifier !== null && nameIdentifier !== undefined) { + let requestModelMapper = new client.models['NameIdentifier']().mapper(); + requestModel = client.serialize(requestModelMapper, nameIdentifier, 'nameIdentifier'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(nameIdentifier, 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 !== 204) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + + return callback(null, result, httpRequest, response); + }); +} + +/** + * @summary Verify domain ownership for this certificate order. + * + * Verify domain ownership for this certificate order. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} certificateOrderName Name of the certificate order. + * + * @param {object} siteSealRequest Site seal request. + * + * @param {boolean} [siteSealRequest.lightTheme] If true use the + * light color theme for site seal; otherwise, use the default color theme. + * + * @param {string} [siteSealRequest.locale] Locale of site seal. + * + * @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 SiteSeal} 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 _retrieveSiteSeal(resourceGroupName, certificateOrderName, siteSealRequest, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (certificateOrderName === null || certificateOrderName === undefined || typeof certificateOrderName.valueOf() !== 'string') { + throw new Error('certificateOrderName cannot be null or undefined and it must be of type string.'); + } + if (siteSealRequest === null || siteSealRequest === undefined) { + throw new Error('siteSealRequest cannot be null or undefined.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CertificateRegistration/certificateOrders/{certificateOrderName}/retrieveSiteSeal'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{certificateOrderName}', encodeURIComponent(certificateOrderName)); + 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 (siteSealRequest !== null && siteSealRequest !== undefined) { + let requestModelMapper = new client.models['SiteSealRequest']().mapper(); + requestModel = client.serialize(requestModelMapper, siteSealRequest, 'siteSealRequest'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(siteSealRequest, 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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['SiteSeal']().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 Verify domain ownership for this certificate order. + * + * Verify domain ownership for this certificate order. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} certificateOrderName Name of the certificate order. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _verifyDomainOwnership(resourceGroupName, certificateOrderName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (certificateOrderName === null || certificateOrderName === undefined || typeof certificateOrderName.valueOf() !== 'string') { + throw new Error('certificateOrderName cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CertificateRegistration/certificateOrders/{certificateOrderName}/verifyDomainOwnership'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{certificateOrderName}', encodeURIComponent(certificateOrderName)); + 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]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 204) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + + return callback(null, result, httpRequest, response); + }); +} + +/** + * @summary Retrieve the list of certificate actions. + * + * Retrieve the list of certificate actions. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the certificate order. + * + * @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. + * + * {array} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _retrieveCertificateActions(resourceGroupName, name, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CertificateRegistration/certificateOrders/{name}/retrieveCertificateActions'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + 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]; + } + } + } + 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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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 = { + required: false, + serializedName: 'parsedResponse', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'CertificateOrderActionElementType', + type: { + name: 'Composite', + className: 'CertificateOrderAction' + } + } + } + }; + 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 Retrieve email history. + * + * Retrieve email history. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the certificate order. + * + * @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. + * + * {array} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _retrieveCertificateEmailHistory(resourceGroupName, name, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CertificateRegistration/certificateOrders/{name}/retrieveEmailHistory'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + 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]; + } + } + } + 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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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 = { + required: false, + serializedName: 'parsedResponse', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'CertificateEmailElementType', + type: { + name: 'Composite', + className: 'CertificateEmail' + } + } + } + }; + 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 Create or update a certificate purchase order. + * + * Create or update a certificate purchase order. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} certificateOrderName Name of the certificate order. + * + * @param {object} certificateDistinguishedName Distinguished name to to use + * for the certificate order. + * + * @param {object} [certificateDistinguishedName.certificates] State of the Key + * Vault secret. + * + * @param {string} [certificateDistinguishedName.distinguishedName] Certificate + * distinguished name. + * + * @param {number} [certificateDistinguishedName.validityInYears] Duration in + * years (must be between 1 and 3). + * + * @param {number} [certificateDistinguishedName.keySize] Certificate key size. + * + * @param {string} certificateDistinguishedName.productType Certificate product + * type. Possible values include: 'StandardDomainValidatedSsl', + * 'StandardDomainValidatedWildCardSsl' + * + * @param {boolean} [certificateDistinguishedName.autoRenew] true + * if the certificate should be automatically renewed when it expires; + * otherwise, false. + * + * @param {string} [certificateDistinguishedName.csr] Last CSR that was created + * for this order. + * + * @param {string} [certificateDistinguishedName.kind] Kind of resource. + * + * @param {string} certificateDistinguishedName.location Resource Location. + * + * @param {object} [certificateDistinguishedName.tags] Resource tags. + * + * @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 AppServiceCertificateOrder} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _beginCreateOrUpdate(resourceGroupName, certificateOrderName, certificateDistinguishedName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (certificateOrderName === null || certificateOrderName === undefined || typeof certificateOrderName.valueOf() !== 'string') { + throw new Error('certificateOrderName cannot be null or undefined and it must be of type string.'); + } + if (certificateDistinguishedName === null || certificateDistinguishedName === undefined) { + throw new Error('certificateDistinguishedName cannot be null or undefined.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CertificateRegistration/certificateOrders/{certificateOrderName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{certificateOrderName}', encodeURIComponent(certificateOrderName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'PUT'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (certificateDistinguishedName !== null && certificateDistinguishedName !== undefined) { + let requestModelMapper = new client.models['AppServiceCertificateOrder']().mapper(); + requestModel = client.serialize(requestModelMapper, certificateDistinguishedName, 'certificateDistinguishedName'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(certificateDistinguishedName, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 201) { + 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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['AppServiceCertificateOrder']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + // Deserialize Response + if (statusCode === 201) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['AppServiceCertificateOrder']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError1 = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError1.request = msRest.stripRequest(httpRequest); + deserializationError1.response = msRest.stripResponse(response); + return callback(deserializationError1); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * @summary Creates or updates a certificate and associates with key vault + * secret. + * + * Creates or updates a certificate and associates with key vault secret. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} certificateOrderName Name of the certificate order. + * + * @param {string} name Name of the certificate. + * + * @param {object} keyVaultCertificate Key vault certificate resource Id. + * + * @param {string} [keyVaultCertificate.keyVaultId] Key Vault resource Id. + * + * @param {string} [keyVaultCertificate.keyVaultSecretName] Key Vault secret + * name. + * + * @param {string} [keyVaultCertificate.kind] Kind of resource. + * + * @param {string} keyVaultCertificate.location Resource Location. + * + * @param {object} [keyVaultCertificate.tags] Resource tags. + * + * @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 AppServiceCertificateResource} 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 _beginCreateOrUpdateCertificate(resourceGroupName, certificateOrderName, name, keyVaultCertificate, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (certificateOrderName === null || certificateOrderName === undefined || typeof certificateOrderName.valueOf() !== 'string') { + throw new Error('certificateOrderName cannot be null or undefined and it must be of type string.'); + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (keyVaultCertificate === null || keyVaultCertificate === undefined) { + throw new Error('keyVaultCertificate cannot be null or undefined.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CertificateRegistration/certificateOrders/{certificateOrderName}/certificates/{name}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{certificateOrderName}', encodeURIComponent(certificateOrderName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'PUT'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (keyVaultCertificate !== null && keyVaultCertificate !== undefined) { + let requestModelMapper = new client.models['AppServiceCertificateResource']().mapper(); + requestModel = client.serialize(requestModelMapper, keyVaultCertificate, 'keyVaultCertificate'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(keyVaultCertificate, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 201) { + 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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['AppServiceCertificateResource']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + // Deserialize Response + if (statusCode === 201) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['AppServiceCertificateResource']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError1 = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError1.request = msRest.stripRequest(httpRequest); + deserializationError1.response = msRest.stripResponse(response); + return callback(deserializationError1); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * @summary List all certificate orders in a subscription. + * + * List all certificate orders in a subscription. + * + * @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 AppServiceCertificateOrderCollection} 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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['AppServiceCertificateOrderCollection']().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 Get certificate orders in a resource group. + * + * Get certificate orders in a resource group. + * + * @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 AppServiceCertificateOrderCollection} 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 _listByResourceGroupNext(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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['AppServiceCertificateOrderCollection']().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 List all certificates associated with a certificate order. + * + * List all certificates associated with a certificate order. + * + * @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 AppServiceCertificateCollection} 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 _listCertificatesNext(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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['AppServiceCertificateCollection']().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 AppServiceCertificateOrders. */ +class AppServiceCertificateOrders { + /** + * Create a AppServiceCertificateOrders. + * @param {WebSiteManagementClient} client Reference to the service client. + */ + constructor(client) { + this.client = client; + this._list = _list; + this._validatePurchaseInformation = _validatePurchaseInformation; + this._listByResourceGroup = _listByResourceGroup; + this._get = _get; + this._createOrUpdate = _createOrUpdate; + this._deleteMethod = _deleteMethod; + this._update = _update; + this._listCertificates = _listCertificates; + this._getCertificate = _getCertificate; + this._createOrUpdateCertificate = _createOrUpdateCertificate; + this._deleteCertificate = _deleteCertificate; + this._updateCertificate = _updateCertificate; + this._reissue = _reissue; + this._renew = _renew; + this._resendEmail = _resendEmail; + this._resendRequestEmails = _resendRequestEmails; + this._retrieveSiteSeal = _retrieveSiteSeal; + this._verifyDomainOwnership = _verifyDomainOwnership; + this._retrieveCertificateActions = _retrieveCertificateActions; + this._retrieveCertificateEmailHistory = _retrieveCertificateEmailHistory; + this._beginCreateOrUpdate = _beginCreateOrUpdate; + this._beginCreateOrUpdateCertificate = _beginCreateOrUpdateCertificate; + this._listNext = _listNext; + this._listByResourceGroupNext = _listByResourceGroupNext; + this._listCertificatesNext = _listCertificatesNext; + } + + /** + * @summary List all certificate orders in a subscription. + * + * List all certificate orders in a subscription. + * + * @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. + */ + 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 List all certificate orders in a subscription. + * + * List all certificate orders in a subscription. + * + * @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 {AppServiceCertificateOrderCollection} - 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 AppServiceCertificateOrderCollection} 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 Validate information for a certificate order. + * + * Validate information for a certificate order. + * + * @param {object} appServiceCertificateOrder Information for a certificate + * order. + * + * @param {object} [appServiceCertificateOrder.certificates] State of the Key + * Vault secret. + * + * @param {string} [appServiceCertificateOrder.distinguishedName] Certificate + * distinguished name. + * + * @param {number} [appServiceCertificateOrder.validityInYears] Duration in + * years (must be between 1 and 3). + * + * @param {number} [appServiceCertificateOrder.keySize] Certificate key size. + * + * @param {string} appServiceCertificateOrder.productType Certificate product + * type. Possible values include: 'StandardDomainValidatedSsl', + * 'StandardDomainValidatedWildCardSsl' + * + * @param {boolean} [appServiceCertificateOrder.autoRenew] true if + * the certificate should be automatically renewed when it expires; otherwise, + * false. + * + * @param {string} [appServiceCertificateOrder.csr] Last CSR that was created + * for this order. + * + * @param {string} [appServiceCertificateOrder.kind] Kind of resource. + * + * @param {string} appServiceCertificateOrder.location Resource Location. + * + * @param {object} [appServiceCertificateOrder.tags] Resource tags. + * + * @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. + */ + validatePurchaseInformationWithHttpOperationResponse(appServiceCertificateOrder, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._validatePurchaseInformation(appServiceCertificateOrder, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Validate information for a certificate order. + * + * Validate information for a certificate order. + * + * @param {object} appServiceCertificateOrder Information for a certificate + * order. + * + * @param {object} [appServiceCertificateOrder.certificates] State of the Key + * Vault secret. + * + * @param {string} [appServiceCertificateOrder.distinguishedName] Certificate + * distinguished name. + * + * @param {number} [appServiceCertificateOrder.validityInYears] Duration in + * years (must be between 1 and 3). + * + * @param {number} [appServiceCertificateOrder.keySize] Certificate key size. + * + * @param {string} appServiceCertificateOrder.productType Certificate product + * type. Possible values include: 'StandardDomainValidatedSsl', + * 'StandardDomainValidatedWildCardSsl' + * + * @param {boolean} [appServiceCertificateOrder.autoRenew] true if + * the certificate should be automatically renewed when it expires; otherwise, + * false. + * + * @param {string} [appServiceCertificateOrder.csr] Last CSR that was created + * for this order. + * + * @param {string} [appServiceCertificateOrder.kind] Kind of resource. + * + * @param {string} appServiceCertificateOrder.location Resource Location. + * + * @param {object} [appServiceCertificateOrder.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + validatePurchaseInformation(appServiceCertificateOrder, 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._validatePurchaseInformation(appServiceCertificateOrder, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._validatePurchaseInformation(appServiceCertificateOrder, options, optionalCallback); + } + } + + /** + * @summary Get certificate orders in a resource group. + * + * Get certificate orders in a resource group. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @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. + */ + listByResourceGroupWithHttpOperationResponse(resourceGroupName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listByResourceGroup(resourceGroupName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Get certificate orders in a resource group. + * + * Get certificate orders in a resource group. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @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 {AppServiceCertificateOrderCollection} - 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 AppServiceCertificateOrderCollection} 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. + */ + listByResourceGroup(resourceGroupName, 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._listByResourceGroup(resourceGroupName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listByResourceGroup(resourceGroupName, options, optionalCallback); + } + } + + /** + * @summary Get a certificate order. + * + * Get a certificate order. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} certificateOrderName Name of the certificate order.. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + getWithHttpOperationResponse(resourceGroupName, certificateOrderName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._get(resourceGroupName, certificateOrderName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Get a certificate order. + * + * Get a certificate order. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} certificateOrderName Name of the certificate order.. + * + * @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 {AppServiceCertificateOrder} - 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 AppServiceCertificateOrder} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + get(resourceGroupName, certificateOrderName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._get(resourceGroupName, certificateOrderName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._get(resourceGroupName, certificateOrderName, options, optionalCallback); + } + } + + /** + * @summary Create or update a certificate purchase order. + * + * Create or update a certificate purchase order. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} certificateOrderName Name of the certificate order. + * + * @param {object} certificateDistinguishedName Distinguished name to to use + * for the certificate order. + * + * @param {object} [certificateDistinguishedName.certificates] State of the Key + * Vault secret. + * + * @param {string} [certificateDistinguishedName.distinguishedName] Certificate + * distinguished name. + * + * @param {number} [certificateDistinguishedName.validityInYears] Duration in + * years (must be between 1 and 3). + * + * @param {number} [certificateDistinguishedName.keySize] Certificate key size. + * + * @param {string} certificateDistinguishedName.productType Certificate product + * type. Possible values include: 'StandardDomainValidatedSsl', + * 'StandardDomainValidatedWildCardSsl' + * + * @param {boolean} [certificateDistinguishedName.autoRenew] true + * if the certificate should be automatically renewed when it expires; + * otherwise, false. + * + * @param {string} [certificateDistinguishedName.csr] Last CSR that was created + * for this order. + * + * @param {string} [certificateDistinguishedName.kind] Kind of resource. + * + * @param {string} certificateDistinguishedName.location Resource Location. + * + * @param {object} [certificateDistinguishedName.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + createOrUpdateWithHttpOperationResponse(resourceGroupName, certificateOrderName, certificateDistinguishedName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._createOrUpdate(resourceGroupName, certificateOrderName, certificateDistinguishedName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Create or update a certificate purchase order. + * + * Create or update a certificate purchase order. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} certificateOrderName Name of the certificate order. + * + * @param {object} certificateDistinguishedName Distinguished name to to use + * for the certificate order. + * + * @param {object} [certificateDistinguishedName.certificates] State of the Key + * Vault secret. + * + * @param {string} [certificateDistinguishedName.distinguishedName] Certificate + * distinguished name. + * + * @param {number} [certificateDistinguishedName.validityInYears] Duration in + * years (must be between 1 and 3). + * + * @param {number} [certificateDistinguishedName.keySize] Certificate key size. + * + * @param {string} certificateDistinguishedName.productType Certificate product + * type. Possible values include: 'StandardDomainValidatedSsl', + * 'StandardDomainValidatedWildCardSsl' + * + * @param {boolean} [certificateDistinguishedName.autoRenew] true + * if the certificate should be automatically renewed when it expires; + * otherwise, false. + * + * @param {string} [certificateDistinguishedName.csr] Last CSR that was created + * for this order. + * + * @param {string} [certificateDistinguishedName.kind] Kind of resource. + * + * @param {string} certificateDistinguishedName.location Resource Location. + * + * @param {object} [certificateDistinguishedName.tags] Resource tags. + * + * @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 {AppServiceCertificateOrder} - 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 AppServiceCertificateOrder} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + createOrUpdate(resourceGroupName, certificateOrderName, certificateDistinguishedName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._createOrUpdate(resourceGroupName, certificateOrderName, certificateDistinguishedName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._createOrUpdate(resourceGroupName, certificateOrderName, certificateDistinguishedName, options, optionalCallback); + } + } + + /** + * @summary Delete an existing certificate order. + * + * Delete an existing certificate order. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} certificateOrderName Name of the certificate order. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + deleteMethodWithHttpOperationResponse(resourceGroupName, certificateOrderName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._deleteMethod(resourceGroupName, certificateOrderName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Delete an existing certificate order. + * + * Delete an existing certificate order. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} certificateOrderName Name of the certificate order. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + deleteMethod(resourceGroupName, certificateOrderName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._deleteMethod(resourceGroupName, certificateOrderName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._deleteMethod(resourceGroupName, certificateOrderName, options, optionalCallback); + } + } + + /** + * @summary Create or update a certificate purchase order. + * + * Create or update a certificate purchase order. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} certificateOrderName Name of the certificate order. + * + * @param {object} certificateDistinguishedName Distinguished name to to use + * for the certificate order. + * + * @param {object} [certificateDistinguishedName.certificates] State of the Key + * Vault secret. + * + * @param {string} [certificateDistinguishedName.distinguishedName] Certificate + * distinguished name. + * + * @param {number} [certificateDistinguishedName.validityInYears] Duration in + * years (must be between 1 and 3). + * + * @param {number} [certificateDistinguishedName.keySize] Certificate key size. + * + * @param {string} certificateDistinguishedName.productType Certificate product + * type. Possible values include: 'StandardDomainValidatedSsl', + * 'StandardDomainValidatedWildCardSsl' + * + * @param {boolean} [certificateDistinguishedName.autoRenew] true + * if the certificate should be automatically renewed when it expires; + * otherwise, false. + * + * @param {string} [certificateDistinguishedName.csr] Last CSR that was created + * for this order. + * + * @param {string} [certificateDistinguishedName.kind] Kind of resource. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + updateWithHttpOperationResponse(resourceGroupName, certificateOrderName, certificateDistinguishedName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._update(resourceGroupName, certificateOrderName, certificateDistinguishedName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Create or update a certificate purchase order. + * + * Create or update a certificate purchase order. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} certificateOrderName Name of the certificate order. + * + * @param {object} certificateDistinguishedName Distinguished name to to use + * for the certificate order. + * + * @param {object} [certificateDistinguishedName.certificates] State of the Key + * Vault secret. + * + * @param {string} [certificateDistinguishedName.distinguishedName] Certificate + * distinguished name. + * + * @param {number} [certificateDistinguishedName.validityInYears] Duration in + * years (must be between 1 and 3). + * + * @param {number} [certificateDistinguishedName.keySize] Certificate key size. + * + * @param {string} certificateDistinguishedName.productType Certificate product + * type. Possible values include: 'StandardDomainValidatedSsl', + * 'StandardDomainValidatedWildCardSsl' + * + * @param {boolean} [certificateDistinguishedName.autoRenew] true + * if the certificate should be automatically renewed when it expires; + * otherwise, false. + * + * @param {string} [certificateDistinguishedName.csr] Last CSR that was created + * for this order. + * + * @param {string} [certificateDistinguishedName.kind] Kind of resource. + * + * @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 {AppServiceCertificateOrder} - 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 AppServiceCertificateOrder} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + update(resourceGroupName, certificateOrderName, certificateDistinguishedName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._update(resourceGroupName, certificateOrderName, certificateDistinguishedName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._update(resourceGroupName, certificateOrderName, certificateDistinguishedName, options, optionalCallback); + } + } + + /** + * @summary List all certificates associated with a certificate order. + * + * List all certificates associated with a certificate order. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} certificateOrderName Name of the certificate order. + * + * @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. + */ + listCertificatesWithHttpOperationResponse(resourceGroupName, certificateOrderName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listCertificates(resourceGroupName, certificateOrderName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary List all certificates associated with a certificate order. + * + * List all certificates associated with a certificate order. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} certificateOrderName Name of the certificate order. + * + * @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 {AppServiceCertificateCollection} - 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 AppServiceCertificateCollection} 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. + */ + listCertificates(resourceGroupName, certificateOrderName, 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._listCertificates(resourceGroupName, certificateOrderName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listCertificates(resourceGroupName, certificateOrderName, options, optionalCallback); + } + } + + /** + * @summary Get the certificate associated with a certificate order. + * + * Get the certificate associated with a certificate order. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} certificateOrderName Name of the certificate order. + * + * @param {string} name Name of the certificate. + * + * @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. + */ + getCertificateWithHttpOperationResponse(resourceGroupName, certificateOrderName, name, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._getCertificate(resourceGroupName, certificateOrderName, name, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Get the certificate associated with a certificate order. + * + * Get the certificate associated with a certificate order. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} certificateOrderName Name of the certificate order. + * + * @param {string} name Name of the certificate. + * + * @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 {AppServiceCertificateResource} - 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 AppServiceCertificateResource} 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. + */ + getCertificate(resourceGroupName, certificateOrderName, name, 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._getCertificate(resourceGroupName, certificateOrderName, name, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getCertificate(resourceGroupName, certificateOrderName, name, options, optionalCallback); + } + } + + /** + * @summary Creates or updates a certificate and associates with key vault + * secret. + * + * Creates or updates a certificate and associates with key vault secret. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} certificateOrderName Name of the certificate order. + * + * @param {string} name Name of the certificate. + * + * @param {object} keyVaultCertificate Key vault certificate resource Id. + * + * @param {string} [keyVaultCertificate.keyVaultId] Key Vault resource Id. + * + * @param {string} [keyVaultCertificate.keyVaultSecretName] Key Vault secret + * name. + * + * @param {string} [keyVaultCertificate.kind] Kind of resource. + * + * @param {string} keyVaultCertificate.location Resource Location. + * + * @param {object} [keyVaultCertificate.tags] Resource tags. + * + * @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. + */ + createOrUpdateCertificateWithHttpOperationResponse(resourceGroupName, certificateOrderName, name, keyVaultCertificate, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._createOrUpdateCertificate(resourceGroupName, certificateOrderName, name, keyVaultCertificate, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Creates or updates a certificate and associates with key vault + * secret. + * + * Creates or updates a certificate and associates with key vault secret. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} certificateOrderName Name of the certificate order. + * + * @param {string} name Name of the certificate. + * + * @param {object} keyVaultCertificate Key vault certificate resource Id. + * + * @param {string} [keyVaultCertificate.keyVaultId] Key Vault resource Id. + * + * @param {string} [keyVaultCertificate.keyVaultSecretName] Key Vault secret + * name. + * + * @param {string} [keyVaultCertificate.kind] Kind of resource. + * + * @param {string} keyVaultCertificate.location Resource Location. + * + * @param {object} [keyVaultCertificate.tags] Resource tags. + * + * @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 {AppServiceCertificateResource} - 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 AppServiceCertificateResource} 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. + */ + createOrUpdateCertificate(resourceGroupName, certificateOrderName, name, keyVaultCertificate, 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._createOrUpdateCertificate(resourceGroupName, certificateOrderName, name, keyVaultCertificate, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._createOrUpdateCertificate(resourceGroupName, certificateOrderName, name, keyVaultCertificate, options, optionalCallback); + } + } + + /** + * @summary Delete the certificate associated with a certificate order. + * + * Delete the certificate associated with a certificate order. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} certificateOrderName Name of the certificate order. + * + * @param {string} name Name of the certificate. + * + * @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. + */ + deleteCertificateWithHttpOperationResponse(resourceGroupName, certificateOrderName, name, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._deleteCertificate(resourceGroupName, certificateOrderName, name, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Delete the certificate associated with a certificate order. + * + * Delete the certificate associated with a certificate order. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} certificateOrderName Name of the certificate order. + * + * @param {string} name Name of the certificate. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + deleteCertificate(resourceGroupName, certificateOrderName, name, 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._deleteCertificate(resourceGroupName, certificateOrderName, name, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._deleteCertificate(resourceGroupName, certificateOrderName, name, options, optionalCallback); + } + } + + /** + * @summary Creates or updates a certificate and associates with key vault + * secret. + * + * Creates or updates a certificate and associates with key vault secret. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} certificateOrderName Name of the certificate order. + * + * @param {string} name Name of the certificate. + * + * @param {object} keyVaultCertificate Key vault certificate resource Id. + * + * @param {string} [keyVaultCertificate.keyVaultId] Key Vault resource Id. + * + * @param {string} [keyVaultCertificate.keyVaultSecretName] Key Vault secret + * name. + * + * @param {string} [keyVaultCertificate.kind] Kind of resource. + * + * @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. + */ + updateCertificateWithHttpOperationResponse(resourceGroupName, certificateOrderName, name, keyVaultCertificate, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._updateCertificate(resourceGroupName, certificateOrderName, name, keyVaultCertificate, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Creates or updates a certificate and associates with key vault + * secret. + * + * Creates or updates a certificate and associates with key vault secret. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} certificateOrderName Name of the certificate order. + * + * @param {string} name Name of the certificate. + * + * @param {object} keyVaultCertificate Key vault certificate resource Id. + * + * @param {string} [keyVaultCertificate.keyVaultId] Key Vault resource Id. + * + * @param {string} [keyVaultCertificate.keyVaultSecretName] Key Vault secret + * name. + * + * @param {string} [keyVaultCertificate.kind] Kind of resource. + * + * @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 {AppServiceCertificateResource} - 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 AppServiceCertificateResource} 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. + */ + updateCertificate(resourceGroupName, certificateOrderName, name, keyVaultCertificate, 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._updateCertificate(resourceGroupName, certificateOrderName, name, keyVaultCertificate, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._updateCertificate(resourceGroupName, certificateOrderName, name, keyVaultCertificate, options, optionalCallback); + } + } + + /** + * @summary Reissue an existing certificate order. + * + * Reissue an existing certificate order. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} certificateOrderName Name of the certificate order. + * + * @param {object} reissueCertificateOrderRequest Parameters for the reissue. + * + * @param {number} [reissueCertificateOrderRequest.keySize] Certificate Key + * Size. + * + * @param {number} [reissueCertificateOrderRequest.delayExistingRevokeInHours] + * Delay in hours to revoke existing certificate after the new certificate is + * issued. + * + * @param {string} [reissueCertificateOrderRequest.csr] Csr to be used for + * re-key operation. + * + * @param {boolean} [reissueCertificateOrderRequest.isPrivateKeyExternal] + * Should we change the ASC type (from managed private key to external private + * key and vice versa). + * + * @param {string} [reissueCertificateOrderRequest.kind] Kind of resource. + * + * @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. + */ + reissueWithHttpOperationResponse(resourceGroupName, certificateOrderName, reissueCertificateOrderRequest, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._reissue(resourceGroupName, certificateOrderName, reissueCertificateOrderRequest, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Reissue an existing certificate order. + * + * Reissue an existing certificate order. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} certificateOrderName Name of the certificate order. + * + * @param {object} reissueCertificateOrderRequest Parameters for the reissue. + * + * @param {number} [reissueCertificateOrderRequest.keySize] Certificate Key + * Size. + * + * @param {number} [reissueCertificateOrderRequest.delayExistingRevokeInHours] + * Delay in hours to revoke existing certificate after the new certificate is + * issued. + * + * @param {string} [reissueCertificateOrderRequest.csr] Csr to be used for + * re-key operation. + * + * @param {boolean} [reissueCertificateOrderRequest.isPrivateKeyExternal] + * Should we change the ASC type (from managed private key to external private + * key and vice versa). + * + * @param {string} [reissueCertificateOrderRequest.kind] Kind of resource. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + reissue(resourceGroupName, certificateOrderName, reissueCertificateOrderRequest, 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._reissue(resourceGroupName, certificateOrderName, reissueCertificateOrderRequest, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._reissue(resourceGroupName, certificateOrderName, reissueCertificateOrderRequest, options, optionalCallback); + } + } + + /** + * @summary Renew an existing certificate order. + * + * Renew an existing certificate order. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} certificateOrderName Name of the certificate order. + * + * @param {object} renewCertificateOrderRequest Renew parameters + * + * @param {number} [renewCertificateOrderRequest.keySize] Certificate Key Size. + * + * @param {string} [renewCertificateOrderRequest.csr] Csr to be used for re-key + * operation. + * + * @param {boolean} [renewCertificateOrderRequest.isPrivateKeyExternal] Should + * we change the ASC type (from managed private key to external private key and + * vice versa). + * + * @param {string} [renewCertificateOrderRequest.kind] Kind of resource. + * + * @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. + */ + renewWithHttpOperationResponse(resourceGroupName, certificateOrderName, renewCertificateOrderRequest, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._renew(resourceGroupName, certificateOrderName, renewCertificateOrderRequest, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Renew an existing certificate order. + * + * Renew an existing certificate order. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} certificateOrderName Name of the certificate order. + * + * @param {object} renewCertificateOrderRequest Renew parameters + * + * @param {number} [renewCertificateOrderRequest.keySize] Certificate Key Size. + * + * @param {string} [renewCertificateOrderRequest.csr] Csr to be used for re-key + * operation. + * + * @param {boolean} [renewCertificateOrderRequest.isPrivateKeyExternal] Should + * we change the ASC type (from managed private key to external private key and + * vice versa). + * + * @param {string} [renewCertificateOrderRequest.kind] Kind of resource. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + renew(resourceGroupName, certificateOrderName, renewCertificateOrderRequest, 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._renew(resourceGroupName, certificateOrderName, renewCertificateOrderRequest, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._renew(resourceGroupName, certificateOrderName, renewCertificateOrderRequest, options, optionalCallback); + } + } + + /** + * @summary Resend certificate email. + * + * Resend certificate email. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} certificateOrderName Name of the certificate order. + * + * @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. + */ + resendEmailWithHttpOperationResponse(resourceGroupName, certificateOrderName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._resendEmail(resourceGroupName, certificateOrderName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Resend certificate email. + * + * Resend certificate email. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} certificateOrderName Name of the certificate order. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + resendEmail(resourceGroupName, certificateOrderName, 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._resendEmail(resourceGroupName, certificateOrderName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._resendEmail(resourceGroupName, certificateOrderName, options, optionalCallback); + } + } + + /** + * @summary Verify domain ownership for this certificate order. + * + * Verify domain ownership for this certificate order. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} certificateOrderName Name of the certificate order. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.name] Name of the object. + * + * @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. + */ + resendRequestEmailsWithHttpOperationResponse(resourceGroupName, certificateOrderName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._resendRequestEmails(resourceGroupName, certificateOrderName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Verify domain ownership for this certificate order. + * + * Verify domain ownership for this certificate order. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} certificateOrderName Name of the certificate order. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.name] Name of the object. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + resendRequestEmails(resourceGroupName, certificateOrderName, 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._resendRequestEmails(resourceGroupName, certificateOrderName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._resendRequestEmails(resourceGroupName, certificateOrderName, options, optionalCallback); + } + } + + /** + * @summary Verify domain ownership for this certificate order. + * + * Verify domain ownership for this certificate order. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} certificateOrderName Name of the certificate order. + * + * @param {object} siteSealRequest Site seal request. + * + * @param {boolean} [siteSealRequest.lightTheme] If true use the + * light color theme for site seal; otherwise, use the default color theme. + * + * @param {string} [siteSealRequest.locale] Locale of site seal. + * + * @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. + */ + retrieveSiteSealWithHttpOperationResponse(resourceGroupName, certificateOrderName, siteSealRequest, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._retrieveSiteSeal(resourceGroupName, certificateOrderName, siteSealRequest, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Verify domain ownership for this certificate order. + * + * Verify domain ownership for this certificate order. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} certificateOrderName Name of the certificate order. + * + * @param {object} siteSealRequest Site seal request. + * + * @param {boolean} [siteSealRequest.lightTheme] If true use the + * light color theme for site seal; otherwise, use the default color theme. + * + * @param {string} [siteSealRequest.locale] Locale of site seal. + * + * @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 {SiteSeal} - 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 SiteSeal} 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. + */ + retrieveSiteSeal(resourceGroupName, certificateOrderName, siteSealRequest, 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._retrieveSiteSeal(resourceGroupName, certificateOrderName, siteSealRequest, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._retrieveSiteSeal(resourceGroupName, certificateOrderName, siteSealRequest, options, optionalCallback); + } + } + + /** + * @summary Verify domain ownership for this certificate order. + * + * Verify domain ownership for this certificate order. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} certificateOrderName Name of the certificate order. + * + * @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. + */ + verifyDomainOwnershipWithHttpOperationResponse(resourceGroupName, certificateOrderName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._verifyDomainOwnership(resourceGroupName, certificateOrderName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Verify domain ownership for this certificate order. + * + * Verify domain ownership for this certificate order. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} certificateOrderName Name of the certificate order. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + verifyDomainOwnership(resourceGroupName, certificateOrderName, 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._verifyDomainOwnership(resourceGroupName, certificateOrderName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._verifyDomainOwnership(resourceGroupName, certificateOrderName, options, optionalCallback); + } + } + + /** + * @summary Retrieve the list of certificate actions. + * + * Retrieve the list of certificate actions. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the certificate order. + * + * @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. + */ + retrieveCertificateActionsWithHttpOperationResponse(resourceGroupName, name, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._retrieveCertificateActions(resourceGroupName, name, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Retrieve the list of certificate actions. + * + * Retrieve the list of certificate actions. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the certificate order. + * + * @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 {Array} - 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. + * + * {array} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + retrieveCertificateActions(resourceGroupName, name, 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._retrieveCertificateActions(resourceGroupName, name, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._retrieveCertificateActions(resourceGroupName, name, options, optionalCallback); + } + } + + /** + * @summary Retrieve email history. + * + * Retrieve email history. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the certificate order. + * + * @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. + */ + retrieveCertificateEmailHistoryWithHttpOperationResponse(resourceGroupName, name, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._retrieveCertificateEmailHistory(resourceGroupName, name, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Retrieve email history. + * + * Retrieve email history. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the certificate order. + * + * @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 {Array} - 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. + * + * {array} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + retrieveCertificateEmailHistory(resourceGroupName, name, 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._retrieveCertificateEmailHistory(resourceGroupName, name, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._retrieveCertificateEmailHistory(resourceGroupName, name, options, optionalCallback); + } + } + + /** + * @summary Create or update a certificate purchase order. + * + * Create or update a certificate purchase order. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} certificateOrderName Name of the certificate order. + * + * @param {object} certificateDistinguishedName Distinguished name to to use + * for the certificate order. + * + * @param {object} [certificateDistinguishedName.certificates] State of the Key + * Vault secret. + * + * @param {string} [certificateDistinguishedName.distinguishedName] Certificate + * distinguished name. + * + * @param {number} [certificateDistinguishedName.validityInYears] Duration in + * years (must be between 1 and 3). + * + * @param {number} [certificateDistinguishedName.keySize] Certificate key size. + * + * @param {string} certificateDistinguishedName.productType Certificate product + * type. Possible values include: 'StandardDomainValidatedSsl', + * 'StandardDomainValidatedWildCardSsl' + * + * @param {boolean} [certificateDistinguishedName.autoRenew] true + * if the certificate should be automatically renewed when it expires; + * otherwise, false. + * + * @param {string} [certificateDistinguishedName.csr] Last CSR that was created + * for this order. + * + * @param {string} [certificateDistinguishedName.kind] Kind of resource. + * + * @param {string} certificateDistinguishedName.location Resource Location. + * + * @param {object} [certificateDistinguishedName.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName, certificateOrderName, certificateDistinguishedName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginCreateOrUpdate(resourceGroupName, certificateOrderName, certificateDistinguishedName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Create or update a certificate purchase order. + * + * Create or update a certificate purchase order. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} certificateOrderName Name of the certificate order. + * + * @param {object} certificateDistinguishedName Distinguished name to to use + * for the certificate order. + * + * @param {object} [certificateDistinguishedName.certificates] State of the Key + * Vault secret. + * + * @param {string} [certificateDistinguishedName.distinguishedName] Certificate + * distinguished name. + * + * @param {number} [certificateDistinguishedName.validityInYears] Duration in + * years (must be between 1 and 3). + * + * @param {number} [certificateDistinguishedName.keySize] Certificate key size. + * + * @param {string} certificateDistinguishedName.productType Certificate product + * type. Possible values include: 'StandardDomainValidatedSsl', + * 'StandardDomainValidatedWildCardSsl' + * + * @param {boolean} [certificateDistinguishedName.autoRenew] true + * if the certificate should be automatically renewed when it expires; + * otherwise, false. + * + * @param {string} [certificateDistinguishedName.csr] Last CSR that was created + * for this order. + * + * @param {string} [certificateDistinguishedName.kind] Kind of resource. + * + * @param {string} certificateDistinguishedName.location Resource Location. + * + * @param {object} [certificateDistinguishedName.tags] Resource tags. + * + * @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 {AppServiceCertificateOrder} - 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 AppServiceCertificateOrder} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + beginCreateOrUpdate(resourceGroupName, certificateOrderName, certificateDistinguishedName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._beginCreateOrUpdate(resourceGroupName, certificateOrderName, certificateDistinguishedName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginCreateOrUpdate(resourceGroupName, certificateOrderName, certificateDistinguishedName, options, optionalCallback); + } + } + + /** + * @summary Creates or updates a certificate and associates with key vault + * secret. + * + * Creates or updates a certificate and associates with key vault secret. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} certificateOrderName Name of the certificate order. + * + * @param {string} name Name of the certificate. + * + * @param {object} keyVaultCertificate Key vault certificate resource Id. + * + * @param {string} [keyVaultCertificate.keyVaultId] Key Vault resource Id. + * + * @param {string} [keyVaultCertificate.keyVaultSecretName] Key Vault secret + * name. + * + * @param {string} [keyVaultCertificate.kind] Kind of resource. + * + * @param {string} keyVaultCertificate.location Resource Location. + * + * @param {object} [keyVaultCertificate.tags] Resource tags. + * + * @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. + */ + beginCreateOrUpdateCertificateWithHttpOperationResponse(resourceGroupName, certificateOrderName, name, keyVaultCertificate, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginCreateOrUpdateCertificate(resourceGroupName, certificateOrderName, name, keyVaultCertificate, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Creates or updates a certificate and associates with key vault + * secret. + * + * Creates or updates a certificate and associates with key vault secret. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} certificateOrderName Name of the certificate order. + * + * @param {string} name Name of the certificate. + * + * @param {object} keyVaultCertificate Key vault certificate resource Id. + * + * @param {string} [keyVaultCertificate.keyVaultId] Key Vault resource Id. + * + * @param {string} [keyVaultCertificate.keyVaultSecretName] Key Vault secret + * name. + * + * @param {string} [keyVaultCertificate.kind] Kind of resource. + * + * @param {string} keyVaultCertificate.location Resource Location. + * + * @param {object} [keyVaultCertificate.tags] Resource tags. + * + * @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 {AppServiceCertificateResource} - 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 AppServiceCertificateResource} 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. + */ + beginCreateOrUpdateCertificate(resourceGroupName, certificateOrderName, name, keyVaultCertificate, 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._beginCreateOrUpdateCertificate(resourceGroupName, certificateOrderName, name, keyVaultCertificate, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginCreateOrUpdateCertificate(resourceGroupName, certificateOrderName, name, keyVaultCertificate, options, optionalCallback); + } + } + + /** + * @summary List all certificate orders in a subscription. + * + * List all certificate orders in a subscription. + * + * @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 List all certificate orders in a subscription. + * + * List all certificate orders in a subscription. + * + * @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 {AppServiceCertificateOrderCollection} - 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 AppServiceCertificateOrderCollection} 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); + } + } + + /** + * @summary Get certificate orders in a resource group. + * + * Get certificate orders in a resource group. + * + * @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. + */ + listByResourceGroupNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listByResourceGroupNext(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 Get certificate orders in a resource group. + * + * Get certificate orders in a resource group. + * + * @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 {AppServiceCertificateOrderCollection} - 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 AppServiceCertificateOrderCollection} 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. + */ + listByResourceGroupNext(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._listByResourceGroupNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listByResourceGroupNext(nextPageLink, options, optionalCallback); + } + } + + /** + * @summary List all certificates associated with a certificate order. + * + * List all certificates associated with a certificate order. + * + * @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. + */ + listCertificatesNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listCertificatesNext(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 List all certificates associated with a certificate order. + * + * List all certificates associated with a certificate order. + * + * @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 {AppServiceCertificateCollection} - 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 AppServiceCertificateCollection} 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. + */ + listCertificatesNext(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._listCertificatesNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listCertificatesNext(nextPageLink, options, optionalCallback); + } + } + +} + +module.exports = AppServiceCertificateOrders; diff --git a/lib/services/websiteManagement2/lib/operations/appServiceEnvironments.js b/lib/services/websiteManagement2/lib/operations/appServiceEnvironments.js new file mode 100644 index 0000000000..ad2df2aa00 --- /dev/null +++ b/lib/services/websiteManagement2/lib/operations/appServiceEnvironments.js @@ -0,0 +1,19842 @@ +/* + * 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 Get all App Service Environments for a subscription. + * + * Get all App Service Environments for a subscription. + * + * @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 AppServiceEnvironmentCollection} 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.'); + } + // Validate + try { + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/providers/Microsoft.Web/hostingEnvironments'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['AppServiceEnvironmentCollection']().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 Get all App Service Environments in a resource group. + * + * Get all App Service Environments in a resource group. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @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 AppServiceEnvironmentCollection} 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 _listByResourceGroup(resourceGroupName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['AppServiceEnvironmentCollection']().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 Get the properties of an App Service Environment. + * + * Get the properties of an App Service Environment. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service Environment. + * + * @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 AppServiceEnvironmentResource} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _get(resourceGroupName, name, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['AppServiceEnvironmentResource']().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 Create or update an App Service Environment. + * + * Create or update an App Service Environment. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service Environment. + * + * @param {object} hostingEnvironmentEnvelope Configuration details of the App + * Service Environment. + * + * @param {string} hostingEnvironmentEnvelope.appServiceEnvironmentResourceName + * Name of the App Service Environment. + * + * @param {string} + * hostingEnvironmentEnvelope.appServiceEnvironmentResourceLocation Location of + * the App Service Environment, e.g. "West US". + * + * @param {string} [hostingEnvironmentEnvelope.vnetName] Name of the Virtual + * Network for the App Service Environment. + * + * @param {string} [hostingEnvironmentEnvelope.vnetResourceGroupName] Resource + * group of the Virtual Network. + * + * @param {string} [hostingEnvironmentEnvelope.vnetSubnetName] Subnet of the + * Virtual Network. + * + * @param {object} hostingEnvironmentEnvelope.virtualNetwork Description of the + * Virtual Network. + * + * @param {string} [hostingEnvironmentEnvelope.virtualNetwork.id] Resource id + * of the Virtual Network. + * + * @param {string} [hostingEnvironmentEnvelope.virtualNetwork.subnet] Subnet + * within the Virtual Network. + * + * @param {string} [hostingEnvironmentEnvelope.internalLoadBalancingMode] + * Specifies which endpoints to serve internally in the Virtual Network for the + * App Service Environment. Possible values include: 'None', 'Web', + * 'Publishing' + * + * @param {string} [hostingEnvironmentEnvelope.multiSize] Front-end VM size, + * e.g. "Medium", "Large". + * + * @param {number} [hostingEnvironmentEnvelope.multiRoleCount] Number of + * front-end instances. + * + * @param {array} hostingEnvironmentEnvelope.workerPools Description of worker + * pools with worker size IDs, VM sizes, and number of workers in each pool. + * + * @param {number} [hostingEnvironmentEnvelope.ipsslAddressCount] Number of IP + * SSL addresses reserved for the App Service Environment. + * + * @param {string} [hostingEnvironmentEnvelope.dnsSuffix] DNS suffix of the App + * Service Environment. + * + * @param {array} [hostingEnvironmentEnvelope.networkAccessControlList] Access + * control list for controlling traffic to the App Service Environment. + * + * @param {number} [hostingEnvironmentEnvelope.frontEndScaleFactor] Scale + * factor for front-ends. + * + * @param {string} [hostingEnvironmentEnvelope.apiManagementAccountId] API + * Management Account associated with the App Service Environment. + * + * @param {boolean} [hostingEnvironmentEnvelope.suspended] true if + * the App Service Environment is suspended; otherwise, false. The + * environment can be suspended, e.g. when the management endpoint is no longer + * available + * (most likely because NSG blocked the incoming traffic). + * + * @param {boolean} [hostingEnvironmentEnvelope.dynamicCacheEnabled] True/false + * indicating whether the App Service Environment is suspended. The environment + * can be suspended e.g. when the management endpoint is no longer available + * (most likely because NSG blocked the incoming traffic). + * + * @param {array} [hostingEnvironmentEnvelope.clusterSettings] Custom settings + * for changing the behavior of the App Service Environment. + * + * @param {array} [hostingEnvironmentEnvelope.userWhitelistedIpRanges] User + * added ip ranges to whitelist on ASE db + * + * @param {boolean} [hostingEnvironmentEnvelope.hasLinuxWorkers] Flag that + * displays whether an ASE has linux workers or not + * + * @param {string} [hostingEnvironmentEnvelope.sslCertKeyVaultId] Key Vault ID + * for ILB App Service Environment default SSL certificate + * + * @param {string} [hostingEnvironmentEnvelope.sslCertKeyVaultSecretName] Key + * Vault Secret Name for ILB App Service Environment default SSL certificate + * + * @param {string} [hostingEnvironmentEnvelope.kind] Kind of resource. + * + * @param {string} hostingEnvironmentEnvelope.location Resource Location. + * + * @param {object} [hostingEnvironmentEnvelope.tags] Resource tags. + * + * @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 AppServiceEnvironmentResource} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _createOrUpdate(resourceGroupName, name, hostingEnvironmentEnvelope, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + + if (!callback) { + throw new Error('callback cannot be null.'); + } + + // Send request + this.beginCreateOrUpdate(resourceGroupName, name, hostingEnvironmentEnvelope, options, (err, parsedResult, httpRequest, response) => { + if (err) return callback(err); + + let initialResult = new msRest.HttpOperationResponse(); + initialResult.request = httpRequest; + initialResult.response = response; + initialResult.body = response.body; + client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { + if (err) return callback(err); + + // Create Result + let result = null; + + httpRequest = pollingResult.request; + response = pollingResult.response; + let responseBody = pollingResult.body; + if (responseBody === '') responseBody = null; + + // Deserialize Response + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['AppServiceEnvironmentResource']().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 Delete an App Service Environment. + * + * Delete an App Service Environment. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service Environment. + * + * @param {object} [options] Optional Parameters. + * + * @param {boolean} [options.forceDelete] Specify true to force + * the deletion even if the App Service Environment contains resources. The + * default is false. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _deleteMethod(resourceGroupName, name, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + + if (!callback) { + throw new Error('callback cannot be null.'); + } + + // Send request + this.beginDeleteMethod(resourceGroupName, name, options, (err, parsedResult, httpRequest, response) => { + if (err) return callback(err); + + let initialResult = new msRest.HttpOperationResponse(); + initialResult.request = httpRequest; + initialResult.response = response; + initialResult.body = response.body; + client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { + if (err) return callback(err); + + // Create Result + let result = null; + + httpRequest = pollingResult.request; + response = pollingResult.response; + let responseBody = pollingResult.body; + if (responseBody === '') responseBody = null; + + // Deserialize Response + + return callback(null, result, httpRequest, response); + }); + }); +} + +/** + * @summary Create or update an App Service Environment. + * + * Create or update an App Service Environment. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service Environment. + * + * @param {object} hostingEnvironmentEnvelope Configuration details of the App + * Service Environment. + * + * @param {string} + * hostingEnvironmentEnvelope.appServiceEnvironmentPatchResourceName Name of + * the App Service Environment. + * + * @param {string} hostingEnvironmentEnvelope.location Location of the App + * Service Environment, e.g. "West US". + * + * @param {string} [hostingEnvironmentEnvelope.vnetName] Name of the Virtual + * Network for the App Service Environment. + * + * @param {string} [hostingEnvironmentEnvelope.vnetResourceGroupName] Resource + * group of the Virtual Network. + * + * @param {string} [hostingEnvironmentEnvelope.vnetSubnetName] Subnet of the + * Virtual Network. + * + * @param {object} hostingEnvironmentEnvelope.virtualNetwork Description of the + * Virtual Network. + * + * @param {string} [hostingEnvironmentEnvelope.virtualNetwork.id] Resource id + * of the Virtual Network. + * + * @param {string} [hostingEnvironmentEnvelope.virtualNetwork.subnet] Subnet + * within the Virtual Network. + * + * @param {string} [hostingEnvironmentEnvelope.internalLoadBalancingMode] + * Specifies which endpoints to serve internally in the Virtual Network for the + * App Service Environment. Possible values include: 'None', 'Web', + * 'Publishing' + * + * @param {string} [hostingEnvironmentEnvelope.multiSize] Front-end VM size, + * e.g. "Medium", "Large". + * + * @param {number} [hostingEnvironmentEnvelope.multiRoleCount] Number of + * front-end instances. + * + * @param {array} hostingEnvironmentEnvelope.workerPools Description of worker + * pools with worker size IDs, VM sizes, and number of workers in each pool. + * + * @param {number} [hostingEnvironmentEnvelope.ipsslAddressCount] Number of IP + * SSL addresses reserved for the App Service Environment. + * + * @param {string} [hostingEnvironmentEnvelope.dnsSuffix] DNS suffix of the App + * Service Environment. + * + * @param {array} [hostingEnvironmentEnvelope.networkAccessControlList] Access + * control list for controlling traffic to the App Service Environment. + * + * @param {number} [hostingEnvironmentEnvelope.frontEndScaleFactor] Scale + * factor for front-ends. + * + * @param {string} [hostingEnvironmentEnvelope.apiManagementAccountId] API + * Management Account associated with the App Service Environment. + * + * @param {boolean} [hostingEnvironmentEnvelope.suspended] true if + * the App Service Environment is suspended; otherwise, false. The + * environment can be suspended, e.g. when the management endpoint is no longer + * available + * (most likely because NSG blocked the incoming traffic). + * + * @param {boolean} [hostingEnvironmentEnvelope.dynamicCacheEnabled] True/false + * indicating whether the App Service Environment is suspended. The environment + * can be suspended e.g. when the management endpoint is no longer available + * (most likely because NSG blocked the incoming traffic). + * + * @param {array} [hostingEnvironmentEnvelope.clusterSettings] Custom settings + * for changing the behavior of the App Service Environment. + * + * @param {array} [hostingEnvironmentEnvelope.userWhitelistedIpRanges] User + * added ip ranges to whitelist on ASE db + * + * @param {boolean} [hostingEnvironmentEnvelope.hasLinuxWorkers] Flag that + * displays whether an ASE has linux workers or not + * + * @param {string} [hostingEnvironmentEnvelope.sslCertKeyVaultId] Key Vault ID + * for ILB App Service Environment default SSL certificate + * + * @param {string} [hostingEnvironmentEnvelope.sslCertKeyVaultSecretName] Key + * Vault Secret Name for ILB App Service Environment default SSL certificate + * + * @param {string} [hostingEnvironmentEnvelope.kind] Kind of resource. + * + * @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 AppServiceEnvironmentResource} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _update(resourceGroupName, name, hostingEnvironmentEnvelope, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (hostingEnvironmentEnvelope === null || hostingEnvironmentEnvelope === undefined) { + throw new Error('hostingEnvironmentEnvelope cannot be null or undefined.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'PATCH'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (hostingEnvironmentEnvelope !== null && hostingEnvironmentEnvelope !== undefined) { + let requestModelMapper = new client.models['AppServiceEnvironmentPatchResource']().mapper(); + requestModel = client.serialize(requestModelMapper, hostingEnvironmentEnvelope, 'hostingEnvironmentEnvelope'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(hostingEnvironmentEnvelope, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 202 && statusCode !== 400 && statusCode !== 404 && statusCode !== 409) { + 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['AppServiceEnvironmentResource']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + // Deserialize Response + if (statusCode === 202) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['AppServiceEnvironmentResource']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError1 = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError1.request = msRest.stripRequest(httpRequest); + deserializationError1.response = msRest.stripResponse(response); + return callback(deserializationError1); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * @summary Get the used, available, and total worker capacity an App Service + * Environment. + * + * Get the used, available, and total worker capacity an App Service + * Environment. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service Environment. + * + * @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 StampCapacityCollection} 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 _listCapacities(resourceGroupName, name, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/capacities/compute'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['StampCapacityCollection']().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 Get IP addresses assigned to an App Service Environment. + * + * Get IP addresses assigned to an App Service Environment. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service Environment. + * + * @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 AddressResponse} 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 _listVips(resourceGroupName, name, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/capacities/virtualip'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['AddressResponse']().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 Move an App Service Environment to a different VNET. + * + * Move an App Service Environment to a different VNET. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service Environment. + * + * @param {object} vnetInfo Details for the new virtual network. + * + * @param {string} [vnetInfo.id] Resource id of the Virtual Network. + * + * @param {string} [vnetInfo.subnet] Subnet within the Virtual Network. + * + * @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 WebAppCollection} 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 _changeVnet(resourceGroupName, name, vnetInfo, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + + if (!callback) { + throw new Error('callback cannot be null.'); + } + + // Send request + this.beginChangeVnet(resourceGroupName, name, vnetInfo, options, (err, parsedResult, httpRequest, response) => { + if (err) return callback(err); + + let initialResult = new msRest.HttpOperationResponse(); + initialResult.request = httpRequest; + initialResult.response = response; + initialResult.body = response.body; + client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { + if (err) return callback(err); + + // Create Result + let result = null; + + httpRequest = pollingResult.request; + response = pollingResult.response; + let responseBody = pollingResult.body; + if (responseBody === '') responseBody = null; + + // Deserialize Response + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['WebAppCollection']().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 Get diagnostic information for an App Service Environment. + * + * Get diagnostic information for an App Service Environment. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service Environment. + * + * @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. + * + * {array} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _listDiagnostics(resourceGroupName, name, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/diagnostics'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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 = { + required: false, + serializedName: 'parsedResponse', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'HostingEnvironmentDiagnosticsElementType', + type: { + name: 'Composite', + className: 'HostingEnvironmentDiagnostics' + } + } + } + }; + 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 Get a diagnostics item for an App Service Environment. + * + * Get a diagnostics item for an App Service Environment. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service Environment. + * + * @param {string} diagnosticsName Name of the diagnostics item. + * + * @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 HostingEnvironmentDiagnostics} 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 _getDiagnosticsItem(resourceGroupName, name, diagnosticsName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (diagnosticsName === null || diagnosticsName === undefined || typeof diagnosticsName.valueOf() !== 'string') { + throw new Error('diagnosticsName cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/diagnostics/{diagnosticsName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{diagnosticsName}', encodeURIComponent(diagnosticsName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['HostingEnvironmentDiagnostics']().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 Get global metric definitions of an App Service Environment. + * + * Get global metric definitions of an App Service Environment. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service Environment. + * + * @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 MetricDefinition} 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 _listMetricDefinitions(resourceGroupName, name, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/metricdefinitions'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['MetricDefinition']().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 Get global metrics of an App Service Environment. + * + * Get global metrics of an App Service Environment. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service Environment. + * + * @param {object} [options] Optional Parameters. + * + * @param {boolean} [options.details] Specify true to include + * instance details. The default is false. + * + * @param {string} [options.filter] Return only usages/metrics specified in the + * filter. Filter conforms to odata syntax. Example: $filter=(name.value eq + * 'Metric1' or name.value eq 'Metric2') and startTime eq 2014-01-01T00:00:00Z + * and endTime eq 2014-12-31T23:59:59Z and timeGrain eq + * duration'[Hour|Minute|Day]'. + * + * @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 ResourceMetricCollection} 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 _listMetrics(resourceGroupName, name, 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 details = (options && options.details !== undefined) ? options.details : undefined; + let filter = (options && options.filter !== undefined) ? options.filter : undefined; + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (details !== null && details !== undefined && typeof details !== 'boolean') { + throw new Error('details must be of type boolean.'); + } + if (filter !== null && filter !== undefined && typeof filter.valueOf() !== 'string') { + throw new Error('filter must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/metrics'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + if (details !== null && details !== undefined) { + queryParameters.push('details=' + encodeURIComponent(details.toString())); + } + if (filter !== null && filter !== undefined) { + queryParameters.push('$filter=' + filter); + } + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['ResourceMetricCollection']().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 Get all multi-role pools. + * + * Get all multi-role pools. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service Environment. + * + * @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 WorkerPoolCollection} 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 _listMultiRolePools(resourceGroupName, name, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/multiRolePools'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['WorkerPoolCollection']().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 Get properties of a multi-role pool. + * + * Get properties of a multi-role pool. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service Environment. + * + * @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 WorkerPoolResource} 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 _getMultiRolePool(resourceGroupName, name, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/multiRolePools/default'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['WorkerPoolResource']().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 Create or update a multi-role pool. + * + * Create or update a multi-role pool. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service Environment. + * + * @param {object} multiRolePoolEnvelope Properties of the multi-role pool. + * + * @param {number} [multiRolePoolEnvelope.workerSizeId] Worker size ID for + * referencing this worker pool. + * + * @param {string} [multiRolePoolEnvelope.computeMode] Shared or dedicated app + * hosting. Possible values include: 'Shared', 'Dedicated', 'Dynamic' + * + * @param {string} [multiRolePoolEnvelope.workerSize] VM size of the worker + * pool instances. + * + * @param {number} [multiRolePoolEnvelope.workerCount] Number of instances in + * the worker pool. + * + * @param {object} [multiRolePoolEnvelope.sku] + * + * @param {string} [multiRolePoolEnvelope.sku.name] Name of the resource SKU. + * + * @param {string} [multiRolePoolEnvelope.sku.tier] Service tier of the + * resource SKU. + * + * @param {string} [multiRolePoolEnvelope.sku.size] Size specifier of the + * resource SKU. + * + * @param {string} [multiRolePoolEnvelope.sku.family] Family code of the + * resource SKU. + * + * @param {number} [multiRolePoolEnvelope.sku.capacity] Current number of + * instances assigned to the resource. + * + * @param {object} [multiRolePoolEnvelope.sku.skuCapacity] Min, max, and + * default scale values of the SKU. + * + * @param {number} [multiRolePoolEnvelope.sku.skuCapacity.minimum] Minimum + * number of workers for this App Service plan SKU. + * + * @param {number} [multiRolePoolEnvelope.sku.skuCapacity.maximum] Maximum + * number of workers for this App Service plan SKU. + * + * @param {number} [multiRolePoolEnvelope.sku.skuCapacity.default] Default + * number of workers for this App Service plan SKU. + * + * @param {string} [multiRolePoolEnvelope.sku.skuCapacity.scaleType] Available + * scale configurations for an App Service plan. + * + * @param {array} [multiRolePoolEnvelope.sku.locations] Locations of the SKU. + * + * @param {array} [multiRolePoolEnvelope.sku.capabilities] Capabilities of the + * SKU, e.g., is traffic manager enabled? + * + * @param {string} [multiRolePoolEnvelope.kind] Kind of resource. + * + * @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 WorkerPoolResource} 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 _createOrUpdateMultiRolePool(resourceGroupName, name, multiRolePoolEnvelope, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + + if (!callback) { + throw new Error('callback cannot be null.'); + } + + // Send request + this.beginCreateOrUpdateMultiRolePool(resourceGroupName, name, multiRolePoolEnvelope, options, (err, parsedResult, httpRequest, response) => { + if (err) return callback(err); + + let initialResult = new msRest.HttpOperationResponse(); + initialResult.request = httpRequest; + initialResult.response = response; + initialResult.body = response.body; + client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { + if (err) return callback(err); + + // Create Result + let result = null; + + httpRequest = pollingResult.request; + response = pollingResult.response; + let responseBody = pollingResult.body; + if (responseBody === '') responseBody = null; + + // Deserialize Response + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['WorkerPoolResource']().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 Create or update a multi-role pool. + * + * Create or update a multi-role pool. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service Environment. + * + * @param {object} multiRolePoolEnvelope Properties of the multi-role pool. + * + * @param {number} [multiRolePoolEnvelope.workerSizeId] Worker size ID for + * referencing this worker pool. + * + * @param {string} [multiRolePoolEnvelope.computeMode] Shared or dedicated app + * hosting. Possible values include: 'Shared', 'Dedicated', 'Dynamic' + * + * @param {string} [multiRolePoolEnvelope.workerSize] VM size of the worker + * pool instances. + * + * @param {number} [multiRolePoolEnvelope.workerCount] Number of instances in + * the worker pool. + * + * @param {object} [multiRolePoolEnvelope.sku] + * + * @param {string} [multiRolePoolEnvelope.sku.name] Name of the resource SKU. + * + * @param {string} [multiRolePoolEnvelope.sku.tier] Service tier of the + * resource SKU. + * + * @param {string} [multiRolePoolEnvelope.sku.size] Size specifier of the + * resource SKU. + * + * @param {string} [multiRolePoolEnvelope.sku.family] Family code of the + * resource SKU. + * + * @param {number} [multiRolePoolEnvelope.sku.capacity] Current number of + * instances assigned to the resource. + * + * @param {object} [multiRolePoolEnvelope.sku.skuCapacity] Min, max, and + * default scale values of the SKU. + * + * @param {number} [multiRolePoolEnvelope.sku.skuCapacity.minimum] Minimum + * number of workers for this App Service plan SKU. + * + * @param {number} [multiRolePoolEnvelope.sku.skuCapacity.maximum] Maximum + * number of workers for this App Service plan SKU. + * + * @param {number} [multiRolePoolEnvelope.sku.skuCapacity.default] Default + * number of workers for this App Service plan SKU. + * + * @param {string} [multiRolePoolEnvelope.sku.skuCapacity.scaleType] Available + * scale configurations for an App Service plan. + * + * @param {array} [multiRolePoolEnvelope.sku.locations] Locations of the SKU. + * + * @param {array} [multiRolePoolEnvelope.sku.capabilities] Capabilities of the + * SKU, e.g., is traffic manager enabled? + * + * @param {string} [multiRolePoolEnvelope.kind] Kind of resource. + * + * @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 WorkerPoolResource} 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 _updateMultiRolePool(resourceGroupName, name, multiRolePoolEnvelope, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (multiRolePoolEnvelope === null || multiRolePoolEnvelope === undefined) { + throw new Error('multiRolePoolEnvelope cannot be null or undefined.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/multiRolePools/default'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'PATCH'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (multiRolePoolEnvelope !== null && multiRolePoolEnvelope !== undefined) { + let requestModelMapper = new client.models['WorkerPoolResource']().mapper(); + requestModel = client.serialize(requestModelMapper, multiRolePoolEnvelope, 'multiRolePoolEnvelope'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(multiRolePoolEnvelope, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 202 && statusCode !== 400 && statusCode !== 404 && statusCode !== 409) { + 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['WorkerPoolResource']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + // Deserialize Response + if (statusCode === 202) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['WorkerPoolResource']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError1 = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError1.request = msRest.stripRequest(httpRequest); + deserializationError1.response = msRest.stripResponse(response); + return callback(deserializationError1); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * @summary Get metric definitions for a specific instance of a multi-role pool + * of an App Service Environment. + * + * Get metric definitions for a specific instance of a multi-role pool of an + * App Service Environment. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service Environment. + * + * @param {string} instance Name of the instance in the multi-role pool. + * + * @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 ResourceMetricDefinitionCollection} 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 _listMultiRolePoolInstanceMetricDefinitions(resourceGroupName, name, instance, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (instance === null || instance === undefined || typeof instance.valueOf() !== 'string') { + throw new Error('instance cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/multiRolePools/default/instances/{instance}/metricdefinitions'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{instance}', encodeURIComponent(instance)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['ResourceMetricDefinitionCollection']().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 Get metrics for a specific instance of a multi-role pool of an App + * Service Environment. + * + * Get metrics for a specific instance of a multi-role pool of an App Service + * Environment. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service Environment. + * + * @param {string} instance Name of the instance in the multi-role pool. + * + * @param {object} [options] Optional Parameters. + * + * @param {boolean} [options.details] Specify true to include + * instance details. The default is false. + * + * @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 ResourceMetricCollection} 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 _listMultiRolePoolInstanceMetrics(resourceGroupName, name, instance, 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 details = (options && options.details !== undefined) ? options.details : undefined; + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (instance === null || instance === undefined || typeof instance.valueOf() !== 'string') { + throw new Error('instance cannot be null or undefined and it must be of type string.'); + } + if (details !== null && details !== undefined && typeof details !== 'boolean') { + throw new Error('details 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.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/multiRolePools/default/instances/{instance}/metrics'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{instance}', encodeURIComponent(instance)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + if (details !== null && details !== undefined) { + queryParameters.push('details=' + encodeURIComponent(details.toString())); + } + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['ResourceMetricCollection']().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 Get metric definitions for a multi-role pool of an App Service + * Environment. + * + * Get metric definitions for a multi-role pool of an App Service Environment. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service Environment. + * + * @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 ResourceMetricDefinitionCollection} 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 _listMultiRoleMetricDefinitions(resourceGroupName, name, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/multiRolePools/default/metricdefinitions'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['ResourceMetricDefinitionCollection']().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 Get metrics for a multi-role pool of an App Service Environment. + * + * Get metrics for a multi-role pool of an App Service Environment. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service Environment. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.startTime] Beginning time of the metrics query. + * + * @param {string} [options.endTime] End time of the metrics query. + * + * @param {string} [options.timeGrain] Time granularity of the metrics query. + * + * @param {boolean} [options.details] Specify true to include + * instance details. The default is false. + * + * @param {string} [options.filter] Return only usages/metrics specified in the + * filter. Filter conforms to odata syntax. Example: $filter=(name.value eq + * 'Metric1' or name.value eq 'Metric2') and startTime eq 2014-01-01T00:00:00Z + * and endTime eq 2014-12-31T23:59:59Z and timeGrain eq + * duration'[Hour|Minute|Day]'. + * + * @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 ResourceMetricCollection} 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 _listMultiRoleMetrics(resourceGroupName, name, 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 startTime = (options && options.startTime !== undefined) ? options.startTime : undefined; + let endTime = (options && options.endTime !== undefined) ? options.endTime : undefined; + let timeGrain = (options && options.timeGrain !== undefined) ? options.timeGrain : undefined; + let details = (options && options.details !== undefined) ? options.details : undefined; + let filter = (options && options.filter !== undefined) ? options.filter : undefined; + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (startTime !== null && startTime !== undefined && typeof startTime.valueOf() !== 'string') { + throw new Error('startTime must be of type string.'); + } + if (endTime !== null && endTime !== undefined && typeof endTime.valueOf() !== 'string') { + throw new Error('endTime must be of type string.'); + } + if (timeGrain !== null && timeGrain !== undefined && typeof timeGrain.valueOf() !== 'string') { + throw new Error('timeGrain must be of type string.'); + } + if (details !== null && details !== undefined && typeof details !== 'boolean') { + throw new Error('details must be of type boolean.'); + } + if (filter !== null && filter !== undefined && typeof filter.valueOf() !== 'string') { + throw new Error('filter must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/multiRolePools/default/metrics'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + if (startTime !== null && startTime !== undefined) { + queryParameters.push('startTime=' + encodeURIComponent(startTime)); + } + if (endTime !== null && endTime !== undefined) { + queryParameters.push('endTime=' + encodeURIComponent(endTime)); + } + if (timeGrain !== null && timeGrain !== undefined) { + queryParameters.push('timeGrain=' + encodeURIComponent(timeGrain)); + } + if (details !== null && details !== undefined) { + queryParameters.push('details=' + encodeURIComponent(details.toString())); + } + if (filter !== null && filter !== undefined) { + queryParameters.push('$filter=' + filter); + } + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['ResourceMetricCollection']().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 Get available SKUs for scaling a multi-role pool. + * + * Get available SKUs for scaling a multi-role pool. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service Environment. + * + * @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 SkuInfoCollection} 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 _listMultiRolePoolSkus(resourceGroupName, name, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/multiRolePools/default/skus'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['SkuInfoCollection']().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 Get usage metrics for a multi-role pool of an App Service + * Environment. + * + * Get usage metrics for a multi-role pool of an App Service Environment. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service Environment. + * + * @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 UsageCollection} 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 _listMultiRoleUsages(resourceGroupName, name, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/multiRolePools/default/usages'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['UsageCollection']().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 List all currently running operations on the App Service + * Environment. + * + * List all currently running operations on the App Service Environment. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service Environment. + * + * @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. + * + * {array} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _listOperations(resourceGroupName, name, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/operations'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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 = { + required: false, + serializedName: 'parsedResponse', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'OperationElementType', + type: { + name: 'Composite', + className: 'Operation' + } + } + } + }; + 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 Reboot all machines in an App Service Environment. + * + * Reboot all machines in an App Service Environment. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service Environment. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _reboot(resourceGroupName, name, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/reboot'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + 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]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 202 && statusCode !== 400 && statusCode !== 404 && statusCode !== 409) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + + return callback(null, result, httpRequest, response); + }); +} + + +/** + * @summary Resume an App Service Environment. + * + * Resume an App Service Environment. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service Environment. + * + * @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 WebAppCollection} 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 _resume(resourceGroupName, name, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + + if (!callback) { + throw new Error('callback cannot be null.'); + } + + // Send request + this.beginResume(resourceGroupName, name, options, (err, parsedResult, httpRequest, response) => { + if (err) return callback(err); + + let initialResult = new msRest.HttpOperationResponse(); + initialResult.request = httpRequest; + initialResult.response = response; + initialResult.body = response.body; + client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { + if (err) return callback(err); + + // Create Result + let result = null; + + httpRequest = pollingResult.request; + response = pollingResult.response; + let responseBody = pollingResult.body; + if (responseBody === '') responseBody = null; + + // Deserialize Response + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['WebAppCollection']().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 Get all App Service plans in an App Service Environment. + * + * Get all App Service plans in an App Service Environment. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service Environment. + * + * @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 AppServicePlanCollection} 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 _listAppServicePlans(resourceGroupName, name, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/serverfarms'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['AppServicePlanCollection']().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 Get all apps in an App Service Environment. + * + * Get all apps in an App Service Environment. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service Environment. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.propertiesToInclude] Comma separated list of app + * properties to include. + * + * @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 WebAppCollection} 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 _listWebApps(resourceGroupName, name, 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 propertiesToInclude = (options && options.propertiesToInclude !== undefined) ? options.propertiesToInclude : undefined; + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (propertiesToInclude !== null && propertiesToInclude !== undefined && typeof propertiesToInclude.valueOf() !== 'string') { + throw new Error('propertiesToInclude must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/sites'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + if (propertiesToInclude !== null && propertiesToInclude !== undefined) { + queryParameters.push('propertiesToInclude=' + encodeURIComponent(propertiesToInclude)); + } + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['WebAppCollection']().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 Suspend an App Service Environment. + * + * Suspend an App Service Environment. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service Environment. + * + * @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 WebAppCollection} 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 _suspend(resourceGroupName, name, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + + if (!callback) { + throw new Error('callback cannot be null.'); + } + + // Send request + this.beginSuspend(resourceGroupName, name, options, (err, parsedResult, httpRequest, response) => { + if (err) return callback(err); + + let initialResult = new msRest.HttpOperationResponse(); + initialResult.request = httpRequest; + initialResult.response = response; + initialResult.body = response.body; + client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { + if (err) return callback(err); + + // Create Result + let result = null; + + httpRequest = pollingResult.request; + response = pollingResult.response; + let responseBody = pollingResult.body; + if (responseBody === '') responseBody = null; + + // Deserialize Response + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['WebAppCollection']().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 Get global usage metrics of an App Service Environment. + * + * Get global usage metrics of an App Service Environment. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service Environment. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.filter] Return only usages/metrics specified in the + * filter. Filter conforms to odata syntax. Example: $filter=(name.value eq + * 'Metric1' or name.value eq 'Metric2') and startTime eq 2014-01-01T00:00:00Z + * and endTime eq 2014-12-31T23:59:59Z and timeGrain eq + * duration'[Hour|Minute|Day]'. + * + * @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 CsmUsageQuotaCollection} 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 _listUsages(resourceGroupName, name, 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 filter = (options && options.filter !== undefined) ? options.filter : undefined; + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (filter !== null && filter !== undefined && typeof filter.valueOf() !== 'string') { + throw new Error('filter must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/usages'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + if (filter !== null && filter !== undefined) { + queryParameters.push('$filter=' + filter); + } + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['CsmUsageQuotaCollection']().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 Get all worker pools of an App Service Environment. + * + * Get all worker pools of an App Service Environment. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service Environment. + * + * @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 WorkerPoolCollection} 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 _listWorkerPools(resourceGroupName, name, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/workerPools'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['WorkerPoolCollection']().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 Get properties of a worker pool. + * + * Get properties of a worker pool. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service Environment. + * + * @param {string} workerPoolName Name of the worker pool. + * + * @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 WorkerPoolResource} 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 _getWorkerPool(resourceGroupName, name, workerPoolName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (workerPoolName === null || workerPoolName === undefined || typeof workerPoolName.valueOf() !== 'string') { + throw new Error('workerPoolName cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/workerPools/{workerPoolName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{workerPoolName}', encodeURIComponent(workerPoolName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['WorkerPoolResource']().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 Create or update a worker pool. + * + * Create or update a worker pool. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service Environment. + * + * @param {string} workerPoolName Name of the worker pool. + * + * @param {object} workerPoolEnvelope Properties of the worker pool. + * + * @param {number} [workerPoolEnvelope.workerSizeId] Worker size ID for + * referencing this worker pool. + * + * @param {string} [workerPoolEnvelope.computeMode] Shared or dedicated app + * hosting. Possible values include: 'Shared', 'Dedicated', 'Dynamic' + * + * @param {string} [workerPoolEnvelope.workerSize] VM size of the worker pool + * instances. + * + * @param {number} [workerPoolEnvelope.workerCount] Number of instances in the + * worker pool. + * + * @param {object} [workerPoolEnvelope.sku] + * + * @param {string} [workerPoolEnvelope.sku.name] Name of the resource SKU. + * + * @param {string} [workerPoolEnvelope.sku.tier] Service tier of the resource + * SKU. + * + * @param {string} [workerPoolEnvelope.sku.size] Size specifier of the resource + * SKU. + * + * @param {string} [workerPoolEnvelope.sku.family] Family code of the resource + * SKU. + * + * @param {number} [workerPoolEnvelope.sku.capacity] Current number of + * instances assigned to the resource. + * + * @param {object} [workerPoolEnvelope.sku.skuCapacity] Min, max, and default + * scale values of the SKU. + * + * @param {number} [workerPoolEnvelope.sku.skuCapacity.minimum] Minimum number + * of workers for this App Service plan SKU. + * + * @param {number} [workerPoolEnvelope.sku.skuCapacity.maximum] Maximum number + * of workers for this App Service plan SKU. + * + * @param {number} [workerPoolEnvelope.sku.skuCapacity.default] Default number + * of workers for this App Service plan SKU. + * + * @param {string} [workerPoolEnvelope.sku.skuCapacity.scaleType] Available + * scale configurations for an App Service plan. + * + * @param {array} [workerPoolEnvelope.sku.locations] Locations of the SKU. + * + * @param {array} [workerPoolEnvelope.sku.capabilities] Capabilities of the + * SKU, e.g., is traffic manager enabled? + * + * @param {string} [workerPoolEnvelope.kind] Kind of resource. + * + * @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 WorkerPoolResource} 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 _createOrUpdateWorkerPool(resourceGroupName, name, workerPoolName, workerPoolEnvelope, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + + if (!callback) { + throw new Error('callback cannot be null.'); + } + + // Send request + this.beginCreateOrUpdateWorkerPool(resourceGroupName, name, workerPoolName, workerPoolEnvelope, options, (err, parsedResult, httpRequest, response) => { + if (err) return callback(err); + + let initialResult = new msRest.HttpOperationResponse(); + initialResult.request = httpRequest; + initialResult.response = response; + initialResult.body = response.body; + client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { + if (err) return callback(err); + + // Create Result + let result = null; + + httpRequest = pollingResult.request; + response = pollingResult.response; + let responseBody = pollingResult.body; + if (responseBody === '') responseBody = null; + + // Deserialize Response + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['WorkerPoolResource']().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 Create or update a worker pool. + * + * Create or update a worker pool. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service Environment. + * + * @param {string} workerPoolName Name of the worker pool. + * + * @param {object} workerPoolEnvelope Properties of the worker pool. + * + * @param {number} [workerPoolEnvelope.workerSizeId] Worker size ID for + * referencing this worker pool. + * + * @param {string} [workerPoolEnvelope.computeMode] Shared or dedicated app + * hosting. Possible values include: 'Shared', 'Dedicated', 'Dynamic' + * + * @param {string} [workerPoolEnvelope.workerSize] VM size of the worker pool + * instances. + * + * @param {number} [workerPoolEnvelope.workerCount] Number of instances in the + * worker pool. + * + * @param {object} [workerPoolEnvelope.sku] + * + * @param {string} [workerPoolEnvelope.sku.name] Name of the resource SKU. + * + * @param {string} [workerPoolEnvelope.sku.tier] Service tier of the resource + * SKU. + * + * @param {string} [workerPoolEnvelope.sku.size] Size specifier of the resource + * SKU. + * + * @param {string} [workerPoolEnvelope.sku.family] Family code of the resource + * SKU. + * + * @param {number} [workerPoolEnvelope.sku.capacity] Current number of + * instances assigned to the resource. + * + * @param {object} [workerPoolEnvelope.sku.skuCapacity] Min, max, and default + * scale values of the SKU. + * + * @param {number} [workerPoolEnvelope.sku.skuCapacity.minimum] Minimum number + * of workers for this App Service plan SKU. + * + * @param {number} [workerPoolEnvelope.sku.skuCapacity.maximum] Maximum number + * of workers for this App Service plan SKU. + * + * @param {number} [workerPoolEnvelope.sku.skuCapacity.default] Default number + * of workers for this App Service plan SKU. + * + * @param {string} [workerPoolEnvelope.sku.skuCapacity.scaleType] Available + * scale configurations for an App Service plan. + * + * @param {array} [workerPoolEnvelope.sku.locations] Locations of the SKU. + * + * @param {array} [workerPoolEnvelope.sku.capabilities] Capabilities of the + * SKU, e.g., is traffic manager enabled? + * + * @param {string} [workerPoolEnvelope.kind] Kind of resource. + * + * @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 WorkerPoolResource} 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 _updateWorkerPool(resourceGroupName, name, workerPoolName, workerPoolEnvelope, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (workerPoolName === null || workerPoolName === undefined || typeof workerPoolName.valueOf() !== 'string') { + throw new Error('workerPoolName cannot be null or undefined and it must be of type string.'); + } + if (workerPoolEnvelope === null || workerPoolEnvelope === undefined) { + throw new Error('workerPoolEnvelope cannot be null or undefined.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/workerPools/{workerPoolName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{workerPoolName}', encodeURIComponent(workerPoolName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'PATCH'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (workerPoolEnvelope !== null && workerPoolEnvelope !== undefined) { + let requestModelMapper = new client.models['WorkerPoolResource']().mapper(); + requestModel = client.serialize(requestModelMapper, workerPoolEnvelope, 'workerPoolEnvelope'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(workerPoolEnvelope, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 202 && statusCode !== 400 && statusCode !== 404 && statusCode !== 409) { + 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['WorkerPoolResource']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + // Deserialize Response + if (statusCode === 202) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['WorkerPoolResource']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError1 = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError1.request = msRest.stripRequest(httpRequest); + deserializationError1.response = msRest.stripResponse(response); + return callback(deserializationError1); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * @summary Get metric definitions for a specific instance of a worker pool of + * an App Service Environment. + * + * Get metric definitions for a specific instance of a worker pool of an App + * Service Environment. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service Environment. + * + * @param {string} workerPoolName Name of the worker pool. + * + * @param {string} instance Name of the instance in the worker pool. + * + * @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 ResourceMetricDefinitionCollection} 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 _listWorkerPoolInstanceMetricDefinitions(resourceGroupName, name, workerPoolName, instance, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (workerPoolName === null || workerPoolName === undefined || typeof workerPoolName.valueOf() !== 'string') { + throw new Error('workerPoolName cannot be null or undefined and it must be of type string.'); + } + if (instance === null || instance === undefined || typeof instance.valueOf() !== 'string') { + throw new Error('instance cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/workerPools/{workerPoolName}/instances/{instance}/metricdefinitions'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{workerPoolName}', encodeURIComponent(workerPoolName)); + requestUrl = requestUrl.replace('{instance}', encodeURIComponent(instance)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['ResourceMetricDefinitionCollection']().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 Get metrics for a specific instance of a worker pool of an App + * Service Environment. + * + * Get metrics for a specific instance of a worker pool of an App Service + * Environment. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service Environment. + * + * @param {string} workerPoolName Name of the worker pool. + * + * @param {string} instance Name of the instance in the worker pool. + * + * @param {object} [options] Optional Parameters. + * + * @param {boolean} [options.details] Specify true to include + * instance details. The default is false. + * + * @param {string} [options.filter] Return only usages/metrics specified in the + * filter. Filter conforms to odata syntax. Example: $filter=(name.value eq + * 'Metric1' or name.value eq 'Metric2') and startTime eq 2014-01-01T00:00:00Z + * and endTime eq 2014-12-31T23:59:59Z and timeGrain eq + * duration'[Hour|Minute|Day]'. + * + * @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 ResourceMetricCollection} 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 _listWorkerPoolInstanceMetrics(resourceGroupName, name, workerPoolName, instance, 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 details = (options && options.details !== undefined) ? options.details : undefined; + let filter = (options && options.filter !== undefined) ? options.filter : undefined; + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (workerPoolName === null || workerPoolName === undefined || typeof workerPoolName.valueOf() !== 'string') { + throw new Error('workerPoolName cannot be null or undefined and it must be of type string.'); + } + if (instance === null || instance === undefined || typeof instance.valueOf() !== 'string') { + throw new Error('instance cannot be null or undefined and it must be of type string.'); + } + if (details !== null && details !== undefined && typeof details !== 'boolean') { + throw new Error('details must be of type boolean.'); + } + if (filter !== null && filter !== undefined && typeof filter.valueOf() !== 'string') { + throw new Error('filter must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/workerPools/{workerPoolName}/instances/{instance}/metrics'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{workerPoolName}', encodeURIComponent(workerPoolName)); + requestUrl = requestUrl.replace('{instance}', encodeURIComponent(instance)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + if (details !== null && details !== undefined) { + queryParameters.push('details=' + encodeURIComponent(details.toString())); + } + if (filter !== null && filter !== undefined) { + queryParameters.push('$filter=' + filter); + } + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['ResourceMetricCollection']().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 Get metric definitions for a worker pool of an App Service + * Environment. + * + * Get metric definitions for a worker pool of an App Service Environment. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service Environment. + * + * @param {string} workerPoolName Name of the worker pool. + * + * @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 ResourceMetricDefinitionCollection} 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 _listWebWorkerMetricDefinitions(resourceGroupName, name, workerPoolName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (workerPoolName === null || workerPoolName === undefined || typeof workerPoolName.valueOf() !== 'string') { + throw new Error('workerPoolName cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/workerPools/{workerPoolName}/metricdefinitions'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{workerPoolName}', encodeURIComponent(workerPoolName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['ResourceMetricDefinitionCollection']().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 Get metrics for a worker pool of a AppServiceEnvironment (App + * Service Environment). + * + * Get metrics for a worker pool of a AppServiceEnvironment (App Service + * Environment). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service Environment. + * + * @param {string} workerPoolName Name of worker pool + * + * @param {object} [options] Optional Parameters. + * + * @param {boolean} [options.details] Specify true to include + * instance details. The default is false. + * + * @param {string} [options.filter] Return only usages/metrics specified in the + * filter. Filter conforms to odata syntax. Example: $filter=(name.value eq + * 'Metric1' or name.value eq 'Metric2') and startTime eq 2014-01-01T00:00:00Z + * and endTime eq 2014-12-31T23:59:59Z and timeGrain eq + * duration'[Hour|Minute|Day]'. + * + * @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 ResourceMetricCollection} 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 _listWebWorkerMetrics(resourceGroupName, name, workerPoolName, 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 details = (options && options.details !== undefined) ? options.details : undefined; + let filter = (options && options.filter !== undefined) ? options.filter : undefined; + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (workerPoolName === null || workerPoolName === undefined || typeof workerPoolName.valueOf() !== 'string') { + throw new Error('workerPoolName cannot be null or undefined and it must be of type string.'); + } + if (details !== null && details !== undefined && typeof details !== 'boolean') { + throw new Error('details must be of type boolean.'); + } + if (filter !== null && filter !== undefined && typeof filter.valueOf() !== 'string') { + throw new Error('filter must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/workerPools/{workerPoolName}/metrics'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{workerPoolName}', encodeURIComponent(workerPoolName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + if (details !== null && details !== undefined) { + queryParameters.push('details=' + encodeURIComponent(details.toString())); + } + if (filter !== null && filter !== undefined) { + queryParameters.push('$filter=' + filter); + } + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['ResourceMetricCollection']().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 Get available SKUs for scaling a worker pool. + * + * Get available SKUs for scaling a worker pool. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service Environment. + * + * @param {string} workerPoolName Name of the worker pool. + * + * @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 SkuInfoCollection} 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 _listWorkerPoolSkus(resourceGroupName, name, workerPoolName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (workerPoolName === null || workerPoolName === undefined || typeof workerPoolName.valueOf() !== 'string') { + throw new Error('workerPoolName cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/workerPools/{workerPoolName}/skus'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{workerPoolName}', encodeURIComponent(workerPoolName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['SkuInfoCollection']().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 Get usage metrics for a worker pool of an App Service Environment. + * + * Get usage metrics for a worker pool of an App Service Environment. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service Environment. + * + * @param {string} workerPoolName Name of the worker pool. + * + * @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 UsageCollection} 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 _listWebWorkerUsages(resourceGroupName, name, workerPoolName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (workerPoolName === null || workerPoolName === undefined || typeof workerPoolName.valueOf() !== 'string') { + throw new Error('workerPoolName cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/workerPools/{workerPoolName}/usages'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{workerPoolName}', encodeURIComponent(workerPoolName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['UsageCollection']().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 Create or update an App Service Environment. + * + * Create or update an App Service Environment. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service Environment. + * + * @param {object} hostingEnvironmentEnvelope Configuration details of the App + * Service Environment. + * + * @param {string} hostingEnvironmentEnvelope.appServiceEnvironmentResourceName + * Name of the App Service Environment. + * + * @param {string} + * hostingEnvironmentEnvelope.appServiceEnvironmentResourceLocation Location of + * the App Service Environment, e.g. "West US". + * + * @param {string} [hostingEnvironmentEnvelope.vnetName] Name of the Virtual + * Network for the App Service Environment. + * + * @param {string} [hostingEnvironmentEnvelope.vnetResourceGroupName] Resource + * group of the Virtual Network. + * + * @param {string} [hostingEnvironmentEnvelope.vnetSubnetName] Subnet of the + * Virtual Network. + * + * @param {object} hostingEnvironmentEnvelope.virtualNetwork Description of the + * Virtual Network. + * + * @param {string} [hostingEnvironmentEnvelope.virtualNetwork.id] Resource id + * of the Virtual Network. + * + * @param {string} [hostingEnvironmentEnvelope.virtualNetwork.subnet] Subnet + * within the Virtual Network. + * + * @param {string} [hostingEnvironmentEnvelope.internalLoadBalancingMode] + * Specifies which endpoints to serve internally in the Virtual Network for the + * App Service Environment. Possible values include: 'None', 'Web', + * 'Publishing' + * + * @param {string} [hostingEnvironmentEnvelope.multiSize] Front-end VM size, + * e.g. "Medium", "Large". + * + * @param {number} [hostingEnvironmentEnvelope.multiRoleCount] Number of + * front-end instances. + * + * @param {array} hostingEnvironmentEnvelope.workerPools Description of worker + * pools with worker size IDs, VM sizes, and number of workers in each pool. + * + * @param {number} [hostingEnvironmentEnvelope.ipsslAddressCount] Number of IP + * SSL addresses reserved for the App Service Environment. + * + * @param {string} [hostingEnvironmentEnvelope.dnsSuffix] DNS suffix of the App + * Service Environment. + * + * @param {array} [hostingEnvironmentEnvelope.networkAccessControlList] Access + * control list for controlling traffic to the App Service Environment. + * + * @param {number} [hostingEnvironmentEnvelope.frontEndScaleFactor] Scale + * factor for front-ends. + * + * @param {string} [hostingEnvironmentEnvelope.apiManagementAccountId] API + * Management Account associated with the App Service Environment. + * + * @param {boolean} [hostingEnvironmentEnvelope.suspended] true if + * the App Service Environment is suspended; otherwise, false. The + * environment can be suspended, e.g. when the management endpoint is no longer + * available + * (most likely because NSG blocked the incoming traffic). + * + * @param {boolean} [hostingEnvironmentEnvelope.dynamicCacheEnabled] True/false + * indicating whether the App Service Environment is suspended. The environment + * can be suspended e.g. when the management endpoint is no longer available + * (most likely because NSG blocked the incoming traffic). + * + * @param {array} [hostingEnvironmentEnvelope.clusterSettings] Custom settings + * for changing the behavior of the App Service Environment. + * + * @param {array} [hostingEnvironmentEnvelope.userWhitelistedIpRanges] User + * added ip ranges to whitelist on ASE db + * + * @param {boolean} [hostingEnvironmentEnvelope.hasLinuxWorkers] Flag that + * displays whether an ASE has linux workers or not + * + * @param {string} [hostingEnvironmentEnvelope.sslCertKeyVaultId] Key Vault ID + * for ILB App Service Environment default SSL certificate + * + * @param {string} [hostingEnvironmentEnvelope.sslCertKeyVaultSecretName] Key + * Vault Secret Name for ILB App Service Environment default SSL certificate + * + * @param {string} [hostingEnvironmentEnvelope.kind] Kind of resource. + * + * @param {string} hostingEnvironmentEnvelope.location Resource Location. + * + * @param {object} [hostingEnvironmentEnvelope.tags] Resource tags. + * + * @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 AppServiceEnvironmentResource} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _beginCreateOrUpdate(resourceGroupName, name, hostingEnvironmentEnvelope, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (hostingEnvironmentEnvelope === null || hostingEnvironmentEnvelope === undefined) { + throw new Error('hostingEnvironmentEnvelope cannot be null or undefined.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'PUT'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (hostingEnvironmentEnvelope !== null && hostingEnvironmentEnvelope !== undefined) { + let requestModelMapper = new client.models['AppServiceEnvironmentResource']().mapper(); + requestModel = client.serialize(requestModelMapper, hostingEnvironmentEnvelope, 'hostingEnvironmentEnvelope'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(hostingEnvironmentEnvelope, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 202 && statusCode !== 400 && statusCode !== 404 && statusCode !== 409) { + 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['AppServiceEnvironmentResource']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + // Deserialize Response + if (statusCode === 202) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['AppServiceEnvironmentResource']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError1 = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError1.request = msRest.stripRequest(httpRequest); + deserializationError1.response = msRest.stripResponse(response); + return callback(deserializationError1); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * @summary Delete an App Service Environment. + * + * Delete an App Service Environment. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service Environment. + * + * @param {object} [options] Optional Parameters. + * + * @param {boolean} [options.forceDelete] Specify true to force + * the deletion even if the App Service Environment contains resources. The + * default is false. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _beginDeleteMethod(resourceGroupName, name, 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 forceDelete = (options && options.forceDelete !== undefined) ? options.forceDelete : undefined; + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (forceDelete !== null && forceDelete !== undefined && typeof forceDelete !== 'boolean') { + throw new Error('forceDelete 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.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + if (forceDelete !== null && forceDelete !== undefined) { + queryParameters.push('forceDelete=' + encodeURIComponent(forceDelete.toString())); + } + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'DELETE'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 202 && statusCode !== 204 && statusCode !== 400 && statusCode !== 404 && statusCode !== 409) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + + return callback(null, result, httpRequest, response); + }); +} + +/** + * @summary Move an App Service Environment to a different VNET. + * + * Move an App Service Environment to a different VNET. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service Environment. + * + * @param {object} vnetInfo Details for the new virtual network. + * + * @param {string} [vnetInfo.id] Resource id of the Virtual Network. + * + * @param {string} [vnetInfo.subnet] Subnet within the Virtual Network. + * + * @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 WebAppCollection} 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 _beginChangeVnet(resourceGroupName, name, vnetInfo, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (vnetInfo === null || vnetInfo === undefined) { + throw new Error('vnetInfo cannot be null or undefined.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/changeVirtualNetwork'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + 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 (vnetInfo !== null && vnetInfo !== undefined) { + let requestModelMapper = new client.models['VirtualNetworkProfile']().mapper(); + requestModel = client.serialize(requestModelMapper, vnetInfo, 'vnetInfo'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(vnetInfo, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 202) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['WebAppCollection']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + // Deserialize Response + if (statusCode === 202) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['WebAppCollection']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError1 = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError1.request = msRest.stripRequest(httpRequest); + deserializationError1.response = msRest.stripResponse(response); + return callback(deserializationError1); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * @summary Create or update a multi-role pool. + * + * Create or update a multi-role pool. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service Environment. + * + * @param {object} multiRolePoolEnvelope Properties of the multi-role pool. + * + * @param {number} [multiRolePoolEnvelope.workerSizeId] Worker size ID for + * referencing this worker pool. + * + * @param {string} [multiRolePoolEnvelope.computeMode] Shared or dedicated app + * hosting. Possible values include: 'Shared', 'Dedicated', 'Dynamic' + * + * @param {string} [multiRolePoolEnvelope.workerSize] VM size of the worker + * pool instances. + * + * @param {number} [multiRolePoolEnvelope.workerCount] Number of instances in + * the worker pool. + * + * @param {object} [multiRolePoolEnvelope.sku] + * + * @param {string} [multiRolePoolEnvelope.sku.name] Name of the resource SKU. + * + * @param {string} [multiRolePoolEnvelope.sku.tier] Service tier of the + * resource SKU. + * + * @param {string} [multiRolePoolEnvelope.sku.size] Size specifier of the + * resource SKU. + * + * @param {string} [multiRolePoolEnvelope.sku.family] Family code of the + * resource SKU. + * + * @param {number} [multiRolePoolEnvelope.sku.capacity] Current number of + * instances assigned to the resource. + * + * @param {object} [multiRolePoolEnvelope.sku.skuCapacity] Min, max, and + * default scale values of the SKU. + * + * @param {number} [multiRolePoolEnvelope.sku.skuCapacity.minimum] Minimum + * number of workers for this App Service plan SKU. + * + * @param {number} [multiRolePoolEnvelope.sku.skuCapacity.maximum] Maximum + * number of workers for this App Service plan SKU. + * + * @param {number} [multiRolePoolEnvelope.sku.skuCapacity.default] Default + * number of workers for this App Service plan SKU. + * + * @param {string} [multiRolePoolEnvelope.sku.skuCapacity.scaleType] Available + * scale configurations for an App Service plan. + * + * @param {array} [multiRolePoolEnvelope.sku.locations] Locations of the SKU. + * + * @param {array} [multiRolePoolEnvelope.sku.capabilities] Capabilities of the + * SKU, e.g., is traffic manager enabled? + * + * @param {string} [multiRolePoolEnvelope.kind] Kind of resource. + * + * @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 WorkerPoolResource} 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 _beginCreateOrUpdateMultiRolePool(resourceGroupName, name, multiRolePoolEnvelope, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (multiRolePoolEnvelope === null || multiRolePoolEnvelope === undefined) { + throw new Error('multiRolePoolEnvelope cannot be null or undefined.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/multiRolePools/default'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'PUT'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (multiRolePoolEnvelope !== null && multiRolePoolEnvelope !== undefined) { + let requestModelMapper = new client.models['WorkerPoolResource']().mapper(); + requestModel = client.serialize(requestModelMapper, multiRolePoolEnvelope, 'multiRolePoolEnvelope'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(multiRolePoolEnvelope, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 202 && statusCode !== 400 && statusCode !== 404 && statusCode !== 409) { + 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['WorkerPoolResource']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + // Deserialize Response + if (statusCode === 202) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['WorkerPoolResource']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError1 = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError1.request = msRest.stripRequest(httpRequest); + deserializationError1.response = msRest.stripResponse(response); + return callback(deserializationError1); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * @summary Resume an App Service Environment. + * + * Resume an App Service Environment. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service Environment. + * + * @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 WebAppCollection} 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 _beginResume(resourceGroupName, name, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/resume'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + 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]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 202) { + 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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['WebAppCollection']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + // Deserialize Response + if (statusCode === 202) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['WebAppCollection']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError1 = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError1.request = msRest.stripRequest(httpRequest); + deserializationError1.response = msRest.stripResponse(response); + return callback(deserializationError1); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * @summary Suspend an App Service Environment. + * + * Suspend an App Service Environment. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service Environment. + * + * @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 WebAppCollection} 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 _beginSuspend(resourceGroupName, name, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/suspend'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + 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]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 202) { + 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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['WebAppCollection']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + // Deserialize Response + if (statusCode === 202) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['WebAppCollection']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError1 = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError1.request = msRest.stripRequest(httpRequest); + deserializationError1.response = msRest.stripResponse(response); + return callback(deserializationError1); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * @summary Create or update a worker pool. + * + * Create or update a worker pool. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service Environment. + * + * @param {string} workerPoolName Name of the worker pool. + * + * @param {object} workerPoolEnvelope Properties of the worker pool. + * + * @param {number} [workerPoolEnvelope.workerSizeId] Worker size ID for + * referencing this worker pool. + * + * @param {string} [workerPoolEnvelope.computeMode] Shared or dedicated app + * hosting. Possible values include: 'Shared', 'Dedicated', 'Dynamic' + * + * @param {string} [workerPoolEnvelope.workerSize] VM size of the worker pool + * instances. + * + * @param {number} [workerPoolEnvelope.workerCount] Number of instances in the + * worker pool. + * + * @param {object} [workerPoolEnvelope.sku] + * + * @param {string} [workerPoolEnvelope.sku.name] Name of the resource SKU. + * + * @param {string} [workerPoolEnvelope.sku.tier] Service tier of the resource + * SKU. + * + * @param {string} [workerPoolEnvelope.sku.size] Size specifier of the resource + * SKU. + * + * @param {string} [workerPoolEnvelope.sku.family] Family code of the resource + * SKU. + * + * @param {number} [workerPoolEnvelope.sku.capacity] Current number of + * instances assigned to the resource. + * + * @param {object} [workerPoolEnvelope.sku.skuCapacity] Min, max, and default + * scale values of the SKU. + * + * @param {number} [workerPoolEnvelope.sku.skuCapacity.minimum] Minimum number + * of workers for this App Service plan SKU. + * + * @param {number} [workerPoolEnvelope.sku.skuCapacity.maximum] Maximum number + * of workers for this App Service plan SKU. + * + * @param {number} [workerPoolEnvelope.sku.skuCapacity.default] Default number + * of workers for this App Service plan SKU. + * + * @param {string} [workerPoolEnvelope.sku.skuCapacity.scaleType] Available + * scale configurations for an App Service plan. + * + * @param {array} [workerPoolEnvelope.sku.locations] Locations of the SKU. + * + * @param {array} [workerPoolEnvelope.sku.capabilities] Capabilities of the + * SKU, e.g., is traffic manager enabled? + * + * @param {string} [workerPoolEnvelope.kind] Kind of resource. + * + * @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 WorkerPoolResource} 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 _beginCreateOrUpdateWorkerPool(resourceGroupName, name, workerPoolName, workerPoolEnvelope, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (workerPoolName === null || workerPoolName === undefined || typeof workerPoolName.valueOf() !== 'string') { + throw new Error('workerPoolName cannot be null or undefined and it must be of type string.'); + } + if (workerPoolEnvelope === null || workerPoolEnvelope === undefined) { + throw new Error('workerPoolEnvelope cannot be null or undefined.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/workerPools/{workerPoolName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{workerPoolName}', encodeURIComponent(workerPoolName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'PUT'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (workerPoolEnvelope !== null && workerPoolEnvelope !== undefined) { + let requestModelMapper = new client.models['WorkerPoolResource']().mapper(); + requestModel = client.serialize(requestModelMapper, workerPoolEnvelope, 'workerPoolEnvelope'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(workerPoolEnvelope, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 202 && statusCode !== 400 && statusCode !== 404 && statusCode !== 409) { + 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['WorkerPoolResource']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + // Deserialize Response + if (statusCode === 202) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['WorkerPoolResource']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError1 = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError1.request = msRest.stripRequest(httpRequest); + deserializationError1.response = msRest.stripResponse(response); + return callback(deserializationError1); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * @summary Get all App Service Environments for a subscription. + * + * Get all App Service Environments for a subscription. + * + * @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 AppServiceEnvironmentCollection} 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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['AppServiceEnvironmentCollection']().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 Get all App Service Environments in a resource group. + * + * Get all App Service Environments in a resource group. + * + * @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 AppServiceEnvironmentCollection} 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 _listByResourceGroupNext(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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['AppServiceEnvironmentCollection']().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 Get the used, available, and total worker capacity an App Service + * Environment. + * + * Get the used, available, and total worker capacity an App Service + * Environment. + * + * @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 StampCapacityCollection} 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 _listCapacitiesNext(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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['StampCapacityCollection']().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 Move an App Service Environment to a different VNET. + * + * Move an App Service Environment to a different VNET. + * + * @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 WebAppCollection} 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 _changeVnetNext(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.'); + } + + // Send request + this.beginChangeVnetNext(nextPageLink, options, (err, parsedResult, httpRequest, response) => { + if (err) return callback(err); + + let initialResult = new msRest.HttpOperationResponse(); + initialResult.request = httpRequest; + initialResult.response = response; + initialResult.body = response.body; + client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { + if (err) return callback(err); + + // Create Result + let result = null; + + httpRequest = pollingResult.request; + response = pollingResult.response; + let responseBody = pollingResult.body; + if (responseBody === '') responseBody = null; + + // Deserialize Response + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['WebAppCollection']().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 Get global metrics of an App Service Environment. + * + * Get global metrics of an App Service Environment. + * + * @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 ResourceMetricCollection} 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 _listMetricsNext(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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['ResourceMetricCollection']().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 Get all multi-role pools. + * + * Get all multi-role pools. + * + * @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 WorkerPoolCollection} 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 _listMultiRolePoolsNext(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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['WorkerPoolCollection']().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 Get metric definitions for a specific instance of a multi-role pool + * of an App Service Environment. + * + * Get metric definitions for a specific instance of a multi-role pool of an + * App Service Environment. + * + * @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 ResourceMetricDefinitionCollection} 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 _listMultiRolePoolInstanceMetricDefinitionsNext(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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['ResourceMetricDefinitionCollection']().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 Get metrics for a specific instance of a multi-role pool of an App + * Service Environment. + * + * Get metrics for a specific instance of a multi-role pool of an App Service + * Environment. + * + * @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 ResourceMetricCollection} 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 _listMultiRolePoolInstanceMetricsNext(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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['ResourceMetricCollection']().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 Get metric definitions for a multi-role pool of an App Service + * Environment. + * + * Get metric definitions for a multi-role pool of an App Service Environment. + * + * @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 ResourceMetricDefinitionCollection} 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 _listMultiRoleMetricDefinitionsNext(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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['ResourceMetricDefinitionCollection']().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 Get metrics for a multi-role pool of an App Service Environment. + * + * Get metrics for a multi-role pool of an App Service Environment. + * + * @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 ResourceMetricCollection} 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 _listMultiRoleMetricsNext(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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['ResourceMetricCollection']().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 Get available SKUs for scaling a multi-role pool. + * + * Get available SKUs for scaling a multi-role pool. + * + * @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 SkuInfoCollection} 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 _listMultiRolePoolSkusNext(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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['SkuInfoCollection']().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 Get usage metrics for a multi-role pool of an App Service + * Environment. + * + * Get usage metrics for a multi-role pool of an App Service Environment. + * + * @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 UsageCollection} 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 _listMultiRoleUsagesNext(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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['UsageCollection']().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 Resume an App Service Environment. + * + * Resume an App Service Environment. + * + * @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 WebAppCollection} 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 _resumeNext(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.'); + } + + // Send request + this.beginResumeNext(nextPageLink, options, (err, parsedResult, httpRequest, response) => { + if (err) return callback(err); + + let initialResult = new msRest.HttpOperationResponse(); + initialResult.request = httpRequest; + initialResult.response = response; + initialResult.body = response.body; + client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { + if (err) return callback(err); + + // Create Result + let result = null; + + httpRequest = pollingResult.request; + response = pollingResult.response; + let responseBody = pollingResult.body; + if (responseBody === '') responseBody = null; + + // Deserialize Response + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['WebAppCollection']().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 Get all App Service plans in an App Service Environment. + * + * Get all App Service plans in an App Service Environment. + * + * @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 AppServicePlanCollection} 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 _listAppServicePlansNext(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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['AppServicePlanCollection']().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 Get all apps in an App Service Environment. + * + * Get all apps in an App Service Environment. + * + * @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 WebAppCollection} 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 _listWebAppsNext(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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['WebAppCollection']().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 Suspend an App Service Environment. + * + * Suspend an App Service Environment. + * + * @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 WebAppCollection} 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 _suspendNext(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.'); + } + + // Send request + this.beginSuspendNext(nextPageLink, options, (err, parsedResult, httpRequest, response) => { + if (err) return callback(err); + + let initialResult = new msRest.HttpOperationResponse(); + initialResult.request = httpRequest; + initialResult.response = response; + initialResult.body = response.body; + client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { + if (err) return callback(err); + + // Create Result + let result = null; + + httpRequest = pollingResult.request; + response = pollingResult.response; + let responseBody = pollingResult.body; + if (responseBody === '') responseBody = null; + + // Deserialize Response + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['WebAppCollection']().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 Get global usage metrics of an App Service Environment. + * + * Get global usage metrics of an App Service Environment. + * + * @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 CsmUsageQuotaCollection} 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 _listUsagesNext(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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['CsmUsageQuotaCollection']().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 Get all worker pools of an App Service Environment. + * + * Get all worker pools of an App Service Environment. + * + * @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 WorkerPoolCollection} 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 _listWorkerPoolsNext(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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['WorkerPoolCollection']().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 Get metric definitions for a specific instance of a worker pool of + * an App Service Environment. + * + * Get metric definitions for a specific instance of a worker pool of an App + * Service Environment. + * + * @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 ResourceMetricDefinitionCollection} 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 _listWorkerPoolInstanceMetricDefinitionsNext(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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['ResourceMetricDefinitionCollection']().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 Get metrics for a specific instance of a worker pool of an App + * Service Environment. + * + * Get metrics for a specific instance of a worker pool of an App Service + * Environment. + * + * @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 ResourceMetricCollection} 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 _listWorkerPoolInstanceMetricsNext(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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['ResourceMetricCollection']().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 Get metric definitions for a worker pool of an App Service + * Environment. + * + * Get metric definitions for a worker pool of an App Service Environment. + * + * @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 ResourceMetricDefinitionCollection} 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 _listWebWorkerMetricDefinitionsNext(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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['ResourceMetricDefinitionCollection']().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 Get metrics for a worker pool of a AppServiceEnvironment (App + * Service Environment). + * + * Get metrics for a worker pool of a AppServiceEnvironment (App Service + * Environment). + * + * @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 ResourceMetricCollection} 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 _listWebWorkerMetricsNext(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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['ResourceMetricCollection']().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 Get available SKUs for scaling a worker pool. + * + * Get available SKUs for scaling a worker pool. + * + * @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 SkuInfoCollection} 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 _listWorkerPoolSkusNext(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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['SkuInfoCollection']().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 Get usage metrics for a worker pool of an App Service Environment. + * + * Get usage metrics for a worker pool of an App Service Environment. + * + * @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 UsageCollection} 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 _listWebWorkerUsagesNext(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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['UsageCollection']().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 Move an App Service Environment to a different VNET. + * + * Move an App Service Environment to a different VNET. + * + * @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 WebAppCollection} 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 _beginChangeVnetNext(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 = '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]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 202) { + 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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['WebAppCollection']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + // Deserialize Response + if (statusCode === 202) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['WebAppCollection']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError1 = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError1.request = msRest.stripRequest(httpRequest); + deserializationError1.response = msRest.stripResponse(response); + return callback(deserializationError1); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * @summary Resume an App Service Environment. + * + * Resume an App Service Environment. + * + * @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 WebAppCollection} 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 _beginResumeNext(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 = '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]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 202) { + 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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['WebAppCollection']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + // Deserialize Response + if (statusCode === 202) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['WebAppCollection']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError1 = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError1.request = msRest.stripRequest(httpRequest); + deserializationError1.response = msRest.stripResponse(response); + return callback(deserializationError1); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * @summary Suspend an App Service Environment. + * + * Suspend an App Service Environment. + * + * @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 WebAppCollection} 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 _beginSuspendNext(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 = '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]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 202) { + 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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['WebAppCollection']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + // Deserialize Response + if (statusCode === 202) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['WebAppCollection']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError1 = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError1.request = msRest.stripRequest(httpRequest); + deserializationError1.response = msRest.stripResponse(response); + return callback(deserializationError1); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** Class representing a AppServiceEnvironments. */ +class AppServiceEnvironments { + /** + * Create a AppServiceEnvironments. + * @param {WebSiteManagementClient} client Reference to the service client. + */ + constructor(client) { + this.client = client; + this._list = _list; + this._listByResourceGroup = _listByResourceGroup; + this._get = _get; + this._createOrUpdate = _createOrUpdate; + this._deleteMethod = _deleteMethod; + this._update = _update; + this._listCapacities = _listCapacities; + this._listVips = _listVips; + this._changeVnet = _changeVnet; + this._listDiagnostics = _listDiagnostics; + this._getDiagnosticsItem = _getDiagnosticsItem; + this._listMetricDefinitions = _listMetricDefinitions; + this._listMetrics = _listMetrics; + this._listMultiRolePools = _listMultiRolePools; + this._getMultiRolePool = _getMultiRolePool; + this._createOrUpdateMultiRolePool = _createOrUpdateMultiRolePool; + this._updateMultiRolePool = _updateMultiRolePool; + this._listMultiRolePoolInstanceMetricDefinitions = _listMultiRolePoolInstanceMetricDefinitions; + this._listMultiRolePoolInstanceMetrics = _listMultiRolePoolInstanceMetrics; + this._listMultiRoleMetricDefinitions = _listMultiRoleMetricDefinitions; + this._listMultiRoleMetrics = _listMultiRoleMetrics; + this._listMultiRolePoolSkus = _listMultiRolePoolSkus; + this._listMultiRoleUsages = _listMultiRoleUsages; + this._listOperations = _listOperations; + this._reboot = _reboot; + this._resume = _resume; + this._listAppServicePlans = _listAppServicePlans; + this._listWebApps = _listWebApps; + this._suspend = _suspend; + this._listUsages = _listUsages; + this._listWorkerPools = _listWorkerPools; + this._getWorkerPool = _getWorkerPool; + this._createOrUpdateWorkerPool = _createOrUpdateWorkerPool; + this._updateWorkerPool = _updateWorkerPool; + this._listWorkerPoolInstanceMetricDefinitions = _listWorkerPoolInstanceMetricDefinitions; + this._listWorkerPoolInstanceMetrics = _listWorkerPoolInstanceMetrics; + this._listWebWorkerMetricDefinitions = _listWebWorkerMetricDefinitions; + this._listWebWorkerMetrics = _listWebWorkerMetrics; + this._listWorkerPoolSkus = _listWorkerPoolSkus; + this._listWebWorkerUsages = _listWebWorkerUsages; + this._beginCreateOrUpdate = _beginCreateOrUpdate; + this._beginDeleteMethod = _beginDeleteMethod; + this._beginChangeVnet = _beginChangeVnet; + this._beginCreateOrUpdateMultiRolePool = _beginCreateOrUpdateMultiRolePool; + this._beginResume = _beginResume; + this._beginSuspend = _beginSuspend; + this._beginCreateOrUpdateWorkerPool = _beginCreateOrUpdateWorkerPool; + this._listNext = _listNext; + this._listByResourceGroupNext = _listByResourceGroupNext; + this._listCapacitiesNext = _listCapacitiesNext; + this._changeVnetNext = _changeVnetNext; + this._listMetricsNext = _listMetricsNext; + this._listMultiRolePoolsNext = _listMultiRolePoolsNext; + this._listMultiRolePoolInstanceMetricDefinitionsNext = _listMultiRolePoolInstanceMetricDefinitionsNext; + this._listMultiRolePoolInstanceMetricsNext = _listMultiRolePoolInstanceMetricsNext; + this._listMultiRoleMetricDefinitionsNext = _listMultiRoleMetricDefinitionsNext; + this._listMultiRoleMetricsNext = _listMultiRoleMetricsNext; + this._listMultiRolePoolSkusNext = _listMultiRolePoolSkusNext; + this._listMultiRoleUsagesNext = _listMultiRoleUsagesNext; + this._resumeNext = _resumeNext; + this._listAppServicePlansNext = _listAppServicePlansNext; + this._listWebAppsNext = _listWebAppsNext; + this._suspendNext = _suspendNext; + this._listUsagesNext = _listUsagesNext; + this._listWorkerPoolsNext = _listWorkerPoolsNext; + this._listWorkerPoolInstanceMetricDefinitionsNext = _listWorkerPoolInstanceMetricDefinitionsNext; + this._listWorkerPoolInstanceMetricsNext = _listWorkerPoolInstanceMetricsNext; + this._listWebWorkerMetricDefinitionsNext = _listWebWorkerMetricDefinitionsNext; + this._listWebWorkerMetricsNext = _listWebWorkerMetricsNext; + this._listWorkerPoolSkusNext = _listWorkerPoolSkusNext; + this._listWebWorkerUsagesNext = _listWebWorkerUsagesNext; + this._beginChangeVnetNext = _beginChangeVnetNext; + this._beginResumeNext = _beginResumeNext; + this._beginSuspendNext = _beginSuspendNext; + } + + /** + * @summary Get all App Service Environments for a subscription. + * + * Get all App Service Environments for a subscription. + * + * @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. + */ + 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 Get all App Service Environments for a subscription. + * + * Get all App Service Environments for a subscription. + * + * @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 {AppServiceEnvironmentCollection} - 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 AppServiceEnvironmentCollection} 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 Get all App Service Environments in a resource group. + * + * Get all App Service Environments in a resource group. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @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. + */ + listByResourceGroupWithHttpOperationResponse(resourceGroupName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listByResourceGroup(resourceGroupName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Get all App Service Environments in a resource group. + * + * Get all App Service Environments in a resource group. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @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 {AppServiceEnvironmentCollection} - 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 AppServiceEnvironmentCollection} 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. + */ + listByResourceGroup(resourceGroupName, 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._listByResourceGroup(resourceGroupName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listByResourceGroup(resourceGroupName, options, optionalCallback); + } + } + + /** + * @summary Get the properties of an App Service Environment. + * + * Get the properties of an App Service Environment. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service Environment. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + getWithHttpOperationResponse(resourceGroupName, name, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._get(resourceGroupName, name, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Get the properties of an App Service Environment. + * + * Get the properties of an App Service Environment. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service Environment. + * + * @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 {AppServiceEnvironmentResource} - 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 AppServiceEnvironmentResource} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + get(resourceGroupName, name, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._get(resourceGroupName, name, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._get(resourceGroupName, name, options, optionalCallback); + } + } + + /** + * @summary Create or update an App Service Environment. + * + * Create or update an App Service Environment. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service Environment. + * + * @param {object} hostingEnvironmentEnvelope Configuration details of the App + * Service Environment. + * + * @param {string} hostingEnvironmentEnvelope.appServiceEnvironmentResourceName + * Name of the App Service Environment. + * + * @param {string} + * hostingEnvironmentEnvelope.appServiceEnvironmentResourceLocation Location of + * the App Service Environment, e.g. "West US". + * + * @param {string} [hostingEnvironmentEnvelope.vnetName] Name of the Virtual + * Network for the App Service Environment. + * + * @param {string} [hostingEnvironmentEnvelope.vnetResourceGroupName] Resource + * group of the Virtual Network. + * + * @param {string} [hostingEnvironmentEnvelope.vnetSubnetName] Subnet of the + * Virtual Network. + * + * @param {object} hostingEnvironmentEnvelope.virtualNetwork Description of the + * Virtual Network. + * + * @param {string} [hostingEnvironmentEnvelope.virtualNetwork.id] Resource id + * of the Virtual Network. + * + * @param {string} [hostingEnvironmentEnvelope.virtualNetwork.subnet] Subnet + * within the Virtual Network. + * + * @param {string} [hostingEnvironmentEnvelope.internalLoadBalancingMode] + * Specifies which endpoints to serve internally in the Virtual Network for the + * App Service Environment. Possible values include: 'None', 'Web', + * 'Publishing' + * + * @param {string} [hostingEnvironmentEnvelope.multiSize] Front-end VM size, + * e.g. "Medium", "Large". + * + * @param {number} [hostingEnvironmentEnvelope.multiRoleCount] Number of + * front-end instances. + * + * @param {array} hostingEnvironmentEnvelope.workerPools Description of worker + * pools with worker size IDs, VM sizes, and number of workers in each pool. + * + * @param {number} [hostingEnvironmentEnvelope.ipsslAddressCount] Number of IP + * SSL addresses reserved for the App Service Environment. + * + * @param {string} [hostingEnvironmentEnvelope.dnsSuffix] DNS suffix of the App + * Service Environment. + * + * @param {array} [hostingEnvironmentEnvelope.networkAccessControlList] Access + * control list for controlling traffic to the App Service Environment. + * + * @param {number} [hostingEnvironmentEnvelope.frontEndScaleFactor] Scale + * factor for front-ends. + * + * @param {string} [hostingEnvironmentEnvelope.apiManagementAccountId] API + * Management Account associated with the App Service Environment. + * + * @param {boolean} [hostingEnvironmentEnvelope.suspended] true if + * the App Service Environment is suspended; otherwise, false. The + * environment can be suspended, e.g. when the management endpoint is no longer + * available + * (most likely because NSG blocked the incoming traffic). + * + * @param {boolean} [hostingEnvironmentEnvelope.dynamicCacheEnabled] True/false + * indicating whether the App Service Environment is suspended. The environment + * can be suspended e.g. when the management endpoint is no longer available + * (most likely because NSG blocked the incoming traffic). + * + * @param {array} [hostingEnvironmentEnvelope.clusterSettings] Custom settings + * for changing the behavior of the App Service Environment. + * + * @param {array} [hostingEnvironmentEnvelope.userWhitelistedIpRanges] User + * added ip ranges to whitelist on ASE db + * + * @param {boolean} [hostingEnvironmentEnvelope.hasLinuxWorkers] Flag that + * displays whether an ASE has linux workers or not + * + * @param {string} [hostingEnvironmentEnvelope.sslCertKeyVaultId] Key Vault ID + * for ILB App Service Environment default SSL certificate + * + * @param {string} [hostingEnvironmentEnvelope.sslCertKeyVaultSecretName] Key + * Vault Secret Name for ILB App Service Environment default SSL certificate + * + * @param {string} [hostingEnvironmentEnvelope.kind] Kind of resource. + * + * @param {string} hostingEnvironmentEnvelope.location Resource Location. + * + * @param {object} [hostingEnvironmentEnvelope.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + createOrUpdateWithHttpOperationResponse(resourceGroupName, name, hostingEnvironmentEnvelope, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._createOrUpdate(resourceGroupName, name, hostingEnvironmentEnvelope, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Create or update an App Service Environment. + * + * Create or update an App Service Environment. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service Environment. + * + * @param {object} hostingEnvironmentEnvelope Configuration details of the App + * Service Environment. + * + * @param {string} hostingEnvironmentEnvelope.appServiceEnvironmentResourceName + * Name of the App Service Environment. + * + * @param {string} + * hostingEnvironmentEnvelope.appServiceEnvironmentResourceLocation Location of + * the App Service Environment, e.g. "West US". + * + * @param {string} [hostingEnvironmentEnvelope.vnetName] Name of the Virtual + * Network for the App Service Environment. + * + * @param {string} [hostingEnvironmentEnvelope.vnetResourceGroupName] Resource + * group of the Virtual Network. + * + * @param {string} [hostingEnvironmentEnvelope.vnetSubnetName] Subnet of the + * Virtual Network. + * + * @param {object} hostingEnvironmentEnvelope.virtualNetwork Description of the + * Virtual Network. + * + * @param {string} [hostingEnvironmentEnvelope.virtualNetwork.id] Resource id + * of the Virtual Network. + * + * @param {string} [hostingEnvironmentEnvelope.virtualNetwork.subnet] Subnet + * within the Virtual Network. + * + * @param {string} [hostingEnvironmentEnvelope.internalLoadBalancingMode] + * Specifies which endpoints to serve internally in the Virtual Network for the + * App Service Environment. Possible values include: 'None', 'Web', + * 'Publishing' + * + * @param {string} [hostingEnvironmentEnvelope.multiSize] Front-end VM size, + * e.g. "Medium", "Large". + * + * @param {number} [hostingEnvironmentEnvelope.multiRoleCount] Number of + * front-end instances. + * + * @param {array} hostingEnvironmentEnvelope.workerPools Description of worker + * pools with worker size IDs, VM sizes, and number of workers in each pool. + * + * @param {number} [hostingEnvironmentEnvelope.ipsslAddressCount] Number of IP + * SSL addresses reserved for the App Service Environment. + * + * @param {string} [hostingEnvironmentEnvelope.dnsSuffix] DNS suffix of the App + * Service Environment. + * + * @param {array} [hostingEnvironmentEnvelope.networkAccessControlList] Access + * control list for controlling traffic to the App Service Environment. + * + * @param {number} [hostingEnvironmentEnvelope.frontEndScaleFactor] Scale + * factor for front-ends. + * + * @param {string} [hostingEnvironmentEnvelope.apiManagementAccountId] API + * Management Account associated with the App Service Environment. + * + * @param {boolean} [hostingEnvironmentEnvelope.suspended] true if + * the App Service Environment is suspended; otherwise, false. The + * environment can be suspended, e.g. when the management endpoint is no longer + * available + * (most likely because NSG blocked the incoming traffic). + * + * @param {boolean} [hostingEnvironmentEnvelope.dynamicCacheEnabled] True/false + * indicating whether the App Service Environment is suspended. The environment + * can be suspended e.g. when the management endpoint is no longer available + * (most likely because NSG blocked the incoming traffic). + * + * @param {array} [hostingEnvironmentEnvelope.clusterSettings] Custom settings + * for changing the behavior of the App Service Environment. + * + * @param {array} [hostingEnvironmentEnvelope.userWhitelistedIpRanges] User + * added ip ranges to whitelist on ASE db + * + * @param {boolean} [hostingEnvironmentEnvelope.hasLinuxWorkers] Flag that + * displays whether an ASE has linux workers or not + * + * @param {string} [hostingEnvironmentEnvelope.sslCertKeyVaultId] Key Vault ID + * for ILB App Service Environment default SSL certificate + * + * @param {string} [hostingEnvironmentEnvelope.sslCertKeyVaultSecretName] Key + * Vault Secret Name for ILB App Service Environment default SSL certificate + * + * @param {string} [hostingEnvironmentEnvelope.kind] Kind of resource. + * + * @param {string} hostingEnvironmentEnvelope.location Resource Location. + * + * @param {object} [hostingEnvironmentEnvelope.tags] Resource tags. + * + * @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 {AppServiceEnvironmentResource} - 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 AppServiceEnvironmentResource} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + createOrUpdate(resourceGroupName, name, hostingEnvironmentEnvelope, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._createOrUpdate(resourceGroupName, name, hostingEnvironmentEnvelope, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._createOrUpdate(resourceGroupName, name, hostingEnvironmentEnvelope, options, optionalCallback); + } + } + + /** + * @summary Delete an App Service Environment. + * + * Delete an App Service Environment. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service Environment. + * + * @param {object} [options] Optional Parameters. + * + * @param {boolean} [options.forceDelete] Specify true to force + * the deletion even if the App Service Environment contains resources. The + * default is false. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + deleteMethodWithHttpOperationResponse(resourceGroupName, name, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._deleteMethod(resourceGroupName, name, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Delete an App Service Environment. + * + * Delete an App Service Environment. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service Environment. + * + * @param {object} [options] Optional Parameters. + * + * @param {boolean} [options.forceDelete] Specify true to force + * the deletion even if the App Service Environment contains resources. The + * default is false. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + deleteMethod(resourceGroupName, name, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._deleteMethod(resourceGroupName, name, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._deleteMethod(resourceGroupName, name, options, optionalCallback); + } + } + + /** + * @summary Create or update an App Service Environment. + * + * Create or update an App Service Environment. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service Environment. + * + * @param {object} hostingEnvironmentEnvelope Configuration details of the App + * Service Environment. + * + * @param {string} + * hostingEnvironmentEnvelope.appServiceEnvironmentPatchResourceName Name of + * the App Service Environment. + * + * @param {string} hostingEnvironmentEnvelope.location Location of the App + * Service Environment, e.g. "West US". + * + * @param {string} [hostingEnvironmentEnvelope.vnetName] Name of the Virtual + * Network for the App Service Environment. + * + * @param {string} [hostingEnvironmentEnvelope.vnetResourceGroupName] Resource + * group of the Virtual Network. + * + * @param {string} [hostingEnvironmentEnvelope.vnetSubnetName] Subnet of the + * Virtual Network. + * + * @param {object} hostingEnvironmentEnvelope.virtualNetwork Description of the + * Virtual Network. + * + * @param {string} [hostingEnvironmentEnvelope.virtualNetwork.id] Resource id + * of the Virtual Network. + * + * @param {string} [hostingEnvironmentEnvelope.virtualNetwork.subnet] Subnet + * within the Virtual Network. + * + * @param {string} [hostingEnvironmentEnvelope.internalLoadBalancingMode] + * Specifies which endpoints to serve internally in the Virtual Network for the + * App Service Environment. Possible values include: 'None', 'Web', + * 'Publishing' + * + * @param {string} [hostingEnvironmentEnvelope.multiSize] Front-end VM size, + * e.g. "Medium", "Large". + * + * @param {number} [hostingEnvironmentEnvelope.multiRoleCount] Number of + * front-end instances. + * + * @param {array} hostingEnvironmentEnvelope.workerPools Description of worker + * pools with worker size IDs, VM sizes, and number of workers in each pool. + * + * @param {number} [hostingEnvironmentEnvelope.ipsslAddressCount] Number of IP + * SSL addresses reserved for the App Service Environment. + * + * @param {string} [hostingEnvironmentEnvelope.dnsSuffix] DNS suffix of the App + * Service Environment. + * + * @param {array} [hostingEnvironmentEnvelope.networkAccessControlList] Access + * control list for controlling traffic to the App Service Environment. + * + * @param {number} [hostingEnvironmentEnvelope.frontEndScaleFactor] Scale + * factor for front-ends. + * + * @param {string} [hostingEnvironmentEnvelope.apiManagementAccountId] API + * Management Account associated with the App Service Environment. + * + * @param {boolean} [hostingEnvironmentEnvelope.suspended] true if + * the App Service Environment is suspended; otherwise, false. The + * environment can be suspended, e.g. when the management endpoint is no longer + * available + * (most likely because NSG blocked the incoming traffic). + * + * @param {boolean} [hostingEnvironmentEnvelope.dynamicCacheEnabled] True/false + * indicating whether the App Service Environment is suspended. The environment + * can be suspended e.g. when the management endpoint is no longer available + * (most likely because NSG blocked the incoming traffic). + * + * @param {array} [hostingEnvironmentEnvelope.clusterSettings] Custom settings + * for changing the behavior of the App Service Environment. + * + * @param {array} [hostingEnvironmentEnvelope.userWhitelistedIpRanges] User + * added ip ranges to whitelist on ASE db + * + * @param {boolean} [hostingEnvironmentEnvelope.hasLinuxWorkers] Flag that + * displays whether an ASE has linux workers or not + * + * @param {string} [hostingEnvironmentEnvelope.sslCertKeyVaultId] Key Vault ID + * for ILB App Service Environment default SSL certificate + * + * @param {string} [hostingEnvironmentEnvelope.sslCertKeyVaultSecretName] Key + * Vault Secret Name for ILB App Service Environment default SSL certificate + * + * @param {string} [hostingEnvironmentEnvelope.kind] Kind of resource. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + updateWithHttpOperationResponse(resourceGroupName, name, hostingEnvironmentEnvelope, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._update(resourceGroupName, name, hostingEnvironmentEnvelope, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Create or update an App Service Environment. + * + * Create or update an App Service Environment. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service Environment. + * + * @param {object} hostingEnvironmentEnvelope Configuration details of the App + * Service Environment. + * + * @param {string} + * hostingEnvironmentEnvelope.appServiceEnvironmentPatchResourceName Name of + * the App Service Environment. + * + * @param {string} hostingEnvironmentEnvelope.location Location of the App + * Service Environment, e.g. "West US". + * + * @param {string} [hostingEnvironmentEnvelope.vnetName] Name of the Virtual + * Network for the App Service Environment. + * + * @param {string} [hostingEnvironmentEnvelope.vnetResourceGroupName] Resource + * group of the Virtual Network. + * + * @param {string} [hostingEnvironmentEnvelope.vnetSubnetName] Subnet of the + * Virtual Network. + * + * @param {object} hostingEnvironmentEnvelope.virtualNetwork Description of the + * Virtual Network. + * + * @param {string} [hostingEnvironmentEnvelope.virtualNetwork.id] Resource id + * of the Virtual Network. + * + * @param {string} [hostingEnvironmentEnvelope.virtualNetwork.subnet] Subnet + * within the Virtual Network. + * + * @param {string} [hostingEnvironmentEnvelope.internalLoadBalancingMode] + * Specifies which endpoints to serve internally in the Virtual Network for the + * App Service Environment. Possible values include: 'None', 'Web', + * 'Publishing' + * + * @param {string} [hostingEnvironmentEnvelope.multiSize] Front-end VM size, + * e.g. "Medium", "Large". + * + * @param {number} [hostingEnvironmentEnvelope.multiRoleCount] Number of + * front-end instances. + * + * @param {array} hostingEnvironmentEnvelope.workerPools Description of worker + * pools with worker size IDs, VM sizes, and number of workers in each pool. + * + * @param {number} [hostingEnvironmentEnvelope.ipsslAddressCount] Number of IP + * SSL addresses reserved for the App Service Environment. + * + * @param {string} [hostingEnvironmentEnvelope.dnsSuffix] DNS suffix of the App + * Service Environment. + * + * @param {array} [hostingEnvironmentEnvelope.networkAccessControlList] Access + * control list for controlling traffic to the App Service Environment. + * + * @param {number} [hostingEnvironmentEnvelope.frontEndScaleFactor] Scale + * factor for front-ends. + * + * @param {string} [hostingEnvironmentEnvelope.apiManagementAccountId] API + * Management Account associated with the App Service Environment. + * + * @param {boolean} [hostingEnvironmentEnvelope.suspended] true if + * the App Service Environment is suspended; otherwise, false. The + * environment can be suspended, e.g. when the management endpoint is no longer + * available + * (most likely because NSG blocked the incoming traffic). + * + * @param {boolean} [hostingEnvironmentEnvelope.dynamicCacheEnabled] True/false + * indicating whether the App Service Environment is suspended. The environment + * can be suspended e.g. when the management endpoint is no longer available + * (most likely because NSG blocked the incoming traffic). + * + * @param {array} [hostingEnvironmentEnvelope.clusterSettings] Custom settings + * for changing the behavior of the App Service Environment. + * + * @param {array} [hostingEnvironmentEnvelope.userWhitelistedIpRanges] User + * added ip ranges to whitelist on ASE db + * + * @param {boolean} [hostingEnvironmentEnvelope.hasLinuxWorkers] Flag that + * displays whether an ASE has linux workers or not + * + * @param {string} [hostingEnvironmentEnvelope.sslCertKeyVaultId] Key Vault ID + * for ILB App Service Environment default SSL certificate + * + * @param {string} [hostingEnvironmentEnvelope.sslCertKeyVaultSecretName] Key + * Vault Secret Name for ILB App Service Environment default SSL certificate + * + * @param {string} [hostingEnvironmentEnvelope.kind] Kind of resource. + * + * @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 {AppServiceEnvironmentResource} - 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 AppServiceEnvironmentResource} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + update(resourceGroupName, name, hostingEnvironmentEnvelope, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._update(resourceGroupName, name, hostingEnvironmentEnvelope, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._update(resourceGroupName, name, hostingEnvironmentEnvelope, options, optionalCallback); + } + } + + /** + * @summary Get the used, available, and total worker capacity an App Service + * Environment. + * + * Get the used, available, and total worker capacity an App Service + * Environment. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service Environment. + * + * @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. + */ + listCapacitiesWithHttpOperationResponse(resourceGroupName, name, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listCapacities(resourceGroupName, name, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Get the used, available, and total worker capacity an App Service + * Environment. + * + * Get the used, available, and total worker capacity an App Service + * Environment. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service Environment. + * + * @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 {StampCapacityCollection} - 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 StampCapacityCollection} 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. + */ + listCapacities(resourceGroupName, name, 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._listCapacities(resourceGroupName, name, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listCapacities(resourceGroupName, name, options, optionalCallback); + } + } + + /** + * @summary Get IP addresses assigned to an App Service Environment. + * + * Get IP addresses assigned to an App Service Environment. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service Environment. + * + * @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. + */ + listVipsWithHttpOperationResponse(resourceGroupName, name, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listVips(resourceGroupName, name, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Get IP addresses assigned to an App Service Environment. + * + * Get IP addresses assigned to an App Service Environment. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service Environment. + * + * @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 {AddressResponse} - 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 AddressResponse} 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. + */ + listVips(resourceGroupName, name, 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._listVips(resourceGroupName, name, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listVips(resourceGroupName, name, options, optionalCallback); + } + } + + /** + * @summary Move an App Service Environment to a different VNET. + * + * Move an App Service Environment to a different VNET. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service Environment. + * + * @param {object} vnetInfo Details for the new virtual network. + * + * @param {string} [vnetInfo.id] Resource id of the Virtual Network. + * + * @param {string} [vnetInfo.subnet] Subnet within the Virtual Network. + * + * @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. + */ + changeVnetWithHttpOperationResponse(resourceGroupName, name, vnetInfo, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._changeVnet(resourceGroupName, name, vnetInfo, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Move an App Service Environment to a different VNET. + * + * Move an App Service Environment to a different VNET. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service Environment. + * + * @param {object} vnetInfo Details for the new virtual network. + * + * @param {string} [vnetInfo.id] Resource id of the Virtual Network. + * + * @param {string} [vnetInfo.subnet] Subnet within the Virtual Network. + * + * @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 {WebAppCollection} - 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 WebAppCollection} 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. + */ + changeVnet(resourceGroupName, name, vnetInfo, 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._changeVnet(resourceGroupName, name, vnetInfo, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._changeVnet(resourceGroupName, name, vnetInfo, options, optionalCallback); + } + } + + /** + * @summary Get diagnostic information for an App Service Environment. + * + * Get diagnostic information for an App Service Environment. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service Environment. + * + * @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. + */ + listDiagnosticsWithHttpOperationResponse(resourceGroupName, name, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listDiagnostics(resourceGroupName, name, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Get diagnostic information for an App Service Environment. + * + * Get diagnostic information for an App Service Environment. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service Environment. + * + * @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 {Array} - 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. + * + * {array} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listDiagnostics(resourceGroupName, name, 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._listDiagnostics(resourceGroupName, name, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listDiagnostics(resourceGroupName, name, options, optionalCallback); + } + } + + /** + * @summary Get a diagnostics item for an App Service Environment. + * + * Get a diagnostics item for an App Service Environment. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service Environment. + * + * @param {string} diagnosticsName Name of the diagnostics item. + * + * @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. + */ + getDiagnosticsItemWithHttpOperationResponse(resourceGroupName, name, diagnosticsName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._getDiagnosticsItem(resourceGroupName, name, diagnosticsName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Get a diagnostics item for an App Service Environment. + * + * Get a diagnostics item for an App Service Environment. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service Environment. + * + * @param {string} diagnosticsName Name of the diagnostics item. + * + * @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 {HostingEnvironmentDiagnostics} - 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 HostingEnvironmentDiagnostics} 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. + */ + getDiagnosticsItem(resourceGroupName, name, diagnosticsName, 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._getDiagnosticsItem(resourceGroupName, name, diagnosticsName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getDiagnosticsItem(resourceGroupName, name, diagnosticsName, options, optionalCallback); + } + } + + /** + * @summary Get global metric definitions of an App Service Environment. + * + * Get global metric definitions of an App Service Environment. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service Environment. + * + * @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. + */ + listMetricDefinitionsWithHttpOperationResponse(resourceGroupName, name, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listMetricDefinitions(resourceGroupName, name, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Get global metric definitions of an App Service Environment. + * + * Get global metric definitions of an App Service Environment. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service Environment. + * + * @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 {MetricDefinition} - 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 MetricDefinition} 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. + */ + listMetricDefinitions(resourceGroupName, name, 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._listMetricDefinitions(resourceGroupName, name, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listMetricDefinitions(resourceGroupName, name, options, optionalCallback); + } + } + + /** + * @summary Get global metrics of an App Service Environment. + * + * Get global metrics of an App Service Environment. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service Environment. + * + * @param {object} [options] Optional Parameters. + * + * @param {boolean} [options.details] Specify true to include + * instance details. The default is false. + * + * @param {string} [options.filter] Return only usages/metrics specified in the + * filter. Filter conforms to odata syntax. Example: $filter=(name.value eq + * 'Metric1' or name.value eq 'Metric2') and startTime eq 2014-01-01T00:00:00Z + * and endTime eq 2014-12-31T23:59:59Z and timeGrain eq + * duration'[Hour|Minute|Day]'. + * + * @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. + */ + listMetricsWithHttpOperationResponse(resourceGroupName, name, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listMetrics(resourceGroupName, name, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Get global metrics of an App Service Environment. + * + * Get global metrics of an App Service Environment. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service Environment. + * + * @param {object} [options] Optional Parameters. + * + * @param {boolean} [options.details] Specify true to include + * instance details. The default is false. + * + * @param {string} [options.filter] Return only usages/metrics specified in the + * filter. Filter conforms to odata syntax. Example: $filter=(name.value eq + * 'Metric1' or name.value eq 'Metric2') and startTime eq 2014-01-01T00:00:00Z + * and endTime eq 2014-12-31T23:59:59Z and timeGrain eq + * duration'[Hour|Minute|Day]'. + * + * @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 {ResourceMetricCollection} - 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 ResourceMetricCollection} 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. + */ + listMetrics(resourceGroupName, name, 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._listMetrics(resourceGroupName, name, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listMetrics(resourceGroupName, name, options, optionalCallback); + } + } + + /** + * @summary Get all multi-role pools. + * + * Get all multi-role pools. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service Environment. + * + * @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. + */ + listMultiRolePoolsWithHttpOperationResponse(resourceGroupName, name, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listMultiRolePools(resourceGroupName, name, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Get all multi-role pools. + * + * Get all multi-role pools. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service Environment. + * + * @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 {WorkerPoolCollection} - 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 WorkerPoolCollection} 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. + */ + listMultiRolePools(resourceGroupName, name, 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._listMultiRolePools(resourceGroupName, name, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listMultiRolePools(resourceGroupName, name, options, optionalCallback); + } + } + + /** + * @summary Get properties of a multi-role pool. + * + * Get properties of a multi-role pool. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service Environment. + * + * @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. + */ + getMultiRolePoolWithHttpOperationResponse(resourceGroupName, name, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._getMultiRolePool(resourceGroupName, name, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Get properties of a multi-role pool. + * + * Get properties of a multi-role pool. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service Environment. + * + * @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 {WorkerPoolResource} - 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 WorkerPoolResource} 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. + */ + getMultiRolePool(resourceGroupName, name, 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._getMultiRolePool(resourceGroupName, name, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getMultiRolePool(resourceGroupName, name, options, optionalCallback); + } + } + + /** + * @summary Create or update a multi-role pool. + * + * Create or update a multi-role pool. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service Environment. + * + * @param {object} multiRolePoolEnvelope Properties of the multi-role pool. + * + * @param {number} [multiRolePoolEnvelope.workerSizeId] Worker size ID for + * referencing this worker pool. + * + * @param {string} [multiRolePoolEnvelope.computeMode] Shared or dedicated app + * hosting. Possible values include: 'Shared', 'Dedicated', 'Dynamic' + * + * @param {string} [multiRolePoolEnvelope.workerSize] VM size of the worker + * pool instances. + * + * @param {number} [multiRolePoolEnvelope.workerCount] Number of instances in + * the worker pool. + * + * @param {object} [multiRolePoolEnvelope.sku] + * + * @param {string} [multiRolePoolEnvelope.sku.name] Name of the resource SKU. + * + * @param {string} [multiRolePoolEnvelope.sku.tier] Service tier of the + * resource SKU. + * + * @param {string} [multiRolePoolEnvelope.sku.size] Size specifier of the + * resource SKU. + * + * @param {string} [multiRolePoolEnvelope.sku.family] Family code of the + * resource SKU. + * + * @param {number} [multiRolePoolEnvelope.sku.capacity] Current number of + * instances assigned to the resource. + * + * @param {object} [multiRolePoolEnvelope.sku.skuCapacity] Min, max, and + * default scale values of the SKU. + * + * @param {number} [multiRolePoolEnvelope.sku.skuCapacity.minimum] Minimum + * number of workers for this App Service plan SKU. + * + * @param {number} [multiRolePoolEnvelope.sku.skuCapacity.maximum] Maximum + * number of workers for this App Service plan SKU. + * + * @param {number} [multiRolePoolEnvelope.sku.skuCapacity.default] Default + * number of workers for this App Service plan SKU. + * + * @param {string} [multiRolePoolEnvelope.sku.skuCapacity.scaleType] Available + * scale configurations for an App Service plan. + * + * @param {array} [multiRolePoolEnvelope.sku.locations] Locations of the SKU. + * + * @param {array} [multiRolePoolEnvelope.sku.capabilities] Capabilities of the + * SKU, e.g., is traffic manager enabled? + * + * @param {string} [multiRolePoolEnvelope.kind] Kind of resource. + * + * @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. + */ + createOrUpdateMultiRolePoolWithHttpOperationResponse(resourceGroupName, name, multiRolePoolEnvelope, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._createOrUpdateMultiRolePool(resourceGroupName, name, multiRolePoolEnvelope, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Create or update a multi-role pool. + * + * Create or update a multi-role pool. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service Environment. + * + * @param {object} multiRolePoolEnvelope Properties of the multi-role pool. + * + * @param {number} [multiRolePoolEnvelope.workerSizeId] Worker size ID for + * referencing this worker pool. + * + * @param {string} [multiRolePoolEnvelope.computeMode] Shared or dedicated app + * hosting. Possible values include: 'Shared', 'Dedicated', 'Dynamic' + * + * @param {string} [multiRolePoolEnvelope.workerSize] VM size of the worker + * pool instances. + * + * @param {number} [multiRolePoolEnvelope.workerCount] Number of instances in + * the worker pool. + * + * @param {object} [multiRolePoolEnvelope.sku] + * + * @param {string} [multiRolePoolEnvelope.sku.name] Name of the resource SKU. + * + * @param {string} [multiRolePoolEnvelope.sku.tier] Service tier of the + * resource SKU. + * + * @param {string} [multiRolePoolEnvelope.sku.size] Size specifier of the + * resource SKU. + * + * @param {string} [multiRolePoolEnvelope.sku.family] Family code of the + * resource SKU. + * + * @param {number} [multiRolePoolEnvelope.sku.capacity] Current number of + * instances assigned to the resource. + * + * @param {object} [multiRolePoolEnvelope.sku.skuCapacity] Min, max, and + * default scale values of the SKU. + * + * @param {number} [multiRolePoolEnvelope.sku.skuCapacity.minimum] Minimum + * number of workers for this App Service plan SKU. + * + * @param {number} [multiRolePoolEnvelope.sku.skuCapacity.maximum] Maximum + * number of workers for this App Service plan SKU. + * + * @param {number} [multiRolePoolEnvelope.sku.skuCapacity.default] Default + * number of workers for this App Service plan SKU. + * + * @param {string} [multiRolePoolEnvelope.sku.skuCapacity.scaleType] Available + * scale configurations for an App Service plan. + * + * @param {array} [multiRolePoolEnvelope.sku.locations] Locations of the SKU. + * + * @param {array} [multiRolePoolEnvelope.sku.capabilities] Capabilities of the + * SKU, e.g., is traffic manager enabled? + * + * @param {string} [multiRolePoolEnvelope.kind] Kind of resource. + * + * @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 {WorkerPoolResource} - 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 WorkerPoolResource} 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. + */ + createOrUpdateMultiRolePool(resourceGroupName, name, multiRolePoolEnvelope, 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._createOrUpdateMultiRolePool(resourceGroupName, name, multiRolePoolEnvelope, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._createOrUpdateMultiRolePool(resourceGroupName, name, multiRolePoolEnvelope, options, optionalCallback); + } + } + + /** + * @summary Create or update a multi-role pool. + * + * Create or update a multi-role pool. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service Environment. + * + * @param {object} multiRolePoolEnvelope Properties of the multi-role pool. + * + * @param {number} [multiRolePoolEnvelope.workerSizeId] Worker size ID for + * referencing this worker pool. + * + * @param {string} [multiRolePoolEnvelope.computeMode] Shared or dedicated app + * hosting. Possible values include: 'Shared', 'Dedicated', 'Dynamic' + * + * @param {string} [multiRolePoolEnvelope.workerSize] VM size of the worker + * pool instances. + * + * @param {number} [multiRolePoolEnvelope.workerCount] Number of instances in + * the worker pool. + * + * @param {object} [multiRolePoolEnvelope.sku] + * + * @param {string} [multiRolePoolEnvelope.sku.name] Name of the resource SKU. + * + * @param {string} [multiRolePoolEnvelope.sku.tier] Service tier of the + * resource SKU. + * + * @param {string} [multiRolePoolEnvelope.sku.size] Size specifier of the + * resource SKU. + * + * @param {string} [multiRolePoolEnvelope.sku.family] Family code of the + * resource SKU. + * + * @param {number} [multiRolePoolEnvelope.sku.capacity] Current number of + * instances assigned to the resource. + * + * @param {object} [multiRolePoolEnvelope.sku.skuCapacity] Min, max, and + * default scale values of the SKU. + * + * @param {number} [multiRolePoolEnvelope.sku.skuCapacity.minimum] Minimum + * number of workers for this App Service plan SKU. + * + * @param {number} [multiRolePoolEnvelope.sku.skuCapacity.maximum] Maximum + * number of workers for this App Service plan SKU. + * + * @param {number} [multiRolePoolEnvelope.sku.skuCapacity.default] Default + * number of workers for this App Service plan SKU. + * + * @param {string} [multiRolePoolEnvelope.sku.skuCapacity.scaleType] Available + * scale configurations for an App Service plan. + * + * @param {array} [multiRolePoolEnvelope.sku.locations] Locations of the SKU. + * + * @param {array} [multiRolePoolEnvelope.sku.capabilities] Capabilities of the + * SKU, e.g., is traffic manager enabled? + * + * @param {string} [multiRolePoolEnvelope.kind] Kind of resource. + * + * @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. + */ + updateMultiRolePoolWithHttpOperationResponse(resourceGroupName, name, multiRolePoolEnvelope, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._updateMultiRolePool(resourceGroupName, name, multiRolePoolEnvelope, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Create or update a multi-role pool. + * + * Create or update a multi-role pool. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service Environment. + * + * @param {object} multiRolePoolEnvelope Properties of the multi-role pool. + * + * @param {number} [multiRolePoolEnvelope.workerSizeId] Worker size ID for + * referencing this worker pool. + * + * @param {string} [multiRolePoolEnvelope.computeMode] Shared or dedicated app + * hosting. Possible values include: 'Shared', 'Dedicated', 'Dynamic' + * + * @param {string} [multiRolePoolEnvelope.workerSize] VM size of the worker + * pool instances. + * + * @param {number} [multiRolePoolEnvelope.workerCount] Number of instances in + * the worker pool. + * + * @param {object} [multiRolePoolEnvelope.sku] + * + * @param {string} [multiRolePoolEnvelope.sku.name] Name of the resource SKU. + * + * @param {string} [multiRolePoolEnvelope.sku.tier] Service tier of the + * resource SKU. + * + * @param {string} [multiRolePoolEnvelope.sku.size] Size specifier of the + * resource SKU. + * + * @param {string} [multiRolePoolEnvelope.sku.family] Family code of the + * resource SKU. + * + * @param {number} [multiRolePoolEnvelope.sku.capacity] Current number of + * instances assigned to the resource. + * + * @param {object} [multiRolePoolEnvelope.sku.skuCapacity] Min, max, and + * default scale values of the SKU. + * + * @param {number} [multiRolePoolEnvelope.sku.skuCapacity.minimum] Minimum + * number of workers for this App Service plan SKU. + * + * @param {number} [multiRolePoolEnvelope.sku.skuCapacity.maximum] Maximum + * number of workers for this App Service plan SKU. + * + * @param {number} [multiRolePoolEnvelope.sku.skuCapacity.default] Default + * number of workers for this App Service plan SKU. + * + * @param {string} [multiRolePoolEnvelope.sku.skuCapacity.scaleType] Available + * scale configurations for an App Service plan. + * + * @param {array} [multiRolePoolEnvelope.sku.locations] Locations of the SKU. + * + * @param {array} [multiRolePoolEnvelope.sku.capabilities] Capabilities of the + * SKU, e.g., is traffic manager enabled? + * + * @param {string} [multiRolePoolEnvelope.kind] Kind of resource. + * + * @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 {WorkerPoolResource} - 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 WorkerPoolResource} 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. + */ + updateMultiRolePool(resourceGroupName, name, multiRolePoolEnvelope, 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._updateMultiRolePool(resourceGroupName, name, multiRolePoolEnvelope, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._updateMultiRolePool(resourceGroupName, name, multiRolePoolEnvelope, options, optionalCallback); + } + } + + /** + * @summary Get metric definitions for a specific instance of a multi-role pool + * of an App Service Environment. + * + * Get metric definitions for a specific instance of a multi-role pool of an + * App Service Environment. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service Environment. + * + * @param {string} instance Name of the instance in the multi-role pool. + * + * @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. + */ + listMultiRolePoolInstanceMetricDefinitionsWithHttpOperationResponse(resourceGroupName, name, instance, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listMultiRolePoolInstanceMetricDefinitions(resourceGroupName, name, instance, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Get metric definitions for a specific instance of a multi-role pool + * of an App Service Environment. + * + * Get metric definitions for a specific instance of a multi-role pool of an + * App Service Environment. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service Environment. + * + * @param {string} instance Name of the instance in the multi-role pool. + * + * @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 {ResourceMetricDefinitionCollection} - 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 ResourceMetricDefinitionCollection} 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. + */ + listMultiRolePoolInstanceMetricDefinitions(resourceGroupName, name, instance, 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._listMultiRolePoolInstanceMetricDefinitions(resourceGroupName, name, instance, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listMultiRolePoolInstanceMetricDefinitions(resourceGroupName, name, instance, options, optionalCallback); + } + } + + /** + * @summary Get metrics for a specific instance of a multi-role pool of an App + * Service Environment. + * + * Get metrics for a specific instance of a multi-role pool of an App Service + * Environment. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service Environment. + * + * @param {string} instance Name of the instance in the multi-role pool. + * + * @param {object} [options] Optional Parameters. + * + * @param {boolean} [options.details] Specify true to include + * instance details. The default is false. + * + * @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. + */ + listMultiRolePoolInstanceMetricsWithHttpOperationResponse(resourceGroupName, name, instance, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listMultiRolePoolInstanceMetrics(resourceGroupName, name, instance, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Get metrics for a specific instance of a multi-role pool of an App + * Service Environment. + * + * Get metrics for a specific instance of a multi-role pool of an App Service + * Environment. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service Environment. + * + * @param {string} instance Name of the instance in the multi-role pool. + * + * @param {object} [options] Optional Parameters. + * + * @param {boolean} [options.details] Specify true to include + * instance details. The default is false. + * + * @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 {ResourceMetricCollection} - 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 ResourceMetricCollection} 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. + */ + listMultiRolePoolInstanceMetrics(resourceGroupName, name, instance, 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._listMultiRolePoolInstanceMetrics(resourceGroupName, name, instance, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listMultiRolePoolInstanceMetrics(resourceGroupName, name, instance, options, optionalCallback); + } + } + + /** + * @summary Get metric definitions for a multi-role pool of an App Service + * Environment. + * + * Get metric definitions for a multi-role pool of an App Service Environment. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service Environment. + * + * @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. + */ + listMultiRoleMetricDefinitionsWithHttpOperationResponse(resourceGroupName, name, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listMultiRoleMetricDefinitions(resourceGroupName, name, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Get metric definitions for a multi-role pool of an App Service + * Environment. + * + * Get metric definitions for a multi-role pool of an App Service Environment. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service Environment. + * + * @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 {ResourceMetricDefinitionCollection} - 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 ResourceMetricDefinitionCollection} 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. + */ + listMultiRoleMetricDefinitions(resourceGroupName, name, 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._listMultiRoleMetricDefinitions(resourceGroupName, name, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listMultiRoleMetricDefinitions(resourceGroupName, name, options, optionalCallback); + } + } + + /** + * @summary Get metrics for a multi-role pool of an App Service Environment. + * + * Get metrics for a multi-role pool of an App Service Environment. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service Environment. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.startTime] Beginning time of the metrics query. + * + * @param {string} [options.endTime] End time of the metrics query. + * + * @param {string} [options.timeGrain] Time granularity of the metrics query. + * + * @param {boolean} [options.details] Specify true to include + * instance details. The default is false. + * + * @param {string} [options.filter] Return only usages/metrics specified in the + * filter. Filter conforms to odata syntax. Example: $filter=(name.value eq + * 'Metric1' or name.value eq 'Metric2') and startTime eq 2014-01-01T00:00:00Z + * and endTime eq 2014-12-31T23:59:59Z and timeGrain eq + * duration'[Hour|Minute|Day]'. + * + * @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. + */ + listMultiRoleMetricsWithHttpOperationResponse(resourceGroupName, name, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listMultiRoleMetrics(resourceGroupName, name, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Get metrics for a multi-role pool of an App Service Environment. + * + * Get metrics for a multi-role pool of an App Service Environment. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service Environment. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.startTime] Beginning time of the metrics query. + * + * @param {string} [options.endTime] End time of the metrics query. + * + * @param {string} [options.timeGrain] Time granularity of the metrics query. + * + * @param {boolean} [options.details] Specify true to include + * instance details. The default is false. + * + * @param {string} [options.filter] Return only usages/metrics specified in the + * filter. Filter conforms to odata syntax. Example: $filter=(name.value eq + * 'Metric1' or name.value eq 'Metric2') and startTime eq 2014-01-01T00:00:00Z + * and endTime eq 2014-12-31T23:59:59Z and timeGrain eq + * duration'[Hour|Minute|Day]'. + * + * @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 {ResourceMetricCollection} - 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 ResourceMetricCollection} 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. + */ + listMultiRoleMetrics(resourceGroupName, name, 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._listMultiRoleMetrics(resourceGroupName, name, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listMultiRoleMetrics(resourceGroupName, name, options, optionalCallback); + } + } + + /** + * @summary Get available SKUs for scaling a multi-role pool. + * + * Get available SKUs for scaling a multi-role pool. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service Environment. + * + * @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. + */ + listMultiRolePoolSkusWithHttpOperationResponse(resourceGroupName, name, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listMultiRolePoolSkus(resourceGroupName, name, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Get available SKUs for scaling a multi-role pool. + * + * Get available SKUs for scaling a multi-role pool. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service Environment. + * + * @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 {SkuInfoCollection} - 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 SkuInfoCollection} 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. + */ + listMultiRolePoolSkus(resourceGroupName, name, 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._listMultiRolePoolSkus(resourceGroupName, name, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listMultiRolePoolSkus(resourceGroupName, name, options, optionalCallback); + } + } + + /** + * @summary Get usage metrics for a multi-role pool of an App Service + * Environment. + * + * Get usage metrics for a multi-role pool of an App Service Environment. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service Environment. + * + * @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. + */ + listMultiRoleUsagesWithHttpOperationResponse(resourceGroupName, name, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listMultiRoleUsages(resourceGroupName, name, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Get usage metrics for a multi-role pool of an App Service + * Environment. + * + * Get usage metrics for a multi-role pool of an App Service Environment. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service Environment. + * + * @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 {UsageCollection} - 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 UsageCollection} 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. + */ + listMultiRoleUsages(resourceGroupName, name, 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._listMultiRoleUsages(resourceGroupName, name, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listMultiRoleUsages(resourceGroupName, name, options, optionalCallback); + } + } + + /** + * @summary List all currently running operations on the App Service + * Environment. + * + * List all currently running operations on the App Service Environment. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service Environment. + * + * @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. + */ + listOperationsWithHttpOperationResponse(resourceGroupName, name, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listOperations(resourceGroupName, name, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary List all currently running operations on the App Service + * Environment. + * + * List all currently running operations on the App Service Environment. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service Environment. + * + * @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 {Array} - 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. + * + * {array} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listOperations(resourceGroupName, name, 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._listOperations(resourceGroupName, name, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listOperations(resourceGroupName, name, options, optionalCallback); + } + } + + /** + * @summary Reboot all machines in an App Service Environment. + * + * Reboot all machines in an App Service Environment. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service Environment. + * + * @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. + */ + rebootWithHttpOperationResponse(resourceGroupName, name, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._reboot(resourceGroupName, name, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Reboot all machines in an App Service Environment. + * + * Reboot all machines in an App Service Environment. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service Environment. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + reboot(resourceGroupName, name, 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._reboot(resourceGroupName, name, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._reboot(resourceGroupName, name, options, optionalCallback); + } + } + + /** + * @summary Resume an App Service Environment. + * + * Resume an App Service Environment. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service Environment. + * + * @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. + */ + resumeWithHttpOperationResponse(resourceGroupName, name, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._resume(resourceGroupName, name, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Resume an App Service Environment. + * + * Resume an App Service Environment. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service Environment. + * + * @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 {WebAppCollection} - 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 WebAppCollection} 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. + */ + resume(resourceGroupName, name, 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._resume(resourceGroupName, name, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._resume(resourceGroupName, name, options, optionalCallback); + } + } + + /** + * @summary Get all App Service plans in an App Service Environment. + * + * Get all App Service plans in an App Service Environment. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service Environment. + * + * @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. + */ + listAppServicePlansWithHttpOperationResponse(resourceGroupName, name, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listAppServicePlans(resourceGroupName, name, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Get all App Service plans in an App Service Environment. + * + * Get all App Service plans in an App Service Environment. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service Environment. + * + * @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 {AppServicePlanCollection} - 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 AppServicePlanCollection} 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. + */ + listAppServicePlans(resourceGroupName, name, 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._listAppServicePlans(resourceGroupName, name, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listAppServicePlans(resourceGroupName, name, options, optionalCallback); + } + } + + /** + * @summary Get all apps in an App Service Environment. + * + * Get all apps in an App Service Environment. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service Environment. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.propertiesToInclude] Comma separated list of app + * properties to include. + * + * @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. + */ + listWebAppsWithHttpOperationResponse(resourceGroupName, name, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listWebApps(resourceGroupName, name, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Get all apps in an App Service Environment. + * + * Get all apps in an App Service Environment. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service Environment. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.propertiesToInclude] Comma separated list of app + * properties to include. + * + * @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 {WebAppCollection} - 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 WebAppCollection} 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. + */ + listWebApps(resourceGroupName, name, 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._listWebApps(resourceGroupName, name, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listWebApps(resourceGroupName, name, options, optionalCallback); + } + } + + /** + * @summary Suspend an App Service Environment. + * + * Suspend an App Service Environment. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service Environment. + * + * @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. + */ + suspendWithHttpOperationResponse(resourceGroupName, name, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._suspend(resourceGroupName, name, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Suspend an App Service Environment. + * + * Suspend an App Service Environment. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service Environment. + * + * @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 {WebAppCollection} - 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 WebAppCollection} 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. + */ + suspend(resourceGroupName, name, 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._suspend(resourceGroupName, name, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._suspend(resourceGroupName, name, options, optionalCallback); + } + } + + /** + * @summary Get global usage metrics of an App Service Environment. + * + * Get global usage metrics of an App Service Environment. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service Environment. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.filter] Return only usages/metrics specified in the + * filter. Filter conforms to odata syntax. Example: $filter=(name.value eq + * 'Metric1' or name.value eq 'Metric2') and startTime eq 2014-01-01T00:00:00Z + * and endTime eq 2014-12-31T23:59:59Z and timeGrain eq + * duration'[Hour|Minute|Day]'. + * + * @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. + */ + listUsagesWithHttpOperationResponse(resourceGroupName, name, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listUsages(resourceGroupName, name, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Get global usage metrics of an App Service Environment. + * + * Get global usage metrics of an App Service Environment. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service Environment. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.filter] Return only usages/metrics specified in the + * filter. Filter conforms to odata syntax. Example: $filter=(name.value eq + * 'Metric1' or name.value eq 'Metric2') and startTime eq 2014-01-01T00:00:00Z + * and endTime eq 2014-12-31T23:59:59Z and timeGrain eq + * duration'[Hour|Minute|Day]'. + * + * @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 {CsmUsageQuotaCollection} - 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 CsmUsageQuotaCollection} 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. + */ + listUsages(resourceGroupName, name, 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._listUsages(resourceGroupName, name, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listUsages(resourceGroupName, name, options, optionalCallback); + } + } + + /** + * @summary Get all worker pools of an App Service Environment. + * + * Get all worker pools of an App Service Environment. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service Environment. + * + * @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. + */ + listWorkerPoolsWithHttpOperationResponse(resourceGroupName, name, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listWorkerPools(resourceGroupName, name, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Get all worker pools of an App Service Environment. + * + * Get all worker pools of an App Service Environment. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service Environment. + * + * @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 {WorkerPoolCollection} - 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 WorkerPoolCollection} 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. + */ + listWorkerPools(resourceGroupName, name, 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._listWorkerPools(resourceGroupName, name, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listWorkerPools(resourceGroupName, name, options, optionalCallback); + } + } + + /** + * @summary Get properties of a worker pool. + * + * Get properties of a worker pool. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service Environment. + * + * @param {string} workerPoolName Name of the worker pool. + * + * @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. + */ + getWorkerPoolWithHttpOperationResponse(resourceGroupName, name, workerPoolName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._getWorkerPool(resourceGroupName, name, workerPoolName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Get properties of a worker pool. + * + * Get properties of a worker pool. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service Environment. + * + * @param {string} workerPoolName Name of the worker pool. + * + * @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 {WorkerPoolResource} - 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 WorkerPoolResource} 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. + */ + getWorkerPool(resourceGroupName, name, workerPoolName, 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._getWorkerPool(resourceGroupName, name, workerPoolName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getWorkerPool(resourceGroupName, name, workerPoolName, options, optionalCallback); + } + } + + /** + * @summary Create or update a worker pool. + * + * Create or update a worker pool. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service Environment. + * + * @param {string} workerPoolName Name of the worker pool. + * + * @param {object} workerPoolEnvelope Properties of the worker pool. + * + * @param {number} [workerPoolEnvelope.workerSizeId] Worker size ID for + * referencing this worker pool. + * + * @param {string} [workerPoolEnvelope.computeMode] Shared or dedicated app + * hosting. Possible values include: 'Shared', 'Dedicated', 'Dynamic' + * + * @param {string} [workerPoolEnvelope.workerSize] VM size of the worker pool + * instances. + * + * @param {number} [workerPoolEnvelope.workerCount] Number of instances in the + * worker pool. + * + * @param {object} [workerPoolEnvelope.sku] + * + * @param {string} [workerPoolEnvelope.sku.name] Name of the resource SKU. + * + * @param {string} [workerPoolEnvelope.sku.tier] Service tier of the resource + * SKU. + * + * @param {string} [workerPoolEnvelope.sku.size] Size specifier of the resource + * SKU. + * + * @param {string} [workerPoolEnvelope.sku.family] Family code of the resource + * SKU. + * + * @param {number} [workerPoolEnvelope.sku.capacity] Current number of + * instances assigned to the resource. + * + * @param {object} [workerPoolEnvelope.sku.skuCapacity] Min, max, and default + * scale values of the SKU. + * + * @param {number} [workerPoolEnvelope.sku.skuCapacity.minimum] Minimum number + * of workers for this App Service plan SKU. + * + * @param {number} [workerPoolEnvelope.sku.skuCapacity.maximum] Maximum number + * of workers for this App Service plan SKU. + * + * @param {number} [workerPoolEnvelope.sku.skuCapacity.default] Default number + * of workers for this App Service plan SKU. + * + * @param {string} [workerPoolEnvelope.sku.skuCapacity.scaleType] Available + * scale configurations for an App Service plan. + * + * @param {array} [workerPoolEnvelope.sku.locations] Locations of the SKU. + * + * @param {array} [workerPoolEnvelope.sku.capabilities] Capabilities of the + * SKU, e.g., is traffic manager enabled? + * + * @param {string} [workerPoolEnvelope.kind] Kind of resource. + * + * @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. + */ + createOrUpdateWorkerPoolWithHttpOperationResponse(resourceGroupName, name, workerPoolName, workerPoolEnvelope, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._createOrUpdateWorkerPool(resourceGroupName, name, workerPoolName, workerPoolEnvelope, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Create or update a worker pool. + * + * Create or update a worker pool. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service Environment. + * + * @param {string} workerPoolName Name of the worker pool. + * + * @param {object} workerPoolEnvelope Properties of the worker pool. + * + * @param {number} [workerPoolEnvelope.workerSizeId] Worker size ID for + * referencing this worker pool. + * + * @param {string} [workerPoolEnvelope.computeMode] Shared or dedicated app + * hosting. Possible values include: 'Shared', 'Dedicated', 'Dynamic' + * + * @param {string} [workerPoolEnvelope.workerSize] VM size of the worker pool + * instances. + * + * @param {number} [workerPoolEnvelope.workerCount] Number of instances in the + * worker pool. + * + * @param {object} [workerPoolEnvelope.sku] + * + * @param {string} [workerPoolEnvelope.sku.name] Name of the resource SKU. + * + * @param {string} [workerPoolEnvelope.sku.tier] Service tier of the resource + * SKU. + * + * @param {string} [workerPoolEnvelope.sku.size] Size specifier of the resource + * SKU. + * + * @param {string} [workerPoolEnvelope.sku.family] Family code of the resource + * SKU. + * + * @param {number} [workerPoolEnvelope.sku.capacity] Current number of + * instances assigned to the resource. + * + * @param {object} [workerPoolEnvelope.sku.skuCapacity] Min, max, and default + * scale values of the SKU. + * + * @param {number} [workerPoolEnvelope.sku.skuCapacity.minimum] Minimum number + * of workers for this App Service plan SKU. + * + * @param {number} [workerPoolEnvelope.sku.skuCapacity.maximum] Maximum number + * of workers for this App Service plan SKU. + * + * @param {number} [workerPoolEnvelope.sku.skuCapacity.default] Default number + * of workers for this App Service plan SKU. + * + * @param {string} [workerPoolEnvelope.sku.skuCapacity.scaleType] Available + * scale configurations for an App Service plan. + * + * @param {array} [workerPoolEnvelope.sku.locations] Locations of the SKU. + * + * @param {array} [workerPoolEnvelope.sku.capabilities] Capabilities of the + * SKU, e.g., is traffic manager enabled? + * + * @param {string} [workerPoolEnvelope.kind] Kind of resource. + * + * @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 {WorkerPoolResource} - 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 WorkerPoolResource} 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. + */ + createOrUpdateWorkerPool(resourceGroupName, name, workerPoolName, workerPoolEnvelope, 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._createOrUpdateWorkerPool(resourceGroupName, name, workerPoolName, workerPoolEnvelope, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._createOrUpdateWorkerPool(resourceGroupName, name, workerPoolName, workerPoolEnvelope, options, optionalCallback); + } + } + + /** + * @summary Create or update a worker pool. + * + * Create or update a worker pool. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service Environment. + * + * @param {string} workerPoolName Name of the worker pool. + * + * @param {object} workerPoolEnvelope Properties of the worker pool. + * + * @param {number} [workerPoolEnvelope.workerSizeId] Worker size ID for + * referencing this worker pool. + * + * @param {string} [workerPoolEnvelope.computeMode] Shared or dedicated app + * hosting. Possible values include: 'Shared', 'Dedicated', 'Dynamic' + * + * @param {string} [workerPoolEnvelope.workerSize] VM size of the worker pool + * instances. + * + * @param {number} [workerPoolEnvelope.workerCount] Number of instances in the + * worker pool. + * + * @param {object} [workerPoolEnvelope.sku] + * + * @param {string} [workerPoolEnvelope.sku.name] Name of the resource SKU. + * + * @param {string} [workerPoolEnvelope.sku.tier] Service tier of the resource + * SKU. + * + * @param {string} [workerPoolEnvelope.sku.size] Size specifier of the resource + * SKU. + * + * @param {string} [workerPoolEnvelope.sku.family] Family code of the resource + * SKU. + * + * @param {number} [workerPoolEnvelope.sku.capacity] Current number of + * instances assigned to the resource. + * + * @param {object} [workerPoolEnvelope.sku.skuCapacity] Min, max, and default + * scale values of the SKU. + * + * @param {number} [workerPoolEnvelope.sku.skuCapacity.minimum] Minimum number + * of workers for this App Service plan SKU. + * + * @param {number} [workerPoolEnvelope.sku.skuCapacity.maximum] Maximum number + * of workers for this App Service plan SKU. + * + * @param {number} [workerPoolEnvelope.sku.skuCapacity.default] Default number + * of workers for this App Service plan SKU. + * + * @param {string} [workerPoolEnvelope.sku.skuCapacity.scaleType] Available + * scale configurations for an App Service plan. + * + * @param {array} [workerPoolEnvelope.sku.locations] Locations of the SKU. + * + * @param {array} [workerPoolEnvelope.sku.capabilities] Capabilities of the + * SKU, e.g., is traffic manager enabled? + * + * @param {string} [workerPoolEnvelope.kind] Kind of resource. + * + * @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. + */ + updateWorkerPoolWithHttpOperationResponse(resourceGroupName, name, workerPoolName, workerPoolEnvelope, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._updateWorkerPool(resourceGroupName, name, workerPoolName, workerPoolEnvelope, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Create or update a worker pool. + * + * Create or update a worker pool. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service Environment. + * + * @param {string} workerPoolName Name of the worker pool. + * + * @param {object} workerPoolEnvelope Properties of the worker pool. + * + * @param {number} [workerPoolEnvelope.workerSizeId] Worker size ID for + * referencing this worker pool. + * + * @param {string} [workerPoolEnvelope.computeMode] Shared or dedicated app + * hosting. Possible values include: 'Shared', 'Dedicated', 'Dynamic' + * + * @param {string} [workerPoolEnvelope.workerSize] VM size of the worker pool + * instances. + * + * @param {number} [workerPoolEnvelope.workerCount] Number of instances in the + * worker pool. + * + * @param {object} [workerPoolEnvelope.sku] + * + * @param {string} [workerPoolEnvelope.sku.name] Name of the resource SKU. + * + * @param {string} [workerPoolEnvelope.sku.tier] Service tier of the resource + * SKU. + * + * @param {string} [workerPoolEnvelope.sku.size] Size specifier of the resource + * SKU. + * + * @param {string} [workerPoolEnvelope.sku.family] Family code of the resource + * SKU. + * + * @param {number} [workerPoolEnvelope.sku.capacity] Current number of + * instances assigned to the resource. + * + * @param {object} [workerPoolEnvelope.sku.skuCapacity] Min, max, and default + * scale values of the SKU. + * + * @param {number} [workerPoolEnvelope.sku.skuCapacity.minimum] Minimum number + * of workers for this App Service plan SKU. + * + * @param {number} [workerPoolEnvelope.sku.skuCapacity.maximum] Maximum number + * of workers for this App Service plan SKU. + * + * @param {number} [workerPoolEnvelope.sku.skuCapacity.default] Default number + * of workers for this App Service plan SKU. + * + * @param {string} [workerPoolEnvelope.sku.skuCapacity.scaleType] Available + * scale configurations for an App Service plan. + * + * @param {array} [workerPoolEnvelope.sku.locations] Locations of the SKU. + * + * @param {array} [workerPoolEnvelope.sku.capabilities] Capabilities of the + * SKU, e.g., is traffic manager enabled? + * + * @param {string} [workerPoolEnvelope.kind] Kind of resource. + * + * @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 {WorkerPoolResource} - 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 WorkerPoolResource} 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. + */ + updateWorkerPool(resourceGroupName, name, workerPoolName, workerPoolEnvelope, 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._updateWorkerPool(resourceGroupName, name, workerPoolName, workerPoolEnvelope, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._updateWorkerPool(resourceGroupName, name, workerPoolName, workerPoolEnvelope, options, optionalCallback); + } + } + + /** + * @summary Get metric definitions for a specific instance of a worker pool of + * an App Service Environment. + * + * Get metric definitions for a specific instance of a worker pool of an App + * Service Environment. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service Environment. + * + * @param {string} workerPoolName Name of the worker pool. + * + * @param {string} instance Name of the instance in the worker pool. + * + * @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. + */ + listWorkerPoolInstanceMetricDefinitionsWithHttpOperationResponse(resourceGroupName, name, workerPoolName, instance, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listWorkerPoolInstanceMetricDefinitions(resourceGroupName, name, workerPoolName, instance, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Get metric definitions for a specific instance of a worker pool of + * an App Service Environment. + * + * Get metric definitions for a specific instance of a worker pool of an App + * Service Environment. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service Environment. + * + * @param {string} workerPoolName Name of the worker pool. + * + * @param {string} instance Name of the instance in the worker pool. + * + * @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 {ResourceMetricDefinitionCollection} - 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 ResourceMetricDefinitionCollection} 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. + */ + listWorkerPoolInstanceMetricDefinitions(resourceGroupName, name, workerPoolName, instance, 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._listWorkerPoolInstanceMetricDefinitions(resourceGroupName, name, workerPoolName, instance, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listWorkerPoolInstanceMetricDefinitions(resourceGroupName, name, workerPoolName, instance, options, optionalCallback); + } + } + + /** + * @summary Get metrics for a specific instance of a worker pool of an App + * Service Environment. + * + * Get metrics for a specific instance of a worker pool of an App Service + * Environment. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service Environment. + * + * @param {string} workerPoolName Name of the worker pool. + * + * @param {string} instance Name of the instance in the worker pool. + * + * @param {object} [options] Optional Parameters. + * + * @param {boolean} [options.details] Specify true to include + * instance details. The default is false. + * + * @param {string} [options.filter] Return only usages/metrics specified in the + * filter. Filter conforms to odata syntax. Example: $filter=(name.value eq + * 'Metric1' or name.value eq 'Metric2') and startTime eq 2014-01-01T00:00:00Z + * and endTime eq 2014-12-31T23:59:59Z and timeGrain eq + * duration'[Hour|Minute|Day]'. + * + * @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. + */ + listWorkerPoolInstanceMetricsWithHttpOperationResponse(resourceGroupName, name, workerPoolName, instance, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listWorkerPoolInstanceMetrics(resourceGroupName, name, workerPoolName, instance, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Get metrics for a specific instance of a worker pool of an App + * Service Environment. + * + * Get metrics for a specific instance of a worker pool of an App Service + * Environment. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service Environment. + * + * @param {string} workerPoolName Name of the worker pool. + * + * @param {string} instance Name of the instance in the worker pool. + * + * @param {object} [options] Optional Parameters. + * + * @param {boolean} [options.details] Specify true to include + * instance details. The default is false. + * + * @param {string} [options.filter] Return only usages/metrics specified in the + * filter. Filter conforms to odata syntax. Example: $filter=(name.value eq + * 'Metric1' or name.value eq 'Metric2') and startTime eq 2014-01-01T00:00:00Z + * and endTime eq 2014-12-31T23:59:59Z and timeGrain eq + * duration'[Hour|Minute|Day]'. + * + * @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 {ResourceMetricCollection} - 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 ResourceMetricCollection} 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. + */ + listWorkerPoolInstanceMetrics(resourceGroupName, name, workerPoolName, instance, 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._listWorkerPoolInstanceMetrics(resourceGroupName, name, workerPoolName, instance, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listWorkerPoolInstanceMetrics(resourceGroupName, name, workerPoolName, instance, options, optionalCallback); + } + } + + /** + * @summary Get metric definitions for a worker pool of an App Service + * Environment. + * + * Get metric definitions for a worker pool of an App Service Environment. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service Environment. + * + * @param {string} workerPoolName Name of the worker pool. + * + * @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. + */ + listWebWorkerMetricDefinitionsWithHttpOperationResponse(resourceGroupName, name, workerPoolName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listWebWorkerMetricDefinitions(resourceGroupName, name, workerPoolName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Get metric definitions for a worker pool of an App Service + * Environment. + * + * Get metric definitions for a worker pool of an App Service Environment. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service Environment. + * + * @param {string} workerPoolName Name of the worker pool. + * + * @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 {ResourceMetricDefinitionCollection} - 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 ResourceMetricDefinitionCollection} 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. + */ + listWebWorkerMetricDefinitions(resourceGroupName, name, workerPoolName, 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._listWebWorkerMetricDefinitions(resourceGroupName, name, workerPoolName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listWebWorkerMetricDefinitions(resourceGroupName, name, workerPoolName, options, optionalCallback); + } + } + + /** + * @summary Get metrics for a worker pool of a AppServiceEnvironment (App + * Service Environment). + * + * Get metrics for a worker pool of a AppServiceEnvironment (App Service + * Environment). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service Environment. + * + * @param {string} workerPoolName Name of worker pool + * + * @param {object} [options] Optional Parameters. + * + * @param {boolean} [options.details] Specify true to include + * instance details. The default is false. + * + * @param {string} [options.filter] Return only usages/metrics specified in the + * filter. Filter conforms to odata syntax. Example: $filter=(name.value eq + * 'Metric1' or name.value eq 'Metric2') and startTime eq 2014-01-01T00:00:00Z + * and endTime eq 2014-12-31T23:59:59Z and timeGrain eq + * duration'[Hour|Minute|Day]'. + * + * @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. + */ + listWebWorkerMetricsWithHttpOperationResponse(resourceGroupName, name, workerPoolName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listWebWorkerMetrics(resourceGroupName, name, workerPoolName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Get metrics for a worker pool of a AppServiceEnvironment (App + * Service Environment). + * + * Get metrics for a worker pool of a AppServiceEnvironment (App Service + * Environment). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service Environment. + * + * @param {string} workerPoolName Name of worker pool + * + * @param {object} [options] Optional Parameters. + * + * @param {boolean} [options.details] Specify true to include + * instance details. The default is false. + * + * @param {string} [options.filter] Return only usages/metrics specified in the + * filter. Filter conforms to odata syntax. Example: $filter=(name.value eq + * 'Metric1' or name.value eq 'Metric2') and startTime eq 2014-01-01T00:00:00Z + * and endTime eq 2014-12-31T23:59:59Z and timeGrain eq + * duration'[Hour|Minute|Day]'. + * + * @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 {ResourceMetricCollection} - 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 ResourceMetricCollection} 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. + */ + listWebWorkerMetrics(resourceGroupName, name, workerPoolName, 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._listWebWorkerMetrics(resourceGroupName, name, workerPoolName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listWebWorkerMetrics(resourceGroupName, name, workerPoolName, options, optionalCallback); + } + } + + /** + * @summary Get available SKUs for scaling a worker pool. + * + * Get available SKUs for scaling a worker pool. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service Environment. + * + * @param {string} workerPoolName Name of the worker pool. + * + * @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. + */ + listWorkerPoolSkusWithHttpOperationResponse(resourceGroupName, name, workerPoolName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listWorkerPoolSkus(resourceGroupName, name, workerPoolName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Get available SKUs for scaling a worker pool. + * + * Get available SKUs for scaling a worker pool. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service Environment. + * + * @param {string} workerPoolName Name of the worker pool. + * + * @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 {SkuInfoCollection} - 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 SkuInfoCollection} 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. + */ + listWorkerPoolSkus(resourceGroupName, name, workerPoolName, 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._listWorkerPoolSkus(resourceGroupName, name, workerPoolName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listWorkerPoolSkus(resourceGroupName, name, workerPoolName, options, optionalCallback); + } + } + + /** + * @summary Get usage metrics for a worker pool of an App Service Environment. + * + * Get usage metrics for a worker pool of an App Service Environment. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service Environment. + * + * @param {string} workerPoolName Name of the worker pool. + * + * @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. + */ + listWebWorkerUsagesWithHttpOperationResponse(resourceGroupName, name, workerPoolName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listWebWorkerUsages(resourceGroupName, name, workerPoolName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Get usage metrics for a worker pool of an App Service Environment. + * + * Get usage metrics for a worker pool of an App Service Environment. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service Environment. + * + * @param {string} workerPoolName Name of the worker pool. + * + * @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 {UsageCollection} - 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 UsageCollection} 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. + */ + listWebWorkerUsages(resourceGroupName, name, workerPoolName, 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._listWebWorkerUsages(resourceGroupName, name, workerPoolName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listWebWorkerUsages(resourceGroupName, name, workerPoolName, options, optionalCallback); + } + } + + /** + * @summary Create or update an App Service Environment. + * + * Create or update an App Service Environment. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service Environment. + * + * @param {object} hostingEnvironmentEnvelope Configuration details of the App + * Service Environment. + * + * @param {string} hostingEnvironmentEnvelope.appServiceEnvironmentResourceName + * Name of the App Service Environment. + * + * @param {string} + * hostingEnvironmentEnvelope.appServiceEnvironmentResourceLocation Location of + * the App Service Environment, e.g. "West US". + * + * @param {string} [hostingEnvironmentEnvelope.vnetName] Name of the Virtual + * Network for the App Service Environment. + * + * @param {string} [hostingEnvironmentEnvelope.vnetResourceGroupName] Resource + * group of the Virtual Network. + * + * @param {string} [hostingEnvironmentEnvelope.vnetSubnetName] Subnet of the + * Virtual Network. + * + * @param {object} hostingEnvironmentEnvelope.virtualNetwork Description of the + * Virtual Network. + * + * @param {string} [hostingEnvironmentEnvelope.virtualNetwork.id] Resource id + * of the Virtual Network. + * + * @param {string} [hostingEnvironmentEnvelope.virtualNetwork.subnet] Subnet + * within the Virtual Network. + * + * @param {string} [hostingEnvironmentEnvelope.internalLoadBalancingMode] + * Specifies which endpoints to serve internally in the Virtual Network for the + * App Service Environment. Possible values include: 'None', 'Web', + * 'Publishing' + * + * @param {string} [hostingEnvironmentEnvelope.multiSize] Front-end VM size, + * e.g. "Medium", "Large". + * + * @param {number} [hostingEnvironmentEnvelope.multiRoleCount] Number of + * front-end instances. + * + * @param {array} hostingEnvironmentEnvelope.workerPools Description of worker + * pools with worker size IDs, VM sizes, and number of workers in each pool. + * + * @param {number} [hostingEnvironmentEnvelope.ipsslAddressCount] Number of IP + * SSL addresses reserved for the App Service Environment. + * + * @param {string} [hostingEnvironmentEnvelope.dnsSuffix] DNS suffix of the App + * Service Environment. + * + * @param {array} [hostingEnvironmentEnvelope.networkAccessControlList] Access + * control list for controlling traffic to the App Service Environment. + * + * @param {number} [hostingEnvironmentEnvelope.frontEndScaleFactor] Scale + * factor for front-ends. + * + * @param {string} [hostingEnvironmentEnvelope.apiManagementAccountId] API + * Management Account associated with the App Service Environment. + * + * @param {boolean} [hostingEnvironmentEnvelope.suspended] true if + * the App Service Environment is suspended; otherwise, false. The + * environment can be suspended, e.g. when the management endpoint is no longer + * available + * (most likely because NSG blocked the incoming traffic). + * + * @param {boolean} [hostingEnvironmentEnvelope.dynamicCacheEnabled] True/false + * indicating whether the App Service Environment is suspended. The environment + * can be suspended e.g. when the management endpoint is no longer available + * (most likely because NSG blocked the incoming traffic). + * + * @param {array} [hostingEnvironmentEnvelope.clusterSettings] Custom settings + * for changing the behavior of the App Service Environment. + * + * @param {array} [hostingEnvironmentEnvelope.userWhitelistedIpRanges] User + * added ip ranges to whitelist on ASE db + * + * @param {boolean} [hostingEnvironmentEnvelope.hasLinuxWorkers] Flag that + * displays whether an ASE has linux workers or not + * + * @param {string} [hostingEnvironmentEnvelope.sslCertKeyVaultId] Key Vault ID + * for ILB App Service Environment default SSL certificate + * + * @param {string} [hostingEnvironmentEnvelope.sslCertKeyVaultSecretName] Key + * Vault Secret Name for ILB App Service Environment default SSL certificate + * + * @param {string} [hostingEnvironmentEnvelope.kind] Kind of resource. + * + * @param {string} hostingEnvironmentEnvelope.location Resource Location. + * + * @param {object} [hostingEnvironmentEnvelope.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName, name, hostingEnvironmentEnvelope, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginCreateOrUpdate(resourceGroupName, name, hostingEnvironmentEnvelope, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Create or update an App Service Environment. + * + * Create or update an App Service Environment. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service Environment. + * + * @param {object} hostingEnvironmentEnvelope Configuration details of the App + * Service Environment. + * + * @param {string} hostingEnvironmentEnvelope.appServiceEnvironmentResourceName + * Name of the App Service Environment. + * + * @param {string} + * hostingEnvironmentEnvelope.appServiceEnvironmentResourceLocation Location of + * the App Service Environment, e.g. "West US". + * + * @param {string} [hostingEnvironmentEnvelope.vnetName] Name of the Virtual + * Network for the App Service Environment. + * + * @param {string} [hostingEnvironmentEnvelope.vnetResourceGroupName] Resource + * group of the Virtual Network. + * + * @param {string} [hostingEnvironmentEnvelope.vnetSubnetName] Subnet of the + * Virtual Network. + * + * @param {object} hostingEnvironmentEnvelope.virtualNetwork Description of the + * Virtual Network. + * + * @param {string} [hostingEnvironmentEnvelope.virtualNetwork.id] Resource id + * of the Virtual Network. + * + * @param {string} [hostingEnvironmentEnvelope.virtualNetwork.subnet] Subnet + * within the Virtual Network. + * + * @param {string} [hostingEnvironmentEnvelope.internalLoadBalancingMode] + * Specifies which endpoints to serve internally in the Virtual Network for the + * App Service Environment. Possible values include: 'None', 'Web', + * 'Publishing' + * + * @param {string} [hostingEnvironmentEnvelope.multiSize] Front-end VM size, + * e.g. "Medium", "Large". + * + * @param {number} [hostingEnvironmentEnvelope.multiRoleCount] Number of + * front-end instances. + * + * @param {array} hostingEnvironmentEnvelope.workerPools Description of worker + * pools with worker size IDs, VM sizes, and number of workers in each pool. + * + * @param {number} [hostingEnvironmentEnvelope.ipsslAddressCount] Number of IP + * SSL addresses reserved for the App Service Environment. + * + * @param {string} [hostingEnvironmentEnvelope.dnsSuffix] DNS suffix of the App + * Service Environment. + * + * @param {array} [hostingEnvironmentEnvelope.networkAccessControlList] Access + * control list for controlling traffic to the App Service Environment. + * + * @param {number} [hostingEnvironmentEnvelope.frontEndScaleFactor] Scale + * factor for front-ends. + * + * @param {string} [hostingEnvironmentEnvelope.apiManagementAccountId] API + * Management Account associated with the App Service Environment. + * + * @param {boolean} [hostingEnvironmentEnvelope.suspended] true if + * the App Service Environment is suspended; otherwise, false. The + * environment can be suspended, e.g. when the management endpoint is no longer + * available + * (most likely because NSG blocked the incoming traffic). + * + * @param {boolean} [hostingEnvironmentEnvelope.dynamicCacheEnabled] True/false + * indicating whether the App Service Environment is suspended. The environment + * can be suspended e.g. when the management endpoint is no longer available + * (most likely because NSG blocked the incoming traffic). + * + * @param {array} [hostingEnvironmentEnvelope.clusterSettings] Custom settings + * for changing the behavior of the App Service Environment. + * + * @param {array} [hostingEnvironmentEnvelope.userWhitelistedIpRanges] User + * added ip ranges to whitelist on ASE db + * + * @param {boolean} [hostingEnvironmentEnvelope.hasLinuxWorkers] Flag that + * displays whether an ASE has linux workers or not + * + * @param {string} [hostingEnvironmentEnvelope.sslCertKeyVaultId] Key Vault ID + * for ILB App Service Environment default SSL certificate + * + * @param {string} [hostingEnvironmentEnvelope.sslCertKeyVaultSecretName] Key + * Vault Secret Name for ILB App Service Environment default SSL certificate + * + * @param {string} [hostingEnvironmentEnvelope.kind] Kind of resource. + * + * @param {string} hostingEnvironmentEnvelope.location Resource Location. + * + * @param {object} [hostingEnvironmentEnvelope.tags] Resource tags. + * + * @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 {AppServiceEnvironmentResource} - 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 AppServiceEnvironmentResource} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + beginCreateOrUpdate(resourceGroupName, name, hostingEnvironmentEnvelope, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._beginCreateOrUpdate(resourceGroupName, name, hostingEnvironmentEnvelope, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginCreateOrUpdate(resourceGroupName, name, hostingEnvironmentEnvelope, options, optionalCallback); + } + } + + /** + * @summary Delete an App Service Environment. + * + * Delete an App Service Environment. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service Environment. + * + * @param {object} [options] Optional Parameters. + * + * @param {boolean} [options.forceDelete] Specify true to force + * the deletion even if the App Service Environment contains resources. The + * default is false. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + beginDeleteMethodWithHttpOperationResponse(resourceGroupName, name, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginDeleteMethod(resourceGroupName, name, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Delete an App Service Environment. + * + * Delete an App Service Environment. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service Environment. + * + * @param {object} [options] Optional Parameters. + * + * @param {boolean} [options.forceDelete] Specify true to force + * the deletion even if the App Service Environment contains resources. The + * default is false. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + beginDeleteMethod(resourceGroupName, name, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._beginDeleteMethod(resourceGroupName, name, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginDeleteMethod(resourceGroupName, name, options, optionalCallback); + } + } + + /** + * @summary Move an App Service Environment to a different VNET. + * + * Move an App Service Environment to a different VNET. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service Environment. + * + * @param {object} vnetInfo Details for the new virtual network. + * + * @param {string} [vnetInfo.id] Resource id of the Virtual Network. + * + * @param {string} [vnetInfo.subnet] Subnet within the Virtual Network. + * + * @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. + */ + beginChangeVnetWithHttpOperationResponse(resourceGroupName, name, vnetInfo, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginChangeVnet(resourceGroupName, name, vnetInfo, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Move an App Service Environment to a different VNET. + * + * Move an App Service Environment to a different VNET. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service Environment. + * + * @param {object} vnetInfo Details for the new virtual network. + * + * @param {string} [vnetInfo.id] Resource id of the Virtual Network. + * + * @param {string} [vnetInfo.subnet] Subnet within the Virtual Network. + * + * @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 {WebAppCollection} - 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 WebAppCollection} 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. + */ + beginChangeVnet(resourceGroupName, name, vnetInfo, 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._beginChangeVnet(resourceGroupName, name, vnetInfo, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginChangeVnet(resourceGroupName, name, vnetInfo, options, optionalCallback); + } + } + + /** + * @summary Create or update a multi-role pool. + * + * Create or update a multi-role pool. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service Environment. + * + * @param {object} multiRolePoolEnvelope Properties of the multi-role pool. + * + * @param {number} [multiRolePoolEnvelope.workerSizeId] Worker size ID for + * referencing this worker pool. + * + * @param {string} [multiRolePoolEnvelope.computeMode] Shared or dedicated app + * hosting. Possible values include: 'Shared', 'Dedicated', 'Dynamic' + * + * @param {string} [multiRolePoolEnvelope.workerSize] VM size of the worker + * pool instances. + * + * @param {number} [multiRolePoolEnvelope.workerCount] Number of instances in + * the worker pool. + * + * @param {object} [multiRolePoolEnvelope.sku] + * + * @param {string} [multiRolePoolEnvelope.sku.name] Name of the resource SKU. + * + * @param {string} [multiRolePoolEnvelope.sku.tier] Service tier of the + * resource SKU. + * + * @param {string} [multiRolePoolEnvelope.sku.size] Size specifier of the + * resource SKU. + * + * @param {string} [multiRolePoolEnvelope.sku.family] Family code of the + * resource SKU. + * + * @param {number} [multiRolePoolEnvelope.sku.capacity] Current number of + * instances assigned to the resource. + * + * @param {object} [multiRolePoolEnvelope.sku.skuCapacity] Min, max, and + * default scale values of the SKU. + * + * @param {number} [multiRolePoolEnvelope.sku.skuCapacity.minimum] Minimum + * number of workers for this App Service plan SKU. + * + * @param {number} [multiRolePoolEnvelope.sku.skuCapacity.maximum] Maximum + * number of workers for this App Service plan SKU. + * + * @param {number} [multiRolePoolEnvelope.sku.skuCapacity.default] Default + * number of workers for this App Service plan SKU. + * + * @param {string} [multiRolePoolEnvelope.sku.skuCapacity.scaleType] Available + * scale configurations for an App Service plan. + * + * @param {array} [multiRolePoolEnvelope.sku.locations] Locations of the SKU. + * + * @param {array} [multiRolePoolEnvelope.sku.capabilities] Capabilities of the + * SKU, e.g., is traffic manager enabled? + * + * @param {string} [multiRolePoolEnvelope.kind] Kind of resource. + * + * @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. + */ + beginCreateOrUpdateMultiRolePoolWithHttpOperationResponse(resourceGroupName, name, multiRolePoolEnvelope, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginCreateOrUpdateMultiRolePool(resourceGroupName, name, multiRolePoolEnvelope, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Create or update a multi-role pool. + * + * Create or update a multi-role pool. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service Environment. + * + * @param {object} multiRolePoolEnvelope Properties of the multi-role pool. + * + * @param {number} [multiRolePoolEnvelope.workerSizeId] Worker size ID for + * referencing this worker pool. + * + * @param {string} [multiRolePoolEnvelope.computeMode] Shared or dedicated app + * hosting. Possible values include: 'Shared', 'Dedicated', 'Dynamic' + * + * @param {string} [multiRolePoolEnvelope.workerSize] VM size of the worker + * pool instances. + * + * @param {number} [multiRolePoolEnvelope.workerCount] Number of instances in + * the worker pool. + * + * @param {object} [multiRolePoolEnvelope.sku] + * + * @param {string} [multiRolePoolEnvelope.sku.name] Name of the resource SKU. + * + * @param {string} [multiRolePoolEnvelope.sku.tier] Service tier of the + * resource SKU. + * + * @param {string} [multiRolePoolEnvelope.sku.size] Size specifier of the + * resource SKU. + * + * @param {string} [multiRolePoolEnvelope.sku.family] Family code of the + * resource SKU. + * + * @param {number} [multiRolePoolEnvelope.sku.capacity] Current number of + * instances assigned to the resource. + * + * @param {object} [multiRolePoolEnvelope.sku.skuCapacity] Min, max, and + * default scale values of the SKU. + * + * @param {number} [multiRolePoolEnvelope.sku.skuCapacity.minimum] Minimum + * number of workers for this App Service plan SKU. + * + * @param {number} [multiRolePoolEnvelope.sku.skuCapacity.maximum] Maximum + * number of workers for this App Service plan SKU. + * + * @param {number} [multiRolePoolEnvelope.sku.skuCapacity.default] Default + * number of workers for this App Service plan SKU. + * + * @param {string} [multiRolePoolEnvelope.sku.skuCapacity.scaleType] Available + * scale configurations for an App Service plan. + * + * @param {array} [multiRolePoolEnvelope.sku.locations] Locations of the SKU. + * + * @param {array} [multiRolePoolEnvelope.sku.capabilities] Capabilities of the + * SKU, e.g., is traffic manager enabled? + * + * @param {string} [multiRolePoolEnvelope.kind] Kind of resource. + * + * @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 {WorkerPoolResource} - 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 WorkerPoolResource} 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. + */ + beginCreateOrUpdateMultiRolePool(resourceGroupName, name, multiRolePoolEnvelope, 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._beginCreateOrUpdateMultiRolePool(resourceGroupName, name, multiRolePoolEnvelope, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginCreateOrUpdateMultiRolePool(resourceGroupName, name, multiRolePoolEnvelope, options, optionalCallback); + } + } + + /** + * @summary Resume an App Service Environment. + * + * Resume an App Service Environment. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service Environment. + * + * @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. + */ + beginResumeWithHttpOperationResponse(resourceGroupName, name, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginResume(resourceGroupName, name, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Resume an App Service Environment. + * + * Resume an App Service Environment. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service Environment. + * + * @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 {WebAppCollection} - 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 WebAppCollection} 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. + */ + beginResume(resourceGroupName, name, 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._beginResume(resourceGroupName, name, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginResume(resourceGroupName, name, options, optionalCallback); + } + } + + /** + * @summary Suspend an App Service Environment. + * + * Suspend an App Service Environment. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service Environment. + * + * @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. + */ + beginSuspendWithHttpOperationResponse(resourceGroupName, name, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginSuspend(resourceGroupName, name, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Suspend an App Service Environment. + * + * Suspend an App Service Environment. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service Environment. + * + * @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 {WebAppCollection} - 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 WebAppCollection} 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. + */ + beginSuspend(resourceGroupName, name, 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._beginSuspend(resourceGroupName, name, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginSuspend(resourceGroupName, name, options, optionalCallback); + } + } + + /** + * @summary Create or update a worker pool. + * + * Create or update a worker pool. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service Environment. + * + * @param {string} workerPoolName Name of the worker pool. + * + * @param {object} workerPoolEnvelope Properties of the worker pool. + * + * @param {number} [workerPoolEnvelope.workerSizeId] Worker size ID for + * referencing this worker pool. + * + * @param {string} [workerPoolEnvelope.computeMode] Shared or dedicated app + * hosting. Possible values include: 'Shared', 'Dedicated', 'Dynamic' + * + * @param {string} [workerPoolEnvelope.workerSize] VM size of the worker pool + * instances. + * + * @param {number} [workerPoolEnvelope.workerCount] Number of instances in the + * worker pool. + * + * @param {object} [workerPoolEnvelope.sku] + * + * @param {string} [workerPoolEnvelope.sku.name] Name of the resource SKU. + * + * @param {string} [workerPoolEnvelope.sku.tier] Service tier of the resource + * SKU. + * + * @param {string} [workerPoolEnvelope.sku.size] Size specifier of the resource + * SKU. + * + * @param {string} [workerPoolEnvelope.sku.family] Family code of the resource + * SKU. + * + * @param {number} [workerPoolEnvelope.sku.capacity] Current number of + * instances assigned to the resource. + * + * @param {object} [workerPoolEnvelope.sku.skuCapacity] Min, max, and default + * scale values of the SKU. + * + * @param {number} [workerPoolEnvelope.sku.skuCapacity.minimum] Minimum number + * of workers for this App Service plan SKU. + * + * @param {number} [workerPoolEnvelope.sku.skuCapacity.maximum] Maximum number + * of workers for this App Service plan SKU. + * + * @param {number} [workerPoolEnvelope.sku.skuCapacity.default] Default number + * of workers for this App Service plan SKU. + * + * @param {string} [workerPoolEnvelope.sku.skuCapacity.scaleType] Available + * scale configurations for an App Service plan. + * + * @param {array} [workerPoolEnvelope.sku.locations] Locations of the SKU. + * + * @param {array} [workerPoolEnvelope.sku.capabilities] Capabilities of the + * SKU, e.g., is traffic manager enabled? + * + * @param {string} [workerPoolEnvelope.kind] Kind of resource. + * + * @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. + */ + beginCreateOrUpdateWorkerPoolWithHttpOperationResponse(resourceGroupName, name, workerPoolName, workerPoolEnvelope, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginCreateOrUpdateWorkerPool(resourceGroupName, name, workerPoolName, workerPoolEnvelope, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Create or update a worker pool. + * + * Create or update a worker pool. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service Environment. + * + * @param {string} workerPoolName Name of the worker pool. + * + * @param {object} workerPoolEnvelope Properties of the worker pool. + * + * @param {number} [workerPoolEnvelope.workerSizeId] Worker size ID for + * referencing this worker pool. + * + * @param {string} [workerPoolEnvelope.computeMode] Shared or dedicated app + * hosting. Possible values include: 'Shared', 'Dedicated', 'Dynamic' + * + * @param {string} [workerPoolEnvelope.workerSize] VM size of the worker pool + * instances. + * + * @param {number} [workerPoolEnvelope.workerCount] Number of instances in the + * worker pool. + * + * @param {object} [workerPoolEnvelope.sku] + * + * @param {string} [workerPoolEnvelope.sku.name] Name of the resource SKU. + * + * @param {string} [workerPoolEnvelope.sku.tier] Service tier of the resource + * SKU. + * + * @param {string} [workerPoolEnvelope.sku.size] Size specifier of the resource + * SKU. + * + * @param {string} [workerPoolEnvelope.sku.family] Family code of the resource + * SKU. + * + * @param {number} [workerPoolEnvelope.sku.capacity] Current number of + * instances assigned to the resource. + * + * @param {object} [workerPoolEnvelope.sku.skuCapacity] Min, max, and default + * scale values of the SKU. + * + * @param {number} [workerPoolEnvelope.sku.skuCapacity.minimum] Minimum number + * of workers for this App Service plan SKU. + * + * @param {number} [workerPoolEnvelope.sku.skuCapacity.maximum] Maximum number + * of workers for this App Service plan SKU. + * + * @param {number} [workerPoolEnvelope.sku.skuCapacity.default] Default number + * of workers for this App Service plan SKU. + * + * @param {string} [workerPoolEnvelope.sku.skuCapacity.scaleType] Available + * scale configurations for an App Service plan. + * + * @param {array} [workerPoolEnvelope.sku.locations] Locations of the SKU. + * + * @param {array} [workerPoolEnvelope.sku.capabilities] Capabilities of the + * SKU, e.g., is traffic manager enabled? + * + * @param {string} [workerPoolEnvelope.kind] Kind of resource. + * + * @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 {WorkerPoolResource} - 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 WorkerPoolResource} 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. + */ + beginCreateOrUpdateWorkerPool(resourceGroupName, name, workerPoolName, workerPoolEnvelope, 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._beginCreateOrUpdateWorkerPool(resourceGroupName, name, workerPoolName, workerPoolEnvelope, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginCreateOrUpdateWorkerPool(resourceGroupName, name, workerPoolName, workerPoolEnvelope, options, optionalCallback); + } + } + + /** + * @summary Get all App Service Environments for a subscription. + * + * Get all App Service Environments for a subscription. + * + * @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 Get all App Service Environments for a subscription. + * + * Get all App Service Environments for a subscription. + * + * @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 {AppServiceEnvironmentCollection} - 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 AppServiceEnvironmentCollection} 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); + } + } + + /** + * @summary Get all App Service Environments in a resource group. + * + * Get all App Service Environments in a resource group. + * + * @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. + */ + listByResourceGroupNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listByResourceGroupNext(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 Get all App Service Environments in a resource group. + * + * Get all App Service Environments in a resource group. + * + * @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 {AppServiceEnvironmentCollection} - 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 AppServiceEnvironmentCollection} 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. + */ + listByResourceGroupNext(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._listByResourceGroupNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listByResourceGroupNext(nextPageLink, options, optionalCallback); + } + } + + /** + * @summary Get the used, available, and total worker capacity an App Service + * Environment. + * + * Get the used, available, and total worker capacity an App Service + * Environment. + * + * @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. + */ + listCapacitiesNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listCapacitiesNext(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 Get the used, available, and total worker capacity an App Service + * Environment. + * + * Get the used, available, and total worker capacity an App Service + * Environment. + * + * @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 {StampCapacityCollection} - 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 StampCapacityCollection} 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. + */ + listCapacitiesNext(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._listCapacitiesNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listCapacitiesNext(nextPageLink, options, optionalCallback); + } + } + + /** + * @summary Move an App Service Environment to a different VNET. + * + * Move an App Service Environment to a different VNET. + * + * @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. + */ + changeVnetNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._changeVnetNext(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 Move an App Service Environment to a different VNET. + * + * Move an App Service Environment to a different VNET. + * + * @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 {WebAppCollection} - 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 WebAppCollection} 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. + */ + changeVnetNext(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._changeVnetNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._changeVnetNext(nextPageLink, options, optionalCallback); + } + } + + /** + * @summary Get global metrics of an App Service Environment. + * + * Get global metrics of an App Service Environment. + * + * @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. + */ + listMetricsNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listMetricsNext(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 Get global metrics of an App Service Environment. + * + * Get global metrics of an App Service Environment. + * + * @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 {ResourceMetricCollection} - 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 ResourceMetricCollection} 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. + */ + listMetricsNext(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._listMetricsNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listMetricsNext(nextPageLink, options, optionalCallback); + } + } + + /** + * @summary Get all multi-role pools. + * + * Get all multi-role pools. + * + * @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. + */ + listMultiRolePoolsNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listMultiRolePoolsNext(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 Get all multi-role pools. + * + * Get all multi-role pools. + * + * @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 {WorkerPoolCollection} - 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 WorkerPoolCollection} 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. + */ + listMultiRolePoolsNext(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._listMultiRolePoolsNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listMultiRolePoolsNext(nextPageLink, options, optionalCallback); + } + } + + /** + * @summary Get metric definitions for a specific instance of a multi-role pool + * of an App Service Environment. + * + * Get metric definitions for a specific instance of a multi-role pool of an + * App Service Environment. + * + * @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. + */ + listMultiRolePoolInstanceMetricDefinitionsNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listMultiRolePoolInstanceMetricDefinitionsNext(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 Get metric definitions for a specific instance of a multi-role pool + * of an App Service Environment. + * + * Get metric definitions for a specific instance of a multi-role pool of an + * App Service Environment. + * + * @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 {ResourceMetricDefinitionCollection} - 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 ResourceMetricDefinitionCollection} 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. + */ + listMultiRolePoolInstanceMetricDefinitionsNext(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._listMultiRolePoolInstanceMetricDefinitionsNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listMultiRolePoolInstanceMetricDefinitionsNext(nextPageLink, options, optionalCallback); + } + } + + /** + * @summary Get metrics for a specific instance of a multi-role pool of an App + * Service Environment. + * + * Get metrics for a specific instance of a multi-role pool of an App Service + * Environment. + * + * @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. + */ + listMultiRolePoolInstanceMetricsNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listMultiRolePoolInstanceMetricsNext(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 Get metrics for a specific instance of a multi-role pool of an App + * Service Environment. + * + * Get metrics for a specific instance of a multi-role pool of an App Service + * Environment. + * + * @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 {ResourceMetricCollection} - 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 ResourceMetricCollection} 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. + */ + listMultiRolePoolInstanceMetricsNext(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._listMultiRolePoolInstanceMetricsNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listMultiRolePoolInstanceMetricsNext(nextPageLink, options, optionalCallback); + } + } + + /** + * @summary Get metric definitions for a multi-role pool of an App Service + * Environment. + * + * Get metric definitions for a multi-role pool of an App Service Environment. + * + * @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. + */ + listMultiRoleMetricDefinitionsNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listMultiRoleMetricDefinitionsNext(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 Get metric definitions for a multi-role pool of an App Service + * Environment. + * + * Get metric definitions for a multi-role pool of an App Service Environment. + * + * @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 {ResourceMetricDefinitionCollection} - 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 ResourceMetricDefinitionCollection} 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. + */ + listMultiRoleMetricDefinitionsNext(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._listMultiRoleMetricDefinitionsNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listMultiRoleMetricDefinitionsNext(nextPageLink, options, optionalCallback); + } + } + + /** + * @summary Get metrics for a multi-role pool of an App Service Environment. + * + * Get metrics for a multi-role pool of an App Service Environment. + * + * @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. + */ + listMultiRoleMetricsNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listMultiRoleMetricsNext(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 Get metrics for a multi-role pool of an App Service Environment. + * + * Get metrics for a multi-role pool of an App Service Environment. + * + * @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 {ResourceMetricCollection} - 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 ResourceMetricCollection} 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. + */ + listMultiRoleMetricsNext(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._listMultiRoleMetricsNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listMultiRoleMetricsNext(nextPageLink, options, optionalCallback); + } + } + + /** + * @summary Get available SKUs for scaling a multi-role pool. + * + * Get available SKUs for scaling a multi-role pool. + * + * @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. + */ + listMultiRolePoolSkusNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listMultiRolePoolSkusNext(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 Get available SKUs for scaling a multi-role pool. + * + * Get available SKUs for scaling a multi-role pool. + * + * @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 {SkuInfoCollection} - 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 SkuInfoCollection} 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. + */ + listMultiRolePoolSkusNext(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._listMultiRolePoolSkusNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listMultiRolePoolSkusNext(nextPageLink, options, optionalCallback); + } + } + + /** + * @summary Get usage metrics for a multi-role pool of an App Service + * Environment. + * + * Get usage metrics for a multi-role pool of an App Service Environment. + * + * @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. + */ + listMultiRoleUsagesNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listMultiRoleUsagesNext(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 Get usage metrics for a multi-role pool of an App Service + * Environment. + * + * Get usage metrics for a multi-role pool of an App Service Environment. + * + * @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 {UsageCollection} - 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 UsageCollection} 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. + */ + listMultiRoleUsagesNext(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._listMultiRoleUsagesNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listMultiRoleUsagesNext(nextPageLink, options, optionalCallback); + } + } + + /** + * @summary Resume an App Service Environment. + * + * Resume an App Service Environment. + * + * @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. + */ + resumeNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._resumeNext(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 Resume an App Service Environment. + * + * Resume an App Service Environment. + * + * @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 {WebAppCollection} - 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 WebAppCollection} 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. + */ + resumeNext(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._resumeNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._resumeNext(nextPageLink, options, optionalCallback); + } + } + + /** + * @summary Get all App Service plans in an App Service Environment. + * + * Get all App Service plans in an App Service Environment. + * + * @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. + */ + listAppServicePlansNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listAppServicePlansNext(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 Get all App Service plans in an App Service Environment. + * + * Get all App Service plans in an App Service Environment. + * + * @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 {AppServicePlanCollection} - 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 AppServicePlanCollection} 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. + */ + listAppServicePlansNext(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._listAppServicePlansNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listAppServicePlansNext(nextPageLink, options, optionalCallback); + } + } + + /** + * @summary Get all apps in an App Service Environment. + * + * Get all apps in an App Service Environment. + * + * @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. + */ + listWebAppsNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listWebAppsNext(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 Get all apps in an App Service Environment. + * + * Get all apps in an App Service Environment. + * + * @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 {WebAppCollection} - 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 WebAppCollection} 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. + */ + listWebAppsNext(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._listWebAppsNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listWebAppsNext(nextPageLink, options, optionalCallback); + } + } + + /** + * @summary Suspend an App Service Environment. + * + * Suspend an App Service Environment. + * + * @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. + */ + suspendNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._suspendNext(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 Suspend an App Service Environment. + * + * Suspend an App Service Environment. + * + * @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 {WebAppCollection} - 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 WebAppCollection} 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. + */ + suspendNext(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._suspendNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._suspendNext(nextPageLink, options, optionalCallback); + } + } + + /** + * @summary Get global usage metrics of an App Service Environment. + * + * Get global usage metrics of an App Service Environment. + * + * @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. + */ + listUsagesNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listUsagesNext(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 Get global usage metrics of an App Service Environment. + * + * Get global usage metrics of an App Service Environment. + * + * @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 {CsmUsageQuotaCollection} - 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 CsmUsageQuotaCollection} 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. + */ + listUsagesNext(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._listUsagesNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listUsagesNext(nextPageLink, options, optionalCallback); + } + } + + /** + * @summary Get all worker pools of an App Service Environment. + * + * Get all worker pools of an App Service Environment. + * + * @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. + */ + listWorkerPoolsNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listWorkerPoolsNext(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 Get all worker pools of an App Service Environment. + * + * Get all worker pools of an App Service Environment. + * + * @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 {WorkerPoolCollection} - 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 WorkerPoolCollection} 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. + */ + listWorkerPoolsNext(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._listWorkerPoolsNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listWorkerPoolsNext(nextPageLink, options, optionalCallback); + } + } + + /** + * @summary Get metric definitions for a specific instance of a worker pool of + * an App Service Environment. + * + * Get metric definitions for a specific instance of a worker pool of an App + * Service Environment. + * + * @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. + */ + listWorkerPoolInstanceMetricDefinitionsNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listWorkerPoolInstanceMetricDefinitionsNext(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 Get metric definitions for a specific instance of a worker pool of + * an App Service Environment. + * + * Get metric definitions for a specific instance of a worker pool of an App + * Service Environment. + * + * @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 {ResourceMetricDefinitionCollection} - 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 ResourceMetricDefinitionCollection} 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. + */ + listWorkerPoolInstanceMetricDefinitionsNext(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._listWorkerPoolInstanceMetricDefinitionsNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listWorkerPoolInstanceMetricDefinitionsNext(nextPageLink, options, optionalCallback); + } + } + + /** + * @summary Get metrics for a specific instance of a worker pool of an App + * Service Environment. + * + * Get metrics for a specific instance of a worker pool of an App Service + * Environment. + * + * @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. + */ + listWorkerPoolInstanceMetricsNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listWorkerPoolInstanceMetricsNext(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 Get metrics for a specific instance of a worker pool of an App + * Service Environment. + * + * Get metrics for a specific instance of a worker pool of an App Service + * Environment. + * + * @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 {ResourceMetricCollection} - 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 ResourceMetricCollection} 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. + */ + listWorkerPoolInstanceMetricsNext(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._listWorkerPoolInstanceMetricsNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listWorkerPoolInstanceMetricsNext(nextPageLink, options, optionalCallback); + } + } + + /** + * @summary Get metric definitions for a worker pool of an App Service + * Environment. + * + * Get metric definitions for a worker pool of an App Service Environment. + * + * @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. + */ + listWebWorkerMetricDefinitionsNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listWebWorkerMetricDefinitionsNext(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 Get metric definitions for a worker pool of an App Service + * Environment. + * + * Get metric definitions for a worker pool of an App Service Environment. + * + * @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 {ResourceMetricDefinitionCollection} - 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 ResourceMetricDefinitionCollection} 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. + */ + listWebWorkerMetricDefinitionsNext(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._listWebWorkerMetricDefinitionsNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listWebWorkerMetricDefinitionsNext(nextPageLink, options, optionalCallback); + } + } + + /** + * @summary Get metrics for a worker pool of a AppServiceEnvironment (App + * Service Environment). + * + * Get metrics for a worker pool of a AppServiceEnvironment (App Service + * Environment). + * + * @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. + */ + listWebWorkerMetricsNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listWebWorkerMetricsNext(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 Get metrics for a worker pool of a AppServiceEnvironment (App + * Service Environment). + * + * Get metrics for a worker pool of a AppServiceEnvironment (App Service + * Environment). + * + * @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 {ResourceMetricCollection} - 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 ResourceMetricCollection} 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. + */ + listWebWorkerMetricsNext(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._listWebWorkerMetricsNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listWebWorkerMetricsNext(nextPageLink, options, optionalCallback); + } + } + + /** + * @summary Get available SKUs for scaling a worker pool. + * + * Get available SKUs for scaling a worker pool. + * + * @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. + */ + listWorkerPoolSkusNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listWorkerPoolSkusNext(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 Get available SKUs for scaling a worker pool. + * + * Get available SKUs for scaling a worker pool. + * + * @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 {SkuInfoCollection} - 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 SkuInfoCollection} 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. + */ + listWorkerPoolSkusNext(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._listWorkerPoolSkusNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listWorkerPoolSkusNext(nextPageLink, options, optionalCallback); + } + } + + /** + * @summary Get usage metrics for a worker pool of an App Service Environment. + * + * Get usage metrics for a worker pool of an App Service Environment. + * + * @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. + */ + listWebWorkerUsagesNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listWebWorkerUsagesNext(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 Get usage metrics for a worker pool of an App Service Environment. + * + * Get usage metrics for a worker pool of an App Service Environment. + * + * @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 {UsageCollection} - 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 UsageCollection} 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. + */ + listWebWorkerUsagesNext(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._listWebWorkerUsagesNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listWebWorkerUsagesNext(nextPageLink, options, optionalCallback); + } + } + + /** + * @summary Move an App Service Environment to a different VNET. + * + * Move an App Service Environment to a different VNET. + * + * @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. + */ + beginChangeVnetNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginChangeVnetNext(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 Move an App Service Environment to a different VNET. + * + * Move an App Service Environment to a different VNET. + * + * @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 {WebAppCollection} - 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 WebAppCollection} 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. + */ + beginChangeVnetNext(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._beginChangeVnetNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginChangeVnetNext(nextPageLink, options, optionalCallback); + } + } + + /** + * @summary Resume an App Service Environment. + * + * Resume an App Service Environment. + * + * @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. + */ + beginResumeNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginResumeNext(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 Resume an App Service Environment. + * + * Resume an App Service Environment. + * + * @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 {WebAppCollection} - 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 WebAppCollection} 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. + */ + beginResumeNext(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._beginResumeNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginResumeNext(nextPageLink, options, optionalCallback); + } + } + + /** + * @summary Suspend an App Service Environment. + * + * Suspend an App Service Environment. + * + * @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. + */ + beginSuspendNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginSuspendNext(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 Suspend an App Service Environment. + * + * Suspend an App Service Environment. + * + * @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 {WebAppCollection} - 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 WebAppCollection} 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. + */ + beginSuspendNext(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._beginSuspendNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginSuspendNext(nextPageLink, options, optionalCallback); + } + } + +} + +module.exports = AppServiceEnvironments; diff --git a/lib/services/websiteManagement2/lib/operations/appServicePlans.js b/lib/services/websiteManagement2/lib/operations/appServicePlans.js new file mode 100644 index 0000000000..0f4bac9ca1 --- /dev/null +++ b/lib/services/websiteManagement2/lib/operations/appServicePlans.js @@ -0,0 +1,10604 @@ +/* + * 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 Get all App Service plans for a subcription. + * + * Get all App Service plans for a subcription. + * + * @param {object} [options] Optional Parameters. + * + * @param {boolean} [options.detailed] Specify true to return all + * App Service plan properties. The default is false, which + * returns a subset of the properties. + * Retrieval of all properties may increase the API latency. + * + * @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 AppServicePlanCollection} 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 detailed = (options && options.detailed !== undefined) ? options.detailed : undefined; + // Validate + try { + if (detailed !== null && detailed !== undefined && typeof detailed !== 'boolean') { + throw new Error('detailed 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.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/providers/Microsoft.Web/serverfarms'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + if (detailed !== null && detailed !== undefined) { + queryParameters.push('detailed=' + encodeURIComponent(detailed.toString())); + } + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['AppServicePlanCollection']().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 Get all App Service plans in a resource group. + * + * Get all App Service plans in a resource group. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @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 AppServicePlanCollection} 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 _listByResourceGroup(resourceGroupName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['AppServicePlanCollection']().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 Get an App Service plan. + * + * Get an App Service plan. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service plan. + * + * @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 AppServicePlan} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _get(resourceGroupName, name, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 404) { + 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['AppServicePlan']().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 Creates or updates an App Service Plan. + * + * Creates or updates an App Service Plan. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service plan. + * + * @param {object} appServicePlan Details of the App Service plan. + * + * @param {string} [appServicePlan.workerTierName] Target worker tier assigned + * to the App Service plan. + * + * @param {string} [appServicePlan.adminSiteName] App Service plan + * administration site. + * + * @param {object} [appServicePlan.hostingEnvironmentProfile] Specification for + * the App Service Environment to use for the App Service plan. + * + * @param {string} [appServicePlan.hostingEnvironmentProfile.id] Resource ID of + * the App Service Environment. + * + * @param {boolean} [appServicePlan.perSiteScaling] If true, apps + * assigned to this App Service plan can be scaled independently. + * If false, apps assigned to this App Service plan will scale to + * all instances of the plan. + * + * @param {boolean} [appServicePlan.isSpot] If true, this App + * Service Plan owns spot instances. + * + * @param {date} [appServicePlan.spotExpirationTime] The time when the server + * farm expires. Valid only if it is a spot server farm. + * + * @param {date} [appServicePlan.freeOfferExpirationTime] The time when the + * server farm free offer expires. + * + * @param {boolean} [appServicePlan.reserved] If Linux app service plan + * true, false otherwise. + * + * @param {boolean} [appServicePlan.isXenon] Obsolete: If Hyper-V container app + * service plan true, false otherwise. + * + * @param {boolean} [appServicePlan.hyperV] If Hyper-V container app service + * plan true, false otherwise. + * + * @param {number} [appServicePlan.targetWorkerCount] Scaling worker count. + * + * @param {number} [appServicePlan.targetWorkerSizeId] Scaling worker size ID. + * + * @param {object} [appServicePlan.sku] + * + * @param {string} [appServicePlan.sku.name] Name of the resource SKU. + * + * @param {string} [appServicePlan.sku.tier] Service tier of the resource SKU. + * + * @param {string} [appServicePlan.sku.size] Size specifier of the resource + * SKU. + * + * @param {string} [appServicePlan.sku.family] Family code of the resource SKU. + * + * @param {number} [appServicePlan.sku.capacity] Current number of instances + * assigned to the resource. + * + * @param {object} [appServicePlan.sku.skuCapacity] Min, max, and default scale + * values of the SKU. + * + * @param {number} [appServicePlan.sku.skuCapacity.minimum] Minimum number of + * workers for this App Service plan SKU. + * + * @param {number} [appServicePlan.sku.skuCapacity.maximum] Maximum number of + * workers for this App Service plan SKU. + * + * @param {number} [appServicePlan.sku.skuCapacity.default] Default number of + * workers for this App Service plan SKU. + * + * @param {string} [appServicePlan.sku.skuCapacity.scaleType] Available scale + * configurations for an App Service plan. + * + * @param {array} [appServicePlan.sku.locations] Locations of the SKU. + * + * @param {array} [appServicePlan.sku.capabilities] Capabilities of the SKU, + * e.g., is traffic manager enabled? + * + * @param {string} [appServicePlan.kind] Kind of resource. + * + * @param {string} appServicePlan.location Resource Location. + * + * @param {object} [appServicePlan.tags] Resource tags. + * + * @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 AppServicePlan} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _createOrUpdate(resourceGroupName, name, appServicePlan, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + + if (!callback) { + throw new Error('callback cannot be null.'); + } + + // Send request + this.beginCreateOrUpdate(resourceGroupName, name, appServicePlan, options, (err, parsedResult, httpRequest, response) => { + if (err) return callback(err); + + let initialResult = new msRest.HttpOperationResponse(); + initialResult.request = httpRequest; + initialResult.response = response; + initialResult.body = response.body; + client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { + if (err) return callback(err); + + // Create Result + let result = null; + + httpRequest = pollingResult.request; + response = pollingResult.response; + let responseBody = pollingResult.body; + if (responseBody === '') responseBody = null; + + // Deserialize Response + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['AppServicePlan']().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 Delete an App Service plan. + * + * Delete an App Service plan. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service plan. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _deleteMethod(resourceGroupName, name, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'DELETE'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 204) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + + return callback(null, result, httpRequest, response); + }); +} + +/** + * @summary Creates or updates an App Service Plan. + * + * Creates or updates an App Service Plan. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service plan. + * + * @param {object} appServicePlan Details of the App Service plan. + * + * @param {string} [appServicePlan.workerTierName] Target worker tier assigned + * to the App Service plan. + * + * @param {string} [appServicePlan.adminSiteName] App Service plan + * administration site. + * + * @param {object} [appServicePlan.hostingEnvironmentProfile] Specification for + * the App Service Environment to use for the App Service plan. + * + * @param {string} [appServicePlan.hostingEnvironmentProfile.id] Resource ID of + * the App Service Environment. + * + * @param {boolean} [appServicePlan.perSiteScaling] If true, apps + * assigned to this App Service plan can be scaled independently. + * If false, apps assigned to this App Service plan will scale to + * all instances of the plan. + * + * @param {boolean} [appServicePlan.isSpot] If true, this App + * Service Plan owns spot instances. + * + * @param {date} [appServicePlan.spotExpirationTime] The time when the server + * farm expires. Valid only if it is a spot server farm. + * + * @param {date} [appServicePlan.freeOfferExpirationTime] The time when the + * server farm free offer expires. + * + * @param {boolean} [appServicePlan.reserved] If Linux app service plan + * true, false otherwise. + * + * @param {boolean} [appServicePlan.isXenon] Obsolete: If Hyper-V container app + * service plan true, false otherwise. + * + * @param {boolean} [appServicePlan.hyperV] If Hyper-V container app service + * plan true, false otherwise. + * + * @param {number} [appServicePlan.targetWorkerCount] Scaling worker count. + * + * @param {number} [appServicePlan.targetWorkerSizeId] Scaling worker size ID. + * + * @param {string} [appServicePlan.kind] Kind of resource. + * + * @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 AppServicePlan} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _update(resourceGroupName, name, appServicePlan, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (appServicePlan === null || appServicePlan === undefined) { + throw new Error('appServicePlan cannot be null or undefined.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'PATCH'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (appServicePlan !== null && appServicePlan !== undefined) { + let requestModelMapper = new client.models['AppServicePlanPatchResource']().mapper(); + requestModel = client.serialize(requestModelMapper, appServicePlan, 'appServicePlan'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(appServicePlan, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 202) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['AppServicePlan']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + // Deserialize Response + if (statusCode === 202) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['AppServicePlan']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError1 = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError1.request = msRest.stripRequest(httpRequest); + deserializationError1.response = msRest.stripResponse(response); + return callback(deserializationError1); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * @summary List all capabilities of an App Service plan. + * + * List all capabilities of an App Service plan. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service plan. + * + * @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. + * + * {array} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _listCapabilities(resourceGroupName, name, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/capabilities'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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 = { + required: false, + serializedName: 'parsedResponse', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'CapabilityElementType', + type: { + name: 'Composite', + className: 'Capability' + } + } + } + }; + 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 Retrieve a Hybrid Connection in use in an App Service plan. + * + * Retrieve a Hybrid Connection in use in an App Service plan. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service plan. + * + * @param {string} namespaceName Name of the Service Bus namespace. + * + * @param {string} relayName Name of the Service Bus relay. + * + * @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 HybridConnection} 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 _getHybridConnection(resourceGroupName, name, namespaceName, relayName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (namespaceName === null || namespaceName === undefined || typeof namespaceName.valueOf() !== 'string') { + throw new Error('namespaceName cannot be null or undefined and it must be of type string.'); + } + if (relayName === null || relayName === undefined || typeof relayName.valueOf() !== 'string') { + throw new Error('relayName cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{namespaceName}', encodeURIComponent(namespaceName)); + requestUrl = requestUrl.replace('{relayName}', encodeURIComponent(relayName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['HybridConnection']().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 Delete a Hybrid Connection in use in an App Service plan. + * + * Delete a Hybrid Connection in use in an App Service plan. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service plan. + * + * @param {string} namespaceName Name of the Service Bus namespace. + * + * @param {string} relayName Name of the Service Bus relay. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _deleteHybridConnection(resourceGroupName, name, namespaceName, relayName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (namespaceName === null || namespaceName === undefined || typeof namespaceName.valueOf() !== 'string') { + throw new Error('namespaceName cannot be null or undefined and it must be of type string.'); + } + if (relayName === null || relayName === undefined || typeof relayName.valueOf() !== 'string') { + throw new Error('relayName cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{namespaceName}', encodeURIComponent(namespaceName)); + requestUrl = requestUrl.replace('{relayName}', encodeURIComponent(relayName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'DELETE'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 204) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + + return callback(null, result, httpRequest, response); + }); +} + +/** + * @summary Get the send key name and value of a Hybrid Connection. + * + * Get the send key name and value of a Hybrid Connection. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service plan. + * + * @param {string} namespaceName The name of the Service Bus namespace. + * + * @param {string} relayName The name of the Service Bus relay. + * + * @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 HybridConnectionKey} 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 _listHybridConnectionKeys(resourceGroupName, name, namespaceName, relayName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (namespaceName === null || namespaceName === undefined || typeof namespaceName.valueOf() !== 'string') { + throw new Error('namespaceName cannot be null or undefined and it must be of type string.'); + } + if (relayName === null || relayName === undefined || typeof relayName.valueOf() !== 'string') { + throw new Error('relayName cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}/listKeys'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{namespaceName}', encodeURIComponent(namespaceName)); + requestUrl = requestUrl.replace('{relayName}', encodeURIComponent(relayName)); + 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]; + } + } + } + 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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['HybridConnectionKey']().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 Get all apps that use a Hybrid Connection in an App Service Plan. + * + * Get all apps that use a Hybrid Connection in an App Service Plan. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service plan. + * + * @param {string} namespaceName Name of the Hybrid Connection namespace. + * + * @param {string} relayName Name of the Hybrid Connection relay. + * + * @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 ResourceCollection} 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 _listWebAppsByHybridConnection(resourceGroupName, name, namespaceName, relayName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (namespaceName === null || namespaceName === undefined || typeof namespaceName.valueOf() !== 'string') { + throw new Error('namespaceName cannot be null or undefined and it must be of type string.'); + } + if (relayName === null || relayName === undefined || typeof relayName.valueOf() !== 'string') { + throw new Error('relayName cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}/sites'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{namespaceName}', encodeURIComponent(namespaceName)); + requestUrl = requestUrl.replace('{relayName}', encodeURIComponent(relayName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['ResourceCollection']().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 Get the maximum number of Hybrid Connections allowed in an App + * Service plan. + * + * Get the maximum number of Hybrid Connections allowed in an App Service plan. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service plan. + * + * @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 HybridConnectionLimits} 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 _getHybridConnectionPlanLimit(resourceGroupName, name, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/hybridConnectionPlanLimits/limit'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['HybridConnectionLimits']().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 Retrieve all Hybrid Connections in use in an App Service plan. + * + * Retrieve all Hybrid Connections in use in an App Service plan. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service plan. + * + * @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 HybridConnectionCollection} 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 _listHybridConnections(resourceGroupName, name, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/hybridConnectionRelays'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['HybridConnectionCollection']().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 Get metrics that can be queried for an App Service plan, and their + * definitions. + * + * Get metrics that can be queried for an App Service plan, and their + * definitions. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service plan. + * + * @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 ResourceMetricDefinitionCollection} 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 _listMetricDefintions(resourceGroupName, name, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/metricdefinitions'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['ResourceMetricDefinitionCollection']().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 Get metrics for an App Serice plan. + * + * Get metrics for an App Serice plan. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service plan. + * + * @param {object} [options] Optional Parameters. + * + * @param {boolean} [options.details] Specify true to include + * instance details. The default is false. + * + * @param {string} [options.filter] Return only usages/metrics specified in the + * filter. Filter conforms to odata syntax. Example: $filter=(name.value eq + * 'Metric1' or name.value eq 'Metric2') and startTime eq 2014-01-01T00:00:00Z + * and endTime eq 2014-12-31T23:59:59Z and timeGrain eq + * duration'[Hour|Minute|Day]'. + * + * @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 ResourceMetricCollection} 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 _listMetrics(resourceGroupName, name, 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 details = (options && options.details !== undefined) ? options.details : undefined; + let filter = (options && options.filter !== undefined) ? options.filter : undefined; + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (details !== null && details !== undefined && typeof details !== 'boolean') { + throw new Error('details must be of type boolean.'); + } + if (filter !== null && filter !== undefined && typeof filter.valueOf() !== 'string') { + throw new Error('filter must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/metrics'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + if (details !== null && details !== undefined) { + queryParameters.push('details=' + encodeURIComponent(details.toString())); + } + if (filter !== null && filter !== undefined) { + queryParameters.push('$filter=' + filter); + } + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['ResourceMetricCollection']().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 Restart all apps in an App Service plan. + * + * Restart all apps in an App Service plan. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service plan. + * + * @param {object} [options] Optional Parameters. + * + * @param {boolean} [options.softRestart] Specify true to performa + * a soft restart, applies the configuration settings and restarts the apps if + * necessary. The default is false, which always restarts and + * reprovisions the apps + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _restartWebApps(resourceGroupName, name, 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 softRestart = (options && options.softRestart !== undefined) ? options.softRestart : undefined; + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (softRestart !== null && softRestart !== undefined && typeof softRestart !== 'boolean') { + throw new Error('softRestart 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.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/restartSites'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + if (softRestart !== null && softRestart !== undefined) { + queryParameters.push('softRestart=' + encodeURIComponent(softRestart.toString())); + } + 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]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 204) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + + return callback(null, result, httpRequest, response); + }); +} + +/** + * @summary Get all apps associated with an App Service plan. + * + * Get all apps associated with an App Service plan. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service plan. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.skipToken] Skip to a web app in the list of webapps + * associated with app service plan. If specified, the resulting list will + * contain web apps starting from (including) the skipToken. Otherwise, the + * resulting list contains web apps from the start of the list + * + * @param {string} [options.filter] Supported filter: $filter=state eq running. + * Returns only web apps that are currently running + * + * @param {string} [options.top] List page size. If specified, results are + * paged. + * + * @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 WebAppCollection} 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 _listWebApps(resourceGroupName, name, 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 skipToken = (options && options.skipToken !== undefined) ? options.skipToken : undefined; + let filter = (options && options.filter !== undefined) ? options.filter : undefined; + let top = (options && options.top !== undefined) ? options.top : undefined; + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (skipToken !== null && skipToken !== undefined && typeof skipToken.valueOf() !== 'string') { + throw new Error('skipToken must be of type string.'); + } + if (filter !== null && filter !== undefined && typeof filter.valueOf() !== 'string') { + throw new Error('filter must be of type string.'); + } + if (top !== null && top !== undefined && typeof top.valueOf() !== 'string') { + throw new Error('top must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/sites'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + if (skipToken !== null && skipToken !== undefined) { + queryParameters.push('$skipToken=' + encodeURIComponent(skipToken)); + } + if (filter !== null && filter !== undefined) { + queryParameters.push('$filter=' + filter); + } + if (top !== null && top !== undefined) { + queryParameters.push('$top=' + encodeURIComponent(top)); + } + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['WebAppCollection']().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 all selectable sku's for a given App Service Plan + * + * Gets all selectable sku's for a given App Service Plan + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of App Service Plan + * + * @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. + * + * {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 _getServerFarmSkus(resourceGroupName, name, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/skus'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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 = { + required: false, + serializedName: 'parsedResponse', + type: { + name: 'Object' + } + }; + 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 server farm usage information + * + * Gets server farm usage information + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of App Service Plan + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.filter] Return only usages/metrics specified in the + * filter. Filter conforms to odata syntax. Example: $filter=(name.value eq + * 'Metric1' or name.value eq 'Metric2'). + * + * @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 CsmUsageQuotaCollection} 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 _listUsages(resourceGroupName, name, 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 filter = (options && options.filter !== undefined) ? options.filter : undefined; + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (filter !== null && filter !== undefined && typeof filter.valueOf() !== 'string') { + throw new Error('filter must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/usages'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + if (filter !== null && filter !== undefined) { + queryParameters.push('$filter=' + filter); + } + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['CsmUsageQuotaCollection']().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 Get all Virtual Networks associated with an App Service plan. + * + * Get all Virtual Networks associated with an App Service plan. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service plan. + * + * @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. + * + * {array} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _listVnets(resourceGroupName, name, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/virtualNetworkConnections'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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 = { + required: false, + serializedName: 'parsedResponse', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'VnetInfoElementType', + type: { + name: 'Composite', + className: 'VnetInfo' + } + } + } + }; + 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 Get a Virtual Network associated with an App Service plan. + * + * Get a Virtual Network associated with an App Service plan. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service plan. + * + * @param {string} vnetName Name of the Virtual Network. + * + * @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 VnetInfo} 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 _getVnetFromServerFarm(resourceGroupName, name, vnetName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (vnetName === null || vnetName === undefined || typeof vnetName.valueOf() !== 'string') { + throw new Error('vnetName cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/virtualNetworkConnections/{vnetName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{vnetName}', encodeURIComponent(vnetName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 404) { + 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['VnetInfo']().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 Get a Virtual Network gateway. + * + * Get a Virtual Network gateway. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service plan. + * + * @param {string} vnetName Name of the Virtual Network. + * + * @param {string} gatewayName Name of the gateway. Only the 'primary' gateway + * is supported. + * + * @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 VnetGateway} 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 _getVnetGateway(resourceGroupName, name, vnetName, gatewayName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (vnetName === null || vnetName === undefined || typeof vnetName.valueOf() !== 'string') { + throw new Error('vnetName cannot be null or undefined and it must be of type string.'); + } + if (gatewayName === null || gatewayName === undefined || typeof gatewayName.valueOf() !== 'string') { + throw new Error('gatewayName cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/virtualNetworkConnections/{vnetName}/gateways/{gatewayName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{vnetName}', encodeURIComponent(vnetName)); + requestUrl = requestUrl.replace('{gatewayName}', encodeURIComponent(gatewayName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['VnetGateway']().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 Update a Virtual Network gateway. + * + * Update a Virtual Network gateway. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service plan. + * + * @param {string} vnetName Name of the Virtual Network. + * + * @param {string} gatewayName Name of the gateway. Only the 'primary' gateway + * is supported. + * + * @param {object} connectionEnvelope Definition of the gateway. + * + * @param {string} [connectionEnvelope.vnetName] The Virtual Network name. + * + * @param {string} connectionEnvelope.vpnPackageUri The URI where the VPN + * package can be downloaded. + * + * @param {string} [connectionEnvelope.kind] Kind of resource. + * + * @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 VnetGateway} 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 _updateVnetGateway(resourceGroupName, name, vnetName, gatewayName, connectionEnvelope, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (vnetName === null || vnetName === undefined || typeof vnetName.valueOf() !== 'string') { + throw new Error('vnetName cannot be null or undefined and it must be of type string.'); + } + if (gatewayName === null || gatewayName === undefined || typeof gatewayName.valueOf() !== 'string') { + throw new Error('gatewayName cannot be null or undefined and it must be of type string.'); + } + if (connectionEnvelope === null || connectionEnvelope === undefined) { + throw new Error('connectionEnvelope cannot be null or undefined.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/virtualNetworkConnections/{vnetName}/gateways/{gatewayName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{vnetName}', encodeURIComponent(vnetName)); + requestUrl = requestUrl.replace('{gatewayName}', encodeURIComponent(gatewayName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'PUT'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (connectionEnvelope !== null && connectionEnvelope !== undefined) { + let requestModelMapper = new client.models['VnetGateway']().mapper(); + requestModel = client.serialize(requestModelMapper, connectionEnvelope, 'connectionEnvelope'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(connectionEnvelope, 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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['VnetGateway']().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 Get all routes that are associated with a Virtual Network in an App + * Service plan. + * + * Get all routes that are associated with a Virtual Network in an App Service + * plan. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service plan. + * + * @param {string} vnetName Name of the Virtual Network. + * + * @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. + * + * {array} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _listRoutesForVnet(resourceGroupName, name, vnetName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (vnetName === null || vnetName === undefined || typeof vnetName.valueOf() !== 'string') { + throw new Error('vnetName cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/virtualNetworkConnections/{vnetName}/routes'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{vnetName}', encodeURIComponent(vnetName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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 = { + required: false, + serializedName: 'parsedResponse', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'VnetRouteElementType', + type: { + name: 'Composite', + className: 'VnetRoute' + } + } + } + }; + 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 Get a Virtual Network route in an App Service plan. + * + * Get a Virtual Network route in an App Service plan. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service plan. + * + * @param {string} vnetName Name of the Virtual Network. + * + * @param {string} routeName Name of the Virtual Network route. + * + * @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. + * + * {array} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _getRouteForVnet(resourceGroupName, name, vnetName, routeName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (vnetName === null || vnetName === undefined || typeof vnetName.valueOf() !== 'string') { + throw new Error('vnetName cannot be null or undefined and it must be of type string.'); + } + if (routeName === null || routeName === undefined || typeof routeName.valueOf() !== 'string') { + throw new Error('routeName cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/virtualNetworkConnections/{vnetName}/routes/{routeName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{vnetName}', encodeURIComponent(vnetName)); + requestUrl = requestUrl.replace('{routeName}', encodeURIComponent(routeName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 404) { + 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 = { + required: false, + serializedName: 'parsedResponse', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'VnetRouteElementType', + type: { + name: 'Composite', + className: 'VnetRoute' + } + } + } + }; + 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 Create or update a Virtual Network route in an App Service plan. + * + * Create or update a Virtual Network route in an App Service plan. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service plan. + * + * @param {string} vnetName Name of the Virtual Network. + * + * @param {string} routeName Name of the Virtual Network route. + * + * @param {object} route Definition of the Virtual Network route. + * + * @param {string} [route.startAddress] The starting address for this route. + * This may also include a CIDR notation, in which case the end address must + * not be specified. + * + * @param {string} [route.endAddress] The ending address for this route. If the + * start address is specified in CIDR notation, this must be omitted. + * + * @param {string} [route.routeType] The type of route this is: + * DEFAULT - By default, every app has routes to the local address ranges + * specified by RFC1918 + * INHERITED - Routes inherited from the real Virtual Network routes + * STATIC - Static route set on the app only + * + * These values will be used for syncing an app's routes with those from a + * Virtual Network. Possible values include: 'DEFAULT', 'INHERITED', 'STATIC' + * + * @param {string} [route.kind] Kind of resource. + * + * @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 VnetRoute} 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 _createOrUpdateVnetRoute(resourceGroupName, name, vnetName, routeName, route, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (vnetName === null || vnetName === undefined || typeof vnetName.valueOf() !== 'string') { + throw new Error('vnetName cannot be null or undefined and it must be of type string.'); + } + if (routeName === null || routeName === undefined || typeof routeName.valueOf() !== 'string') { + throw new Error('routeName cannot be null or undefined and it must be of type string.'); + } + if (route === null || route === undefined) { + throw new Error('route cannot be null or undefined.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/virtualNetworkConnections/{vnetName}/routes/{routeName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{vnetName}', encodeURIComponent(vnetName)); + requestUrl = requestUrl.replace('{routeName}', encodeURIComponent(routeName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'PUT'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (route !== null && route !== undefined) { + let requestModelMapper = new client.models['VnetRoute']().mapper(); + requestModel = client.serialize(requestModelMapper, route, 'route'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(route, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 400 && statusCode !== 404) { + 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['VnetRoute']().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 Delete a Virtual Network route in an App Service plan. + * + * Delete a Virtual Network route in an App Service plan. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service plan. + * + * @param {string} vnetName Name of the Virtual Network. + * + * @param {string} routeName Name of the Virtual Network route. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _deleteVnetRoute(resourceGroupName, name, vnetName, routeName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (vnetName === null || vnetName === undefined || typeof vnetName.valueOf() !== 'string') { + throw new Error('vnetName cannot be null or undefined and it must be of type string.'); + } + if (routeName === null || routeName === undefined || typeof routeName.valueOf() !== 'string') { + throw new Error('routeName cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/virtualNetworkConnections/{vnetName}/routes/{routeName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{vnetName}', encodeURIComponent(vnetName)); + requestUrl = requestUrl.replace('{routeName}', encodeURIComponent(routeName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'DELETE'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 404) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + + return callback(null, result, httpRequest, response); + }); +} + +/** + * @summary Create or update a Virtual Network route in an App Service plan. + * + * Create or update a Virtual Network route in an App Service plan. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service plan. + * + * @param {string} vnetName Name of the Virtual Network. + * + * @param {string} routeName Name of the Virtual Network route. + * + * @param {object} route Definition of the Virtual Network route. + * + * @param {string} [route.startAddress] The starting address for this route. + * This may also include a CIDR notation, in which case the end address must + * not be specified. + * + * @param {string} [route.endAddress] The ending address for this route. If the + * start address is specified in CIDR notation, this must be omitted. + * + * @param {string} [route.routeType] The type of route this is: + * DEFAULT - By default, every app has routes to the local address ranges + * specified by RFC1918 + * INHERITED - Routes inherited from the real Virtual Network routes + * STATIC - Static route set on the app only + * + * These values will be used for syncing an app's routes with those from a + * Virtual Network. Possible values include: 'DEFAULT', 'INHERITED', 'STATIC' + * + * @param {string} [route.kind] Kind of resource. + * + * @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 VnetRoute} 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 _updateVnetRoute(resourceGroupName, name, vnetName, routeName, route, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (vnetName === null || vnetName === undefined || typeof vnetName.valueOf() !== 'string') { + throw new Error('vnetName cannot be null or undefined and it must be of type string.'); + } + if (routeName === null || routeName === undefined || typeof routeName.valueOf() !== 'string') { + throw new Error('routeName cannot be null or undefined and it must be of type string.'); + } + if (route === null || route === undefined) { + throw new Error('route cannot be null or undefined.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/virtualNetworkConnections/{vnetName}/routes/{routeName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{vnetName}', encodeURIComponent(vnetName)); + requestUrl = requestUrl.replace('{routeName}', encodeURIComponent(routeName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'PATCH'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (route !== null && route !== undefined) { + let requestModelMapper = new client.models['VnetRoute']().mapper(); + requestModel = client.serialize(requestModelMapper, route, 'route'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(route, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 400 && statusCode !== 404) { + 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['VnetRoute']().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 Reboot a worker machine in an App Service plan. + * + * Reboot a worker machine in an App Service plan. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service plan. + * + * @param {string} workerName Name of worker machine, which typically starts + * with RD. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _rebootWorker(resourceGroupName, name, workerName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (workerName === null || workerName === undefined || typeof workerName.valueOf() !== 'string') { + throw new Error('workerName cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/workers/{workerName}/reboot'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{workerName}', encodeURIComponent(workerName)); + 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]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 204) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + + return callback(null, result, httpRequest, response); + }); +} + +/** + * @summary Creates or updates an App Service Plan. + * + * Creates or updates an App Service Plan. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service plan. + * + * @param {object} appServicePlan Details of the App Service plan. + * + * @param {string} [appServicePlan.workerTierName] Target worker tier assigned + * to the App Service plan. + * + * @param {string} [appServicePlan.adminSiteName] App Service plan + * administration site. + * + * @param {object} [appServicePlan.hostingEnvironmentProfile] Specification for + * the App Service Environment to use for the App Service plan. + * + * @param {string} [appServicePlan.hostingEnvironmentProfile.id] Resource ID of + * the App Service Environment. + * + * @param {boolean} [appServicePlan.perSiteScaling] If true, apps + * assigned to this App Service plan can be scaled independently. + * If false, apps assigned to this App Service plan will scale to + * all instances of the plan. + * + * @param {boolean} [appServicePlan.isSpot] If true, this App + * Service Plan owns spot instances. + * + * @param {date} [appServicePlan.spotExpirationTime] The time when the server + * farm expires. Valid only if it is a spot server farm. + * + * @param {date} [appServicePlan.freeOfferExpirationTime] The time when the + * server farm free offer expires. + * + * @param {boolean} [appServicePlan.reserved] If Linux app service plan + * true, false otherwise. + * + * @param {boolean} [appServicePlan.isXenon] Obsolete: If Hyper-V container app + * service plan true, false otherwise. + * + * @param {boolean} [appServicePlan.hyperV] If Hyper-V container app service + * plan true, false otherwise. + * + * @param {number} [appServicePlan.targetWorkerCount] Scaling worker count. + * + * @param {number} [appServicePlan.targetWorkerSizeId] Scaling worker size ID. + * + * @param {object} [appServicePlan.sku] + * + * @param {string} [appServicePlan.sku.name] Name of the resource SKU. + * + * @param {string} [appServicePlan.sku.tier] Service tier of the resource SKU. + * + * @param {string} [appServicePlan.sku.size] Size specifier of the resource + * SKU. + * + * @param {string} [appServicePlan.sku.family] Family code of the resource SKU. + * + * @param {number} [appServicePlan.sku.capacity] Current number of instances + * assigned to the resource. + * + * @param {object} [appServicePlan.sku.skuCapacity] Min, max, and default scale + * values of the SKU. + * + * @param {number} [appServicePlan.sku.skuCapacity.minimum] Minimum number of + * workers for this App Service plan SKU. + * + * @param {number} [appServicePlan.sku.skuCapacity.maximum] Maximum number of + * workers for this App Service plan SKU. + * + * @param {number} [appServicePlan.sku.skuCapacity.default] Default number of + * workers for this App Service plan SKU. + * + * @param {string} [appServicePlan.sku.skuCapacity.scaleType] Available scale + * configurations for an App Service plan. + * + * @param {array} [appServicePlan.sku.locations] Locations of the SKU. + * + * @param {array} [appServicePlan.sku.capabilities] Capabilities of the SKU, + * e.g., is traffic manager enabled? + * + * @param {string} [appServicePlan.kind] Kind of resource. + * + * @param {string} appServicePlan.location Resource Location. + * + * @param {object} [appServicePlan.tags] Resource tags. + * + * @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 AppServicePlan} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _beginCreateOrUpdate(resourceGroupName, name, appServicePlan, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (appServicePlan === null || appServicePlan === undefined) { + throw new Error('appServicePlan cannot be null or undefined.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'PUT'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (appServicePlan !== null && appServicePlan !== undefined) { + let requestModelMapper = new client.models['AppServicePlan']().mapper(); + requestModel = client.serialize(requestModelMapper, appServicePlan, 'appServicePlan'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(appServicePlan, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 202) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['AppServicePlan']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + // Deserialize Response + if (statusCode === 202) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['AppServicePlan']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError1 = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError1.request = msRest.stripRequest(httpRequest); + deserializationError1.response = msRest.stripResponse(response); + return callback(deserializationError1); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * @summary Get all App Service plans for a subcription. + * + * Get all App Service plans for a subcription. + * + * @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 AppServicePlanCollection} 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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['AppServicePlanCollection']().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 Get all App Service plans in a resource group. + * + * Get all App Service plans in a resource group. + * + * @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 AppServicePlanCollection} 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 _listByResourceGroupNext(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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['AppServicePlanCollection']().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 Get all apps that use a Hybrid Connection in an App Service Plan. + * + * Get all apps that use a Hybrid Connection in an App Service Plan. + * + * @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 ResourceCollection} 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 _listWebAppsByHybridConnectionNext(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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['ResourceCollection']().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 Retrieve all Hybrid Connections in use in an App Service plan. + * + * Retrieve all Hybrid Connections in use in an App Service plan. + * + * @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 HybridConnectionCollection} 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 _listHybridConnectionsNext(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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['HybridConnectionCollection']().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 Get metrics that can be queried for an App Service plan, and their + * definitions. + * + * Get metrics that can be queried for an App Service plan, and their + * definitions. + * + * @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 ResourceMetricDefinitionCollection} 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 _listMetricDefintionsNext(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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['ResourceMetricDefinitionCollection']().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 Get metrics for an App Serice plan. + * + * Get metrics for an App Serice plan. + * + * @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 ResourceMetricCollection} 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 _listMetricsNext(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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['ResourceMetricCollection']().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 Get all apps associated with an App Service plan. + * + * Get all apps associated with an App Service plan. + * + * @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 WebAppCollection} 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 _listWebAppsNext(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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['WebAppCollection']().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 server farm usage information + * + * Gets server farm usage information + * + * @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 CsmUsageQuotaCollection} 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 _listUsagesNext(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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['CsmUsageQuotaCollection']().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 AppServicePlans. */ +class AppServicePlans { + /** + * Create a AppServicePlans. + * @param {WebSiteManagementClient} client Reference to the service client. + */ + constructor(client) { + this.client = client; + this._list = _list; + this._listByResourceGroup = _listByResourceGroup; + this._get = _get; + this._createOrUpdate = _createOrUpdate; + this._deleteMethod = _deleteMethod; + this._update = _update; + this._listCapabilities = _listCapabilities; + this._getHybridConnection = _getHybridConnection; + this._deleteHybridConnection = _deleteHybridConnection; + this._listHybridConnectionKeys = _listHybridConnectionKeys; + this._listWebAppsByHybridConnection = _listWebAppsByHybridConnection; + this._getHybridConnectionPlanLimit = _getHybridConnectionPlanLimit; + this._listHybridConnections = _listHybridConnections; + this._listMetricDefintions = _listMetricDefintions; + this._listMetrics = _listMetrics; + this._restartWebApps = _restartWebApps; + this._listWebApps = _listWebApps; + this._getServerFarmSkus = _getServerFarmSkus; + this._listUsages = _listUsages; + this._listVnets = _listVnets; + this._getVnetFromServerFarm = _getVnetFromServerFarm; + this._getVnetGateway = _getVnetGateway; + this._updateVnetGateway = _updateVnetGateway; + this._listRoutesForVnet = _listRoutesForVnet; + this._getRouteForVnet = _getRouteForVnet; + this._createOrUpdateVnetRoute = _createOrUpdateVnetRoute; + this._deleteVnetRoute = _deleteVnetRoute; + this._updateVnetRoute = _updateVnetRoute; + this._rebootWorker = _rebootWorker; + this._beginCreateOrUpdate = _beginCreateOrUpdate; + this._listNext = _listNext; + this._listByResourceGroupNext = _listByResourceGroupNext; + this._listWebAppsByHybridConnectionNext = _listWebAppsByHybridConnectionNext; + this._listHybridConnectionsNext = _listHybridConnectionsNext; + this._listMetricDefintionsNext = _listMetricDefintionsNext; + this._listMetricsNext = _listMetricsNext; + this._listWebAppsNext = _listWebAppsNext; + this._listUsagesNext = _listUsagesNext; + } + + /** + * @summary Get all App Service plans for a subcription. + * + * Get all App Service plans for a subcription. + * + * @param {object} [options] Optional Parameters. + * + * @param {boolean} [options.detailed] Specify true to return all + * App Service plan properties. The default is false, which + * returns a subset of the properties. + * Retrieval of all properties may increase the API latency. + * + * @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 Get all App Service plans for a subcription. + * + * Get all App Service plans for a subcription. + * + * @param {object} [options] Optional Parameters. + * + * @param {boolean} [options.detailed] Specify true to return all + * App Service plan properties. The default is false, which + * returns a subset of the properties. + * Retrieval of all properties may increase the API latency. + * + * @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 {AppServicePlanCollection} - 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 AppServicePlanCollection} 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 Get all App Service plans in a resource group. + * + * Get all App Service plans in a resource group. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @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. + */ + listByResourceGroupWithHttpOperationResponse(resourceGroupName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listByResourceGroup(resourceGroupName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Get all App Service plans in a resource group. + * + * Get all App Service plans in a resource group. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @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 {AppServicePlanCollection} - 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 AppServicePlanCollection} 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. + */ + listByResourceGroup(resourceGroupName, 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._listByResourceGroup(resourceGroupName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listByResourceGroup(resourceGroupName, options, optionalCallback); + } + } + + /** + * @summary Get an App Service plan. + * + * Get an App Service plan. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service plan. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + getWithHttpOperationResponse(resourceGroupName, name, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._get(resourceGroupName, name, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Get an App Service plan. + * + * Get an App Service plan. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service plan. + * + * @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 {AppServicePlan} - 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 AppServicePlan} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + get(resourceGroupName, name, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._get(resourceGroupName, name, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._get(resourceGroupName, name, options, optionalCallback); + } + } + + /** + * @summary Creates or updates an App Service Plan. + * + * Creates or updates an App Service Plan. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service plan. + * + * @param {object} appServicePlan Details of the App Service plan. + * + * @param {string} [appServicePlan.workerTierName] Target worker tier assigned + * to the App Service plan. + * + * @param {string} [appServicePlan.adminSiteName] App Service plan + * administration site. + * + * @param {object} [appServicePlan.hostingEnvironmentProfile] Specification for + * the App Service Environment to use for the App Service plan. + * + * @param {string} [appServicePlan.hostingEnvironmentProfile.id] Resource ID of + * the App Service Environment. + * + * @param {boolean} [appServicePlan.perSiteScaling] If true, apps + * assigned to this App Service plan can be scaled independently. + * If false, apps assigned to this App Service plan will scale to + * all instances of the plan. + * + * @param {boolean} [appServicePlan.isSpot] If true, this App + * Service Plan owns spot instances. + * + * @param {date} [appServicePlan.spotExpirationTime] The time when the server + * farm expires. Valid only if it is a spot server farm. + * + * @param {date} [appServicePlan.freeOfferExpirationTime] The time when the + * server farm free offer expires. + * + * @param {boolean} [appServicePlan.reserved] If Linux app service plan + * true, false otherwise. + * + * @param {boolean} [appServicePlan.isXenon] Obsolete: If Hyper-V container app + * service plan true, false otherwise. + * + * @param {boolean} [appServicePlan.hyperV] If Hyper-V container app service + * plan true, false otherwise. + * + * @param {number} [appServicePlan.targetWorkerCount] Scaling worker count. + * + * @param {number} [appServicePlan.targetWorkerSizeId] Scaling worker size ID. + * + * @param {object} [appServicePlan.sku] + * + * @param {string} [appServicePlan.sku.name] Name of the resource SKU. + * + * @param {string} [appServicePlan.sku.tier] Service tier of the resource SKU. + * + * @param {string} [appServicePlan.sku.size] Size specifier of the resource + * SKU. + * + * @param {string} [appServicePlan.sku.family] Family code of the resource SKU. + * + * @param {number} [appServicePlan.sku.capacity] Current number of instances + * assigned to the resource. + * + * @param {object} [appServicePlan.sku.skuCapacity] Min, max, and default scale + * values of the SKU. + * + * @param {number} [appServicePlan.sku.skuCapacity.minimum] Minimum number of + * workers for this App Service plan SKU. + * + * @param {number} [appServicePlan.sku.skuCapacity.maximum] Maximum number of + * workers for this App Service plan SKU. + * + * @param {number} [appServicePlan.sku.skuCapacity.default] Default number of + * workers for this App Service plan SKU. + * + * @param {string} [appServicePlan.sku.skuCapacity.scaleType] Available scale + * configurations for an App Service plan. + * + * @param {array} [appServicePlan.sku.locations] Locations of the SKU. + * + * @param {array} [appServicePlan.sku.capabilities] Capabilities of the SKU, + * e.g., is traffic manager enabled? + * + * @param {string} [appServicePlan.kind] Kind of resource. + * + * @param {string} appServicePlan.location Resource Location. + * + * @param {object} [appServicePlan.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + createOrUpdateWithHttpOperationResponse(resourceGroupName, name, appServicePlan, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._createOrUpdate(resourceGroupName, name, appServicePlan, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Creates or updates an App Service Plan. + * + * Creates or updates an App Service Plan. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service plan. + * + * @param {object} appServicePlan Details of the App Service plan. + * + * @param {string} [appServicePlan.workerTierName] Target worker tier assigned + * to the App Service plan. + * + * @param {string} [appServicePlan.adminSiteName] App Service plan + * administration site. + * + * @param {object} [appServicePlan.hostingEnvironmentProfile] Specification for + * the App Service Environment to use for the App Service plan. + * + * @param {string} [appServicePlan.hostingEnvironmentProfile.id] Resource ID of + * the App Service Environment. + * + * @param {boolean} [appServicePlan.perSiteScaling] If true, apps + * assigned to this App Service plan can be scaled independently. + * If false, apps assigned to this App Service plan will scale to + * all instances of the plan. + * + * @param {boolean} [appServicePlan.isSpot] If true, this App + * Service Plan owns spot instances. + * + * @param {date} [appServicePlan.spotExpirationTime] The time when the server + * farm expires. Valid only if it is a spot server farm. + * + * @param {date} [appServicePlan.freeOfferExpirationTime] The time when the + * server farm free offer expires. + * + * @param {boolean} [appServicePlan.reserved] If Linux app service plan + * true, false otherwise. + * + * @param {boolean} [appServicePlan.isXenon] Obsolete: If Hyper-V container app + * service plan true, false otherwise. + * + * @param {boolean} [appServicePlan.hyperV] If Hyper-V container app service + * plan true, false otherwise. + * + * @param {number} [appServicePlan.targetWorkerCount] Scaling worker count. + * + * @param {number} [appServicePlan.targetWorkerSizeId] Scaling worker size ID. + * + * @param {object} [appServicePlan.sku] + * + * @param {string} [appServicePlan.sku.name] Name of the resource SKU. + * + * @param {string} [appServicePlan.sku.tier] Service tier of the resource SKU. + * + * @param {string} [appServicePlan.sku.size] Size specifier of the resource + * SKU. + * + * @param {string} [appServicePlan.sku.family] Family code of the resource SKU. + * + * @param {number} [appServicePlan.sku.capacity] Current number of instances + * assigned to the resource. + * + * @param {object} [appServicePlan.sku.skuCapacity] Min, max, and default scale + * values of the SKU. + * + * @param {number} [appServicePlan.sku.skuCapacity.minimum] Minimum number of + * workers for this App Service plan SKU. + * + * @param {number} [appServicePlan.sku.skuCapacity.maximum] Maximum number of + * workers for this App Service plan SKU. + * + * @param {number} [appServicePlan.sku.skuCapacity.default] Default number of + * workers for this App Service plan SKU. + * + * @param {string} [appServicePlan.sku.skuCapacity.scaleType] Available scale + * configurations for an App Service plan. + * + * @param {array} [appServicePlan.sku.locations] Locations of the SKU. + * + * @param {array} [appServicePlan.sku.capabilities] Capabilities of the SKU, + * e.g., is traffic manager enabled? + * + * @param {string} [appServicePlan.kind] Kind of resource. + * + * @param {string} appServicePlan.location Resource Location. + * + * @param {object} [appServicePlan.tags] Resource tags. + * + * @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 {AppServicePlan} - 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 AppServicePlan} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + createOrUpdate(resourceGroupName, name, appServicePlan, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._createOrUpdate(resourceGroupName, name, appServicePlan, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._createOrUpdate(resourceGroupName, name, appServicePlan, options, optionalCallback); + } + } + + /** + * @summary Delete an App Service plan. + * + * Delete an App Service plan. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service plan. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + deleteMethodWithHttpOperationResponse(resourceGroupName, name, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._deleteMethod(resourceGroupName, name, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Delete an App Service plan. + * + * Delete an App Service plan. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service plan. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + deleteMethod(resourceGroupName, name, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._deleteMethod(resourceGroupName, name, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._deleteMethod(resourceGroupName, name, options, optionalCallback); + } + } + + /** + * @summary Creates or updates an App Service Plan. + * + * Creates or updates an App Service Plan. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service plan. + * + * @param {object} appServicePlan Details of the App Service plan. + * + * @param {string} [appServicePlan.workerTierName] Target worker tier assigned + * to the App Service plan. + * + * @param {string} [appServicePlan.adminSiteName] App Service plan + * administration site. + * + * @param {object} [appServicePlan.hostingEnvironmentProfile] Specification for + * the App Service Environment to use for the App Service plan. + * + * @param {string} [appServicePlan.hostingEnvironmentProfile.id] Resource ID of + * the App Service Environment. + * + * @param {boolean} [appServicePlan.perSiteScaling] If true, apps + * assigned to this App Service plan can be scaled independently. + * If false, apps assigned to this App Service plan will scale to + * all instances of the plan. + * + * @param {boolean} [appServicePlan.isSpot] If true, this App + * Service Plan owns spot instances. + * + * @param {date} [appServicePlan.spotExpirationTime] The time when the server + * farm expires. Valid only if it is a spot server farm. + * + * @param {date} [appServicePlan.freeOfferExpirationTime] The time when the + * server farm free offer expires. + * + * @param {boolean} [appServicePlan.reserved] If Linux app service plan + * true, false otherwise. + * + * @param {boolean} [appServicePlan.isXenon] Obsolete: If Hyper-V container app + * service plan true, false otherwise. + * + * @param {boolean} [appServicePlan.hyperV] If Hyper-V container app service + * plan true, false otherwise. + * + * @param {number} [appServicePlan.targetWorkerCount] Scaling worker count. + * + * @param {number} [appServicePlan.targetWorkerSizeId] Scaling worker size ID. + * + * @param {string} [appServicePlan.kind] Kind of resource. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + updateWithHttpOperationResponse(resourceGroupName, name, appServicePlan, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._update(resourceGroupName, name, appServicePlan, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Creates or updates an App Service Plan. + * + * Creates or updates an App Service Plan. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service plan. + * + * @param {object} appServicePlan Details of the App Service plan. + * + * @param {string} [appServicePlan.workerTierName] Target worker tier assigned + * to the App Service plan. + * + * @param {string} [appServicePlan.adminSiteName] App Service plan + * administration site. + * + * @param {object} [appServicePlan.hostingEnvironmentProfile] Specification for + * the App Service Environment to use for the App Service plan. + * + * @param {string} [appServicePlan.hostingEnvironmentProfile.id] Resource ID of + * the App Service Environment. + * + * @param {boolean} [appServicePlan.perSiteScaling] If true, apps + * assigned to this App Service plan can be scaled independently. + * If false, apps assigned to this App Service plan will scale to + * all instances of the plan. + * + * @param {boolean} [appServicePlan.isSpot] If true, this App + * Service Plan owns spot instances. + * + * @param {date} [appServicePlan.spotExpirationTime] The time when the server + * farm expires. Valid only if it is a spot server farm. + * + * @param {date} [appServicePlan.freeOfferExpirationTime] The time when the + * server farm free offer expires. + * + * @param {boolean} [appServicePlan.reserved] If Linux app service plan + * true, false otherwise. + * + * @param {boolean} [appServicePlan.isXenon] Obsolete: If Hyper-V container app + * service plan true, false otherwise. + * + * @param {boolean} [appServicePlan.hyperV] If Hyper-V container app service + * plan true, false otherwise. + * + * @param {number} [appServicePlan.targetWorkerCount] Scaling worker count. + * + * @param {number} [appServicePlan.targetWorkerSizeId] Scaling worker size ID. + * + * @param {string} [appServicePlan.kind] Kind of resource. + * + * @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 {AppServicePlan} - 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 AppServicePlan} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + update(resourceGroupName, name, appServicePlan, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._update(resourceGroupName, name, appServicePlan, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._update(resourceGroupName, name, appServicePlan, options, optionalCallback); + } + } + + /** + * @summary List all capabilities of an App Service plan. + * + * List all capabilities of an App Service plan. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service plan. + * + * @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. + */ + listCapabilitiesWithHttpOperationResponse(resourceGroupName, name, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listCapabilities(resourceGroupName, name, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary List all capabilities of an App Service plan. + * + * List all capabilities of an App Service plan. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service plan. + * + * @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 {Array} - 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. + * + * {array} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listCapabilities(resourceGroupName, name, 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._listCapabilities(resourceGroupName, name, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listCapabilities(resourceGroupName, name, options, optionalCallback); + } + } + + /** + * @summary Retrieve a Hybrid Connection in use in an App Service plan. + * + * Retrieve a Hybrid Connection in use in an App Service plan. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service plan. + * + * @param {string} namespaceName Name of the Service Bus namespace. + * + * @param {string} relayName Name of the Service Bus relay. + * + * @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. + */ + getHybridConnectionWithHttpOperationResponse(resourceGroupName, name, namespaceName, relayName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._getHybridConnection(resourceGroupName, name, namespaceName, relayName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Retrieve a Hybrid Connection in use in an App Service plan. + * + * Retrieve a Hybrid Connection in use in an App Service plan. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service plan. + * + * @param {string} namespaceName Name of the Service Bus namespace. + * + * @param {string} relayName Name of the Service Bus relay. + * + * @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 {HybridConnection} - 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 HybridConnection} 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. + */ + getHybridConnection(resourceGroupName, name, namespaceName, relayName, 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._getHybridConnection(resourceGroupName, name, namespaceName, relayName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getHybridConnection(resourceGroupName, name, namespaceName, relayName, options, optionalCallback); + } + } + + /** + * @summary Delete a Hybrid Connection in use in an App Service plan. + * + * Delete a Hybrid Connection in use in an App Service plan. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service plan. + * + * @param {string} namespaceName Name of the Service Bus namespace. + * + * @param {string} relayName Name of the Service Bus relay. + * + * @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. + */ + deleteHybridConnectionWithHttpOperationResponse(resourceGroupName, name, namespaceName, relayName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._deleteHybridConnection(resourceGroupName, name, namespaceName, relayName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Delete a Hybrid Connection in use in an App Service plan. + * + * Delete a Hybrid Connection in use in an App Service plan. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service plan. + * + * @param {string} namespaceName Name of the Service Bus namespace. + * + * @param {string} relayName Name of the Service Bus relay. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + deleteHybridConnection(resourceGroupName, name, namespaceName, relayName, 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._deleteHybridConnection(resourceGroupName, name, namespaceName, relayName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._deleteHybridConnection(resourceGroupName, name, namespaceName, relayName, options, optionalCallback); + } + } + + /** + * @summary Get the send key name and value of a Hybrid Connection. + * + * Get the send key name and value of a Hybrid Connection. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service plan. + * + * @param {string} namespaceName The name of the Service Bus namespace. + * + * @param {string} relayName The name of the Service Bus relay. + * + * @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. + */ + listHybridConnectionKeysWithHttpOperationResponse(resourceGroupName, name, namespaceName, relayName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listHybridConnectionKeys(resourceGroupName, name, namespaceName, relayName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Get the send key name and value of a Hybrid Connection. + * + * Get the send key name and value of a Hybrid Connection. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service plan. + * + * @param {string} namespaceName The name of the Service Bus namespace. + * + * @param {string} relayName The name of the Service Bus relay. + * + * @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 {HybridConnectionKey} - 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 HybridConnectionKey} 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. + */ + listHybridConnectionKeys(resourceGroupName, name, namespaceName, relayName, 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._listHybridConnectionKeys(resourceGroupName, name, namespaceName, relayName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listHybridConnectionKeys(resourceGroupName, name, namespaceName, relayName, options, optionalCallback); + } + } + + /** + * @summary Get all apps that use a Hybrid Connection in an App Service Plan. + * + * Get all apps that use a Hybrid Connection in an App Service Plan. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service plan. + * + * @param {string} namespaceName Name of the Hybrid Connection namespace. + * + * @param {string} relayName Name of the Hybrid Connection relay. + * + * @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. + */ + listWebAppsByHybridConnectionWithHttpOperationResponse(resourceGroupName, name, namespaceName, relayName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listWebAppsByHybridConnection(resourceGroupName, name, namespaceName, relayName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Get all apps that use a Hybrid Connection in an App Service Plan. + * + * Get all apps that use a Hybrid Connection in an App Service Plan. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service plan. + * + * @param {string} namespaceName Name of the Hybrid Connection namespace. + * + * @param {string} relayName Name of the Hybrid Connection relay. + * + * @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 {ResourceCollection} - 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 ResourceCollection} 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. + */ + listWebAppsByHybridConnection(resourceGroupName, name, namespaceName, relayName, 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._listWebAppsByHybridConnection(resourceGroupName, name, namespaceName, relayName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listWebAppsByHybridConnection(resourceGroupName, name, namespaceName, relayName, options, optionalCallback); + } + } + + /** + * @summary Get the maximum number of Hybrid Connections allowed in an App + * Service plan. + * + * Get the maximum number of Hybrid Connections allowed in an App Service plan. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service plan. + * + * @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. + */ + getHybridConnectionPlanLimitWithHttpOperationResponse(resourceGroupName, name, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._getHybridConnectionPlanLimit(resourceGroupName, name, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Get the maximum number of Hybrid Connections allowed in an App + * Service plan. + * + * Get the maximum number of Hybrid Connections allowed in an App Service plan. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service plan. + * + * @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 {HybridConnectionLimits} - 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 HybridConnectionLimits} 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. + */ + getHybridConnectionPlanLimit(resourceGroupName, name, 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._getHybridConnectionPlanLimit(resourceGroupName, name, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getHybridConnectionPlanLimit(resourceGroupName, name, options, optionalCallback); + } + } + + /** + * @summary Retrieve all Hybrid Connections in use in an App Service plan. + * + * Retrieve all Hybrid Connections in use in an App Service plan. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service plan. + * + * @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. + */ + listHybridConnectionsWithHttpOperationResponse(resourceGroupName, name, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listHybridConnections(resourceGroupName, name, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Retrieve all Hybrid Connections in use in an App Service plan. + * + * Retrieve all Hybrid Connections in use in an App Service plan. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service plan. + * + * @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 {HybridConnectionCollection} - 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 HybridConnectionCollection} 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. + */ + listHybridConnections(resourceGroupName, name, 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._listHybridConnections(resourceGroupName, name, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listHybridConnections(resourceGroupName, name, options, optionalCallback); + } + } + + /** + * @summary Get metrics that can be queried for an App Service plan, and their + * definitions. + * + * Get metrics that can be queried for an App Service plan, and their + * definitions. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service plan. + * + * @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. + */ + listMetricDefintionsWithHttpOperationResponse(resourceGroupName, name, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listMetricDefintions(resourceGroupName, name, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Get metrics that can be queried for an App Service plan, and their + * definitions. + * + * Get metrics that can be queried for an App Service plan, and their + * definitions. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service plan. + * + * @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 {ResourceMetricDefinitionCollection} - 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 ResourceMetricDefinitionCollection} 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. + */ + listMetricDefintions(resourceGroupName, name, 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._listMetricDefintions(resourceGroupName, name, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listMetricDefintions(resourceGroupName, name, options, optionalCallback); + } + } + + /** + * @summary Get metrics for an App Serice plan. + * + * Get metrics for an App Serice plan. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service plan. + * + * @param {object} [options] Optional Parameters. + * + * @param {boolean} [options.details] Specify true to include + * instance details. The default is false. + * + * @param {string} [options.filter] Return only usages/metrics specified in the + * filter. Filter conforms to odata syntax. Example: $filter=(name.value eq + * 'Metric1' or name.value eq 'Metric2') and startTime eq 2014-01-01T00:00:00Z + * and endTime eq 2014-12-31T23:59:59Z and timeGrain eq + * duration'[Hour|Minute|Day]'. + * + * @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. + */ + listMetricsWithHttpOperationResponse(resourceGroupName, name, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listMetrics(resourceGroupName, name, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Get metrics for an App Serice plan. + * + * Get metrics for an App Serice plan. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service plan. + * + * @param {object} [options] Optional Parameters. + * + * @param {boolean} [options.details] Specify true to include + * instance details. The default is false. + * + * @param {string} [options.filter] Return only usages/metrics specified in the + * filter. Filter conforms to odata syntax. Example: $filter=(name.value eq + * 'Metric1' or name.value eq 'Metric2') and startTime eq 2014-01-01T00:00:00Z + * and endTime eq 2014-12-31T23:59:59Z and timeGrain eq + * duration'[Hour|Minute|Day]'. + * + * @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 {ResourceMetricCollection} - 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 ResourceMetricCollection} 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. + */ + listMetrics(resourceGroupName, name, 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._listMetrics(resourceGroupName, name, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listMetrics(resourceGroupName, name, options, optionalCallback); + } + } + + /** + * @summary Restart all apps in an App Service plan. + * + * Restart all apps in an App Service plan. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service plan. + * + * @param {object} [options] Optional Parameters. + * + * @param {boolean} [options.softRestart] Specify true to performa + * a soft restart, applies the configuration settings and restarts the apps if + * necessary. The default is false, which always restarts and + * reprovisions the apps + * + * @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. + */ + restartWebAppsWithHttpOperationResponse(resourceGroupName, name, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._restartWebApps(resourceGroupName, name, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Restart all apps in an App Service plan. + * + * Restart all apps in an App Service plan. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service plan. + * + * @param {object} [options] Optional Parameters. + * + * @param {boolean} [options.softRestart] Specify true to performa + * a soft restart, applies the configuration settings and restarts the apps if + * necessary. The default is false, which always restarts and + * reprovisions the apps + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + restartWebApps(resourceGroupName, name, 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._restartWebApps(resourceGroupName, name, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._restartWebApps(resourceGroupName, name, options, optionalCallback); + } + } + + /** + * @summary Get all apps associated with an App Service plan. + * + * Get all apps associated with an App Service plan. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service plan. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.skipToken] Skip to a web app in the list of webapps + * associated with app service plan. If specified, the resulting list will + * contain web apps starting from (including) the skipToken. Otherwise, the + * resulting list contains web apps from the start of the list + * + * @param {string} [options.filter] Supported filter: $filter=state eq running. + * Returns only web apps that are currently running + * + * @param {string} [options.top] List page size. If specified, results are + * paged. + * + * @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. + */ + listWebAppsWithHttpOperationResponse(resourceGroupName, name, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listWebApps(resourceGroupName, name, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Get all apps associated with an App Service plan. + * + * Get all apps associated with an App Service plan. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service plan. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.skipToken] Skip to a web app in the list of webapps + * associated with app service plan. If specified, the resulting list will + * contain web apps starting from (including) the skipToken. Otherwise, the + * resulting list contains web apps from the start of the list + * + * @param {string} [options.filter] Supported filter: $filter=state eq running. + * Returns only web apps that are currently running + * + * @param {string} [options.top] List page size. If specified, results are + * paged. + * + * @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 {WebAppCollection} - 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 WebAppCollection} 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. + */ + listWebApps(resourceGroupName, name, 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._listWebApps(resourceGroupName, name, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listWebApps(resourceGroupName, name, options, optionalCallback); + } + } + + /** + * @summary Gets all selectable sku's for a given App Service Plan + * + * Gets all selectable sku's for a given App Service Plan + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of App Service Plan + * + * @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. + */ + getServerFarmSkusWithHttpOperationResponse(resourceGroupName, name, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._getServerFarmSkus(resourceGroupName, name, 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 all selectable sku's for a given App Service Plan + * + * Gets all selectable sku's for a given App Service Plan + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of App Service Plan + * + * @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 {Object} - 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. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + getServerFarmSkus(resourceGroupName, name, 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._getServerFarmSkus(resourceGroupName, name, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getServerFarmSkus(resourceGroupName, name, options, optionalCallback); + } + } + + /** + * @summary Gets server farm usage information + * + * Gets server farm usage information + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of App Service Plan + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.filter] Return only usages/metrics specified in the + * filter. Filter conforms to odata syntax. Example: $filter=(name.value eq + * 'Metric1' or name.value eq 'Metric2'). + * + * @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. + */ + listUsagesWithHttpOperationResponse(resourceGroupName, name, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listUsages(resourceGroupName, name, 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 server farm usage information + * + * Gets server farm usage information + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of App Service Plan + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.filter] Return only usages/metrics specified in the + * filter. Filter conforms to odata syntax. Example: $filter=(name.value eq + * 'Metric1' or name.value eq 'Metric2'). + * + * @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 {CsmUsageQuotaCollection} - 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 CsmUsageQuotaCollection} 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. + */ + listUsages(resourceGroupName, name, 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._listUsages(resourceGroupName, name, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listUsages(resourceGroupName, name, options, optionalCallback); + } + } + + /** + * @summary Get all Virtual Networks associated with an App Service plan. + * + * Get all Virtual Networks associated with an App Service plan. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service plan. + * + * @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. + */ + listVnetsWithHttpOperationResponse(resourceGroupName, name, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listVnets(resourceGroupName, name, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Get all Virtual Networks associated with an App Service plan. + * + * Get all Virtual Networks associated with an App Service plan. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service plan. + * + * @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 {Array} - 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. + * + * {array} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listVnets(resourceGroupName, name, 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._listVnets(resourceGroupName, name, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listVnets(resourceGroupName, name, options, optionalCallback); + } + } + + /** + * @summary Get a Virtual Network associated with an App Service plan. + * + * Get a Virtual Network associated with an App Service plan. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service plan. + * + * @param {string} vnetName Name of the Virtual Network. + * + * @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. + */ + getVnetFromServerFarmWithHttpOperationResponse(resourceGroupName, name, vnetName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._getVnetFromServerFarm(resourceGroupName, name, vnetName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Get a Virtual Network associated with an App Service plan. + * + * Get a Virtual Network associated with an App Service plan. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service plan. + * + * @param {string} vnetName Name of the Virtual Network. + * + * @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 {VnetInfo} - 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 VnetInfo} 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. + */ + getVnetFromServerFarm(resourceGroupName, name, vnetName, 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._getVnetFromServerFarm(resourceGroupName, name, vnetName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getVnetFromServerFarm(resourceGroupName, name, vnetName, options, optionalCallback); + } + } + + /** + * @summary Get a Virtual Network gateway. + * + * Get a Virtual Network gateway. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service plan. + * + * @param {string} vnetName Name of the Virtual Network. + * + * @param {string} gatewayName Name of the gateway. Only the 'primary' gateway + * is supported. + * + * @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. + */ + getVnetGatewayWithHttpOperationResponse(resourceGroupName, name, vnetName, gatewayName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._getVnetGateway(resourceGroupName, name, vnetName, gatewayName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Get a Virtual Network gateway. + * + * Get a Virtual Network gateway. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service plan. + * + * @param {string} vnetName Name of the Virtual Network. + * + * @param {string} gatewayName Name of the gateway. Only the 'primary' gateway + * is supported. + * + * @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 {VnetGateway} - 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 VnetGateway} 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. + */ + getVnetGateway(resourceGroupName, name, vnetName, gatewayName, 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._getVnetGateway(resourceGroupName, name, vnetName, gatewayName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getVnetGateway(resourceGroupName, name, vnetName, gatewayName, options, optionalCallback); + } + } + + /** + * @summary Update a Virtual Network gateway. + * + * Update a Virtual Network gateway. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service plan. + * + * @param {string} vnetName Name of the Virtual Network. + * + * @param {string} gatewayName Name of the gateway. Only the 'primary' gateway + * is supported. + * + * @param {object} connectionEnvelope Definition of the gateway. + * + * @param {string} [connectionEnvelope.vnetName] The Virtual Network name. + * + * @param {string} connectionEnvelope.vpnPackageUri The URI where the VPN + * package can be downloaded. + * + * @param {string} [connectionEnvelope.kind] Kind of resource. + * + * @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. + */ + updateVnetGatewayWithHttpOperationResponse(resourceGroupName, name, vnetName, gatewayName, connectionEnvelope, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._updateVnetGateway(resourceGroupName, name, vnetName, gatewayName, connectionEnvelope, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Update a Virtual Network gateway. + * + * Update a Virtual Network gateway. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service plan. + * + * @param {string} vnetName Name of the Virtual Network. + * + * @param {string} gatewayName Name of the gateway. Only the 'primary' gateway + * is supported. + * + * @param {object} connectionEnvelope Definition of the gateway. + * + * @param {string} [connectionEnvelope.vnetName] The Virtual Network name. + * + * @param {string} connectionEnvelope.vpnPackageUri The URI where the VPN + * package can be downloaded. + * + * @param {string} [connectionEnvelope.kind] Kind of resource. + * + * @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 {VnetGateway} - 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 VnetGateway} 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. + */ + updateVnetGateway(resourceGroupName, name, vnetName, gatewayName, connectionEnvelope, 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._updateVnetGateway(resourceGroupName, name, vnetName, gatewayName, connectionEnvelope, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._updateVnetGateway(resourceGroupName, name, vnetName, gatewayName, connectionEnvelope, options, optionalCallback); + } + } + + /** + * @summary Get all routes that are associated with a Virtual Network in an App + * Service plan. + * + * Get all routes that are associated with a Virtual Network in an App Service + * plan. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service plan. + * + * @param {string} vnetName Name of the Virtual Network. + * + * @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. + */ + listRoutesForVnetWithHttpOperationResponse(resourceGroupName, name, vnetName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listRoutesForVnet(resourceGroupName, name, vnetName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Get all routes that are associated with a Virtual Network in an App + * Service plan. + * + * Get all routes that are associated with a Virtual Network in an App Service + * plan. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service plan. + * + * @param {string} vnetName Name of the Virtual Network. + * + * @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 {Array} - 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. + * + * {array} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listRoutesForVnet(resourceGroupName, name, vnetName, 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._listRoutesForVnet(resourceGroupName, name, vnetName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listRoutesForVnet(resourceGroupName, name, vnetName, options, optionalCallback); + } + } + + /** + * @summary Get a Virtual Network route in an App Service plan. + * + * Get a Virtual Network route in an App Service plan. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service plan. + * + * @param {string} vnetName Name of the Virtual Network. + * + * @param {string} routeName Name of the Virtual Network route. + * + * @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. + */ + getRouteForVnetWithHttpOperationResponse(resourceGroupName, name, vnetName, routeName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._getRouteForVnet(resourceGroupName, name, vnetName, routeName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Get a Virtual Network route in an App Service plan. + * + * Get a Virtual Network route in an App Service plan. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service plan. + * + * @param {string} vnetName Name of the Virtual Network. + * + * @param {string} routeName Name of the Virtual Network route. + * + * @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 {Array} - 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. + * + * {array} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + getRouteForVnet(resourceGroupName, name, vnetName, routeName, 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._getRouteForVnet(resourceGroupName, name, vnetName, routeName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getRouteForVnet(resourceGroupName, name, vnetName, routeName, options, optionalCallback); + } + } + + /** + * @summary Create or update a Virtual Network route in an App Service plan. + * + * Create or update a Virtual Network route in an App Service plan. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service plan. + * + * @param {string} vnetName Name of the Virtual Network. + * + * @param {string} routeName Name of the Virtual Network route. + * + * @param {object} route Definition of the Virtual Network route. + * + * @param {string} [route.startAddress] The starting address for this route. + * This may also include a CIDR notation, in which case the end address must + * not be specified. + * + * @param {string} [route.endAddress] The ending address for this route. If the + * start address is specified in CIDR notation, this must be omitted. + * + * @param {string} [route.routeType] The type of route this is: + * DEFAULT - By default, every app has routes to the local address ranges + * specified by RFC1918 + * INHERITED - Routes inherited from the real Virtual Network routes + * STATIC - Static route set on the app only + * + * These values will be used for syncing an app's routes with those from a + * Virtual Network. Possible values include: 'DEFAULT', 'INHERITED', 'STATIC' + * + * @param {string} [route.kind] Kind of resource. + * + * @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. + */ + createOrUpdateVnetRouteWithHttpOperationResponse(resourceGroupName, name, vnetName, routeName, route, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._createOrUpdateVnetRoute(resourceGroupName, name, vnetName, routeName, route, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Create or update a Virtual Network route in an App Service plan. + * + * Create or update a Virtual Network route in an App Service plan. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service plan. + * + * @param {string} vnetName Name of the Virtual Network. + * + * @param {string} routeName Name of the Virtual Network route. + * + * @param {object} route Definition of the Virtual Network route. + * + * @param {string} [route.startAddress] The starting address for this route. + * This may also include a CIDR notation, in which case the end address must + * not be specified. + * + * @param {string} [route.endAddress] The ending address for this route. If the + * start address is specified in CIDR notation, this must be omitted. + * + * @param {string} [route.routeType] The type of route this is: + * DEFAULT - By default, every app has routes to the local address ranges + * specified by RFC1918 + * INHERITED - Routes inherited from the real Virtual Network routes + * STATIC - Static route set on the app only + * + * These values will be used for syncing an app's routes with those from a + * Virtual Network. Possible values include: 'DEFAULT', 'INHERITED', 'STATIC' + * + * @param {string} [route.kind] Kind of resource. + * + * @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 {VnetRoute} - 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 VnetRoute} 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. + */ + createOrUpdateVnetRoute(resourceGroupName, name, vnetName, routeName, route, 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._createOrUpdateVnetRoute(resourceGroupName, name, vnetName, routeName, route, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._createOrUpdateVnetRoute(resourceGroupName, name, vnetName, routeName, route, options, optionalCallback); + } + } + + /** + * @summary Delete a Virtual Network route in an App Service plan. + * + * Delete a Virtual Network route in an App Service plan. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service plan. + * + * @param {string} vnetName Name of the Virtual Network. + * + * @param {string} routeName Name of the Virtual Network route. + * + * @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. + */ + deleteVnetRouteWithHttpOperationResponse(resourceGroupName, name, vnetName, routeName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._deleteVnetRoute(resourceGroupName, name, vnetName, routeName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Delete a Virtual Network route in an App Service plan. + * + * Delete a Virtual Network route in an App Service plan. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service plan. + * + * @param {string} vnetName Name of the Virtual Network. + * + * @param {string} routeName Name of the Virtual Network route. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + deleteVnetRoute(resourceGroupName, name, vnetName, routeName, 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._deleteVnetRoute(resourceGroupName, name, vnetName, routeName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._deleteVnetRoute(resourceGroupName, name, vnetName, routeName, options, optionalCallback); + } + } + + /** + * @summary Create or update a Virtual Network route in an App Service plan. + * + * Create or update a Virtual Network route in an App Service plan. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service plan. + * + * @param {string} vnetName Name of the Virtual Network. + * + * @param {string} routeName Name of the Virtual Network route. + * + * @param {object} route Definition of the Virtual Network route. + * + * @param {string} [route.startAddress] The starting address for this route. + * This may also include a CIDR notation, in which case the end address must + * not be specified. + * + * @param {string} [route.endAddress] The ending address for this route. If the + * start address is specified in CIDR notation, this must be omitted. + * + * @param {string} [route.routeType] The type of route this is: + * DEFAULT - By default, every app has routes to the local address ranges + * specified by RFC1918 + * INHERITED - Routes inherited from the real Virtual Network routes + * STATIC - Static route set on the app only + * + * These values will be used for syncing an app's routes with those from a + * Virtual Network. Possible values include: 'DEFAULT', 'INHERITED', 'STATIC' + * + * @param {string} [route.kind] Kind of resource. + * + * @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. + */ + updateVnetRouteWithHttpOperationResponse(resourceGroupName, name, vnetName, routeName, route, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._updateVnetRoute(resourceGroupName, name, vnetName, routeName, route, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Create or update a Virtual Network route in an App Service plan. + * + * Create or update a Virtual Network route in an App Service plan. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service plan. + * + * @param {string} vnetName Name of the Virtual Network. + * + * @param {string} routeName Name of the Virtual Network route. + * + * @param {object} route Definition of the Virtual Network route. + * + * @param {string} [route.startAddress] The starting address for this route. + * This may also include a CIDR notation, in which case the end address must + * not be specified. + * + * @param {string} [route.endAddress] The ending address for this route. If the + * start address is specified in CIDR notation, this must be omitted. + * + * @param {string} [route.routeType] The type of route this is: + * DEFAULT - By default, every app has routes to the local address ranges + * specified by RFC1918 + * INHERITED - Routes inherited from the real Virtual Network routes + * STATIC - Static route set on the app only + * + * These values will be used for syncing an app's routes with those from a + * Virtual Network. Possible values include: 'DEFAULT', 'INHERITED', 'STATIC' + * + * @param {string} [route.kind] Kind of resource. + * + * @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 {VnetRoute} - 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 VnetRoute} 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. + */ + updateVnetRoute(resourceGroupName, name, vnetName, routeName, route, 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._updateVnetRoute(resourceGroupName, name, vnetName, routeName, route, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._updateVnetRoute(resourceGroupName, name, vnetName, routeName, route, options, optionalCallback); + } + } + + /** + * @summary Reboot a worker machine in an App Service plan. + * + * Reboot a worker machine in an App Service plan. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service plan. + * + * @param {string} workerName Name of worker machine, which typically starts + * with RD. + * + * @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. + */ + rebootWorkerWithHttpOperationResponse(resourceGroupName, name, workerName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._rebootWorker(resourceGroupName, name, workerName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Reboot a worker machine in an App Service plan. + * + * Reboot a worker machine in an App Service plan. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service plan. + * + * @param {string} workerName Name of worker machine, which typically starts + * with RD. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + rebootWorker(resourceGroupName, name, workerName, 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._rebootWorker(resourceGroupName, name, workerName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._rebootWorker(resourceGroupName, name, workerName, options, optionalCallback); + } + } + + /** + * @summary Creates or updates an App Service Plan. + * + * Creates or updates an App Service Plan. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service plan. + * + * @param {object} appServicePlan Details of the App Service plan. + * + * @param {string} [appServicePlan.workerTierName] Target worker tier assigned + * to the App Service plan. + * + * @param {string} [appServicePlan.adminSiteName] App Service plan + * administration site. + * + * @param {object} [appServicePlan.hostingEnvironmentProfile] Specification for + * the App Service Environment to use for the App Service plan. + * + * @param {string} [appServicePlan.hostingEnvironmentProfile.id] Resource ID of + * the App Service Environment. + * + * @param {boolean} [appServicePlan.perSiteScaling] If true, apps + * assigned to this App Service plan can be scaled independently. + * If false, apps assigned to this App Service plan will scale to + * all instances of the plan. + * + * @param {boolean} [appServicePlan.isSpot] If true, this App + * Service Plan owns spot instances. + * + * @param {date} [appServicePlan.spotExpirationTime] The time when the server + * farm expires. Valid only if it is a spot server farm. + * + * @param {date} [appServicePlan.freeOfferExpirationTime] The time when the + * server farm free offer expires. + * + * @param {boolean} [appServicePlan.reserved] If Linux app service plan + * true, false otherwise. + * + * @param {boolean} [appServicePlan.isXenon] Obsolete: If Hyper-V container app + * service plan true, false otherwise. + * + * @param {boolean} [appServicePlan.hyperV] If Hyper-V container app service + * plan true, false otherwise. + * + * @param {number} [appServicePlan.targetWorkerCount] Scaling worker count. + * + * @param {number} [appServicePlan.targetWorkerSizeId] Scaling worker size ID. + * + * @param {object} [appServicePlan.sku] + * + * @param {string} [appServicePlan.sku.name] Name of the resource SKU. + * + * @param {string} [appServicePlan.sku.tier] Service tier of the resource SKU. + * + * @param {string} [appServicePlan.sku.size] Size specifier of the resource + * SKU. + * + * @param {string} [appServicePlan.sku.family] Family code of the resource SKU. + * + * @param {number} [appServicePlan.sku.capacity] Current number of instances + * assigned to the resource. + * + * @param {object} [appServicePlan.sku.skuCapacity] Min, max, and default scale + * values of the SKU. + * + * @param {number} [appServicePlan.sku.skuCapacity.minimum] Minimum number of + * workers for this App Service plan SKU. + * + * @param {number} [appServicePlan.sku.skuCapacity.maximum] Maximum number of + * workers for this App Service plan SKU. + * + * @param {number} [appServicePlan.sku.skuCapacity.default] Default number of + * workers for this App Service plan SKU. + * + * @param {string} [appServicePlan.sku.skuCapacity.scaleType] Available scale + * configurations for an App Service plan. + * + * @param {array} [appServicePlan.sku.locations] Locations of the SKU. + * + * @param {array} [appServicePlan.sku.capabilities] Capabilities of the SKU, + * e.g., is traffic manager enabled? + * + * @param {string} [appServicePlan.kind] Kind of resource. + * + * @param {string} appServicePlan.location Resource Location. + * + * @param {object} [appServicePlan.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName, name, appServicePlan, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginCreateOrUpdate(resourceGroupName, name, appServicePlan, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Creates or updates an App Service Plan. + * + * Creates or updates an App Service Plan. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service plan. + * + * @param {object} appServicePlan Details of the App Service plan. + * + * @param {string} [appServicePlan.workerTierName] Target worker tier assigned + * to the App Service plan. + * + * @param {string} [appServicePlan.adminSiteName] App Service plan + * administration site. + * + * @param {object} [appServicePlan.hostingEnvironmentProfile] Specification for + * the App Service Environment to use for the App Service plan. + * + * @param {string} [appServicePlan.hostingEnvironmentProfile.id] Resource ID of + * the App Service Environment. + * + * @param {boolean} [appServicePlan.perSiteScaling] If true, apps + * assigned to this App Service plan can be scaled independently. + * If false, apps assigned to this App Service plan will scale to + * all instances of the plan. + * + * @param {boolean} [appServicePlan.isSpot] If true, this App + * Service Plan owns spot instances. + * + * @param {date} [appServicePlan.spotExpirationTime] The time when the server + * farm expires. Valid only if it is a spot server farm. + * + * @param {date} [appServicePlan.freeOfferExpirationTime] The time when the + * server farm free offer expires. + * + * @param {boolean} [appServicePlan.reserved] If Linux app service plan + * true, false otherwise. + * + * @param {boolean} [appServicePlan.isXenon] Obsolete: If Hyper-V container app + * service plan true, false otherwise. + * + * @param {boolean} [appServicePlan.hyperV] If Hyper-V container app service + * plan true, false otherwise. + * + * @param {number} [appServicePlan.targetWorkerCount] Scaling worker count. + * + * @param {number} [appServicePlan.targetWorkerSizeId] Scaling worker size ID. + * + * @param {object} [appServicePlan.sku] + * + * @param {string} [appServicePlan.sku.name] Name of the resource SKU. + * + * @param {string} [appServicePlan.sku.tier] Service tier of the resource SKU. + * + * @param {string} [appServicePlan.sku.size] Size specifier of the resource + * SKU. + * + * @param {string} [appServicePlan.sku.family] Family code of the resource SKU. + * + * @param {number} [appServicePlan.sku.capacity] Current number of instances + * assigned to the resource. + * + * @param {object} [appServicePlan.sku.skuCapacity] Min, max, and default scale + * values of the SKU. + * + * @param {number} [appServicePlan.sku.skuCapacity.minimum] Minimum number of + * workers for this App Service plan SKU. + * + * @param {number} [appServicePlan.sku.skuCapacity.maximum] Maximum number of + * workers for this App Service plan SKU. + * + * @param {number} [appServicePlan.sku.skuCapacity.default] Default number of + * workers for this App Service plan SKU. + * + * @param {string} [appServicePlan.sku.skuCapacity.scaleType] Available scale + * configurations for an App Service plan. + * + * @param {array} [appServicePlan.sku.locations] Locations of the SKU. + * + * @param {array} [appServicePlan.sku.capabilities] Capabilities of the SKU, + * e.g., is traffic manager enabled? + * + * @param {string} [appServicePlan.kind] Kind of resource. + * + * @param {string} appServicePlan.location Resource Location. + * + * @param {object} [appServicePlan.tags] Resource tags. + * + * @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 {AppServicePlan} - 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 AppServicePlan} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + beginCreateOrUpdate(resourceGroupName, name, appServicePlan, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._beginCreateOrUpdate(resourceGroupName, name, appServicePlan, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginCreateOrUpdate(resourceGroupName, name, appServicePlan, options, optionalCallback); + } + } + + /** + * @summary Get all App Service plans for a subcription. + * + * Get all App Service plans for a subcription. + * + * @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 Get all App Service plans for a subcription. + * + * Get all App Service plans for a subcription. + * + * @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 {AppServicePlanCollection} - 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 AppServicePlanCollection} 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); + } + } + + /** + * @summary Get all App Service plans in a resource group. + * + * Get all App Service plans in a resource group. + * + * @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. + */ + listByResourceGroupNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listByResourceGroupNext(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 Get all App Service plans in a resource group. + * + * Get all App Service plans in a resource group. + * + * @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 {AppServicePlanCollection} - 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 AppServicePlanCollection} 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. + */ + listByResourceGroupNext(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._listByResourceGroupNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listByResourceGroupNext(nextPageLink, options, optionalCallback); + } + } + + /** + * @summary Get all apps that use a Hybrid Connection in an App Service Plan. + * + * Get all apps that use a Hybrid Connection in an App Service Plan. + * + * @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. + */ + listWebAppsByHybridConnectionNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listWebAppsByHybridConnectionNext(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 Get all apps that use a Hybrid Connection in an App Service Plan. + * + * Get all apps that use a Hybrid Connection in an App Service Plan. + * + * @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 {ResourceCollection} - 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 ResourceCollection} 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. + */ + listWebAppsByHybridConnectionNext(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._listWebAppsByHybridConnectionNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listWebAppsByHybridConnectionNext(nextPageLink, options, optionalCallback); + } + } + + /** + * @summary Retrieve all Hybrid Connections in use in an App Service plan. + * + * Retrieve all Hybrid Connections in use in an App Service plan. + * + * @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. + */ + listHybridConnectionsNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listHybridConnectionsNext(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 Retrieve all Hybrid Connections in use in an App Service plan. + * + * Retrieve all Hybrid Connections in use in an App Service plan. + * + * @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 {HybridConnectionCollection} - 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 HybridConnectionCollection} 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. + */ + listHybridConnectionsNext(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._listHybridConnectionsNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listHybridConnectionsNext(nextPageLink, options, optionalCallback); + } + } + + /** + * @summary Get metrics that can be queried for an App Service plan, and their + * definitions. + * + * Get metrics that can be queried for an App Service plan, and their + * definitions. + * + * @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. + */ + listMetricDefintionsNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listMetricDefintionsNext(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 Get metrics that can be queried for an App Service plan, and their + * definitions. + * + * Get metrics that can be queried for an App Service plan, and their + * definitions. + * + * @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 {ResourceMetricDefinitionCollection} - 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 ResourceMetricDefinitionCollection} 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. + */ + listMetricDefintionsNext(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._listMetricDefintionsNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listMetricDefintionsNext(nextPageLink, options, optionalCallback); + } + } + + /** + * @summary Get metrics for an App Serice plan. + * + * Get metrics for an App Serice plan. + * + * @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. + */ + listMetricsNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listMetricsNext(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 Get metrics for an App Serice plan. + * + * Get metrics for an App Serice plan. + * + * @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 {ResourceMetricCollection} - 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 ResourceMetricCollection} 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. + */ + listMetricsNext(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._listMetricsNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listMetricsNext(nextPageLink, options, optionalCallback); + } + } + + /** + * @summary Get all apps associated with an App Service plan. + * + * Get all apps associated with an App Service plan. + * + * @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. + */ + listWebAppsNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listWebAppsNext(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 Get all apps associated with an App Service plan. + * + * Get all apps associated with an App Service plan. + * + * @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 {WebAppCollection} - 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 WebAppCollection} 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. + */ + listWebAppsNext(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._listWebAppsNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listWebAppsNext(nextPageLink, options, optionalCallback); + } + } + + /** + * @summary Gets server farm usage information + * + * Gets server farm usage information + * + * @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. + */ + listUsagesNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listUsagesNext(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 server farm usage information + * + * Gets server farm usage information + * + * @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 {CsmUsageQuotaCollection} - 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 CsmUsageQuotaCollection} 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. + */ + listUsagesNext(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._listUsagesNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listUsagesNext(nextPageLink, options, optionalCallback); + } + } + +} + +module.exports = AppServicePlans; diff --git a/lib/services/websiteManagement2/lib/operations/certificateRegistrationProvider.js b/lib/services/websiteManagement2/lib/operations/certificateRegistrationProvider.js new file mode 100644 index 0000000000..14e286327f --- /dev/null +++ b/lib/services/websiteManagement2/lib/operations/certificateRegistrationProvider.js @@ -0,0 +1,479 @@ +/* + * 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 Implements Csm operations Api to exposes the list of available Csm + * Apis under the resource provider + * + * Implements Csm operations Api to exposes the list of available Csm Apis + * under the resource provider + * + * @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 CsmOperationCollection} 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 _listOperations(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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'providers/Microsoft.CertificateRegistration/operations'; + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['CsmOperationCollection']().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 Implements Csm operations Api to exposes the list of available Csm + * Apis under the resource provider + * + * Implements Csm operations Api to exposes the list of available Csm Apis + * under the resource provider + * + * @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 CsmOperationCollection} 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 _listOperationsNext(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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['CsmOperationCollection']().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 CertificateRegistrationProvider. */ +class CertificateRegistrationProvider { + /** + * Create a CertificateRegistrationProvider. + * @param {WebSiteManagementClient} client Reference to the service client. + */ + constructor(client) { + this.client = client; + this._listOperations = _listOperations; + this._listOperationsNext = _listOperationsNext; + } + + /** + * @summary Implements Csm operations Api to exposes the list of available Csm + * Apis under the resource provider + * + * Implements Csm operations Api to exposes the list of available Csm Apis + * under the resource provider + * + * @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. + */ + listOperationsWithHttpOperationResponse(options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listOperations(options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Implements Csm operations Api to exposes the list of available Csm + * Apis under the resource provider + * + * Implements Csm operations Api to exposes the list of available Csm Apis + * under the resource provider + * + * @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 {CsmOperationCollection} - 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 CsmOperationCollection} 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. + */ + listOperations(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._listOperations(options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listOperations(options, optionalCallback); + } + } + + /** + * @summary Implements Csm operations Api to exposes the list of available Csm + * Apis under the resource provider + * + * Implements Csm operations Api to exposes the list of available Csm Apis + * under the resource provider + * + * @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. + */ + listOperationsNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listOperationsNext(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 Implements Csm operations Api to exposes the list of available Csm + * Apis under the resource provider + * + * Implements Csm operations Api to exposes the list of available Csm Apis + * under the resource provider + * + * @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 {CsmOperationCollection} - 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 CsmOperationCollection} 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. + */ + listOperationsNext(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._listOperationsNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listOperationsNext(nextPageLink, options, optionalCallback); + } + } + +} + +module.exports = CertificateRegistrationProvider; diff --git a/lib/services/websiteManagement2/lib/operations/certificates.js b/lib/services/websiteManagement2/lib/operations/certificates.js new file mode 100644 index 0000000000..5bda762528 --- /dev/null +++ b/lib/services/websiteManagement2/lib/operations/certificates.js @@ -0,0 +1,2108 @@ +/* + * 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 Get all certificates for a subscription. + * + * Get all certificates for a subscription. + * + * @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 CertificateCollection} 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.'); + } + // Validate + try { + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/providers/Microsoft.Web/certificates'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['CertificateCollection']().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 Get all certificates in a resource group. + * + * Get all certificates in a resource group. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @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 CertificateCollection} 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 _listByResourceGroup(resourceGroupName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/certificates'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['CertificateCollection']().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 Get a certificate. + * + * Get a certificate. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the certificate. + * + * @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 Certificate} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _get(resourceGroupName, name, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/certificates/{name}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['Certificate']().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 Create or update a certificate. + * + * Create or update a certificate. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the certificate. + * + * @param {object} certificateEnvelope Details of certificate, if it exists + * already. + * + * @param {array} [certificateEnvelope.hostNames] Host names the certificate + * applies to. + * + * @param {buffer} [certificateEnvelope.pfxBlob] Pfx blob. + * + * @param {string} certificateEnvelope.password Certificate password. + * + * @param {string} [certificateEnvelope.keyVaultId] Key Vault Csm resource Id. + * + * @param {string} [certificateEnvelope.keyVaultSecretName] Key Vault secret + * name. + * + * @param {string} [certificateEnvelope.serverFarmId] Resource ID of the + * associated App Service plan, formatted as: + * "/subscriptions/{subscriptionID}/resourceGroups/{groupName}/providers/Microsoft.Web/serverfarms/{appServicePlanName}". + * + * @param {string} [certificateEnvelope.kind] Kind of resource. + * + * @param {string} certificateEnvelope.location Resource Location. + * + * @param {object} [certificateEnvelope.tags] Resource tags. + * + * @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 Certificate} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _createOrUpdate(resourceGroupName, name, certificateEnvelope, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (certificateEnvelope === null || certificateEnvelope === undefined) { + throw new Error('certificateEnvelope cannot be null or undefined.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/certificates/{name}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'PUT'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (certificateEnvelope !== null && certificateEnvelope !== undefined) { + let requestModelMapper = new client.models['Certificate']().mapper(); + requestModel = client.serialize(requestModelMapper, certificateEnvelope, 'certificateEnvelope'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(certificateEnvelope, 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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['Certificate']().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 Delete a certificate. + * + * Delete a certificate. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the certificate. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _deleteMethod(resourceGroupName, name, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/certificates/{name}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'DELETE'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 204) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + + return callback(null, result, httpRequest, response); + }); +} + +/** + * @summary Create or update a certificate. + * + * Create or update a certificate. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the certificate. + * + * @param {object} certificateEnvelope Details of certificate, if it exists + * already. + * + * @param {array} [certificateEnvelope.hostNames] Host names the certificate + * applies to. + * + * @param {buffer} [certificateEnvelope.pfxBlob] Pfx blob. + * + * @param {string} certificateEnvelope.password Certificate password. + * + * @param {string} [certificateEnvelope.keyVaultId] Key Vault Csm resource Id. + * + * @param {string} [certificateEnvelope.keyVaultSecretName] Key Vault secret + * name. + * + * @param {string} [certificateEnvelope.serverFarmId] Resource ID of the + * associated App Service plan, formatted as: + * "/subscriptions/{subscriptionID}/resourceGroups/{groupName}/providers/Microsoft.Web/serverfarms/{appServicePlanName}". + * + * @param {string} [certificateEnvelope.kind] Kind of resource. + * + * @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 Certificate} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _update(resourceGroupName, name, certificateEnvelope, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (certificateEnvelope === null || certificateEnvelope === undefined) { + throw new Error('certificateEnvelope cannot be null or undefined.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/certificates/{name}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'PATCH'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (certificateEnvelope !== null && certificateEnvelope !== undefined) { + let requestModelMapper = new client.models['CertificatePatchResource']().mapper(); + requestModel = client.serialize(requestModelMapper, certificateEnvelope, 'certificateEnvelope'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(certificateEnvelope, 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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['Certificate']().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 Get all certificates for a subscription. + * + * Get all certificates for a subscription. + * + * @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 CertificateCollection} 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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['CertificateCollection']().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 Get all certificates in a resource group. + * + * Get all certificates in a resource group. + * + * @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 CertificateCollection} 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 _listByResourceGroupNext(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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['CertificateCollection']().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 Certificates. */ +class Certificates { + /** + * Create a Certificates. + * @param {WebSiteManagementClient} client Reference to the service client. + */ + constructor(client) { + this.client = client; + this._list = _list; + this._listByResourceGroup = _listByResourceGroup; + this._get = _get; + this._createOrUpdate = _createOrUpdate; + this._deleteMethod = _deleteMethod; + this._update = _update; + this._listNext = _listNext; + this._listByResourceGroupNext = _listByResourceGroupNext; + } + + /** + * @summary Get all certificates for a subscription. + * + * Get all certificates for a subscription. + * + * @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. + */ + 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 Get all certificates for a subscription. + * + * Get all certificates for a subscription. + * + * @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 {CertificateCollection} - 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 CertificateCollection} 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 Get all certificates in a resource group. + * + * Get all certificates in a resource group. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @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. + */ + listByResourceGroupWithHttpOperationResponse(resourceGroupName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listByResourceGroup(resourceGroupName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Get all certificates in a resource group. + * + * Get all certificates in a resource group. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @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 {CertificateCollection} - 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 CertificateCollection} 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. + */ + listByResourceGroup(resourceGroupName, 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._listByResourceGroup(resourceGroupName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listByResourceGroup(resourceGroupName, options, optionalCallback); + } + } + + /** + * @summary Get a certificate. + * + * Get a certificate. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the certificate. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + getWithHttpOperationResponse(resourceGroupName, name, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._get(resourceGroupName, name, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Get a certificate. + * + * Get a certificate. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the certificate. + * + * @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 {Certificate} - 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 Certificate} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + get(resourceGroupName, name, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._get(resourceGroupName, name, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._get(resourceGroupName, name, options, optionalCallback); + } + } + + /** + * @summary Create or update a certificate. + * + * Create or update a certificate. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the certificate. + * + * @param {object} certificateEnvelope Details of certificate, if it exists + * already. + * + * @param {array} [certificateEnvelope.hostNames] Host names the certificate + * applies to. + * + * @param {buffer} [certificateEnvelope.pfxBlob] Pfx blob. + * + * @param {string} certificateEnvelope.password Certificate password. + * + * @param {string} [certificateEnvelope.keyVaultId] Key Vault Csm resource Id. + * + * @param {string} [certificateEnvelope.keyVaultSecretName] Key Vault secret + * name. + * + * @param {string} [certificateEnvelope.serverFarmId] Resource ID of the + * associated App Service plan, formatted as: + * "/subscriptions/{subscriptionID}/resourceGroups/{groupName}/providers/Microsoft.Web/serverfarms/{appServicePlanName}". + * + * @param {string} [certificateEnvelope.kind] Kind of resource. + * + * @param {string} certificateEnvelope.location Resource Location. + * + * @param {object} [certificateEnvelope.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + createOrUpdateWithHttpOperationResponse(resourceGroupName, name, certificateEnvelope, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._createOrUpdate(resourceGroupName, name, certificateEnvelope, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Create or update a certificate. + * + * Create or update a certificate. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the certificate. + * + * @param {object} certificateEnvelope Details of certificate, if it exists + * already. + * + * @param {array} [certificateEnvelope.hostNames] Host names the certificate + * applies to. + * + * @param {buffer} [certificateEnvelope.pfxBlob] Pfx blob. + * + * @param {string} certificateEnvelope.password Certificate password. + * + * @param {string} [certificateEnvelope.keyVaultId] Key Vault Csm resource Id. + * + * @param {string} [certificateEnvelope.keyVaultSecretName] Key Vault secret + * name. + * + * @param {string} [certificateEnvelope.serverFarmId] Resource ID of the + * associated App Service plan, formatted as: + * "/subscriptions/{subscriptionID}/resourceGroups/{groupName}/providers/Microsoft.Web/serverfarms/{appServicePlanName}". + * + * @param {string} [certificateEnvelope.kind] Kind of resource. + * + * @param {string} certificateEnvelope.location Resource Location. + * + * @param {object} [certificateEnvelope.tags] Resource tags. + * + * @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 {Certificate} - 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 Certificate} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + createOrUpdate(resourceGroupName, name, certificateEnvelope, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._createOrUpdate(resourceGroupName, name, certificateEnvelope, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._createOrUpdate(resourceGroupName, name, certificateEnvelope, options, optionalCallback); + } + } + + /** + * @summary Delete a certificate. + * + * Delete a certificate. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the certificate. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + deleteMethodWithHttpOperationResponse(resourceGroupName, name, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._deleteMethod(resourceGroupName, name, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Delete a certificate. + * + * Delete a certificate. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the certificate. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + deleteMethod(resourceGroupName, name, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._deleteMethod(resourceGroupName, name, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._deleteMethod(resourceGroupName, name, options, optionalCallback); + } + } + + /** + * @summary Create or update a certificate. + * + * Create or update a certificate. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the certificate. + * + * @param {object} certificateEnvelope Details of certificate, if it exists + * already. + * + * @param {array} [certificateEnvelope.hostNames] Host names the certificate + * applies to. + * + * @param {buffer} [certificateEnvelope.pfxBlob] Pfx blob. + * + * @param {string} certificateEnvelope.password Certificate password. + * + * @param {string} [certificateEnvelope.keyVaultId] Key Vault Csm resource Id. + * + * @param {string} [certificateEnvelope.keyVaultSecretName] Key Vault secret + * name. + * + * @param {string} [certificateEnvelope.serverFarmId] Resource ID of the + * associated App Service plan, formatted as: + * "/subscriptions/{subscriptionID}/resourceGroups/{groupName}/providers/Microsoft.Web/serverfarms/{appServicePlanName}". + * + * @param {string} [certificateEnvelope.kind] Kind of resource. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + updateWithHttpOperationResponse(resourceGroupName, name, certificateEnvelope, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._update(resourceGroupName, name, certificateEnvelope, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Create or update a certificate. + * + * Create or update a certificate. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the certificate. + * + * @param {object} certificateEnvelope Details of certificate, if it exists + * already. + * + * @param {array} [certificateEnvelope.hostNames] Host names the certificate + * applies to. + * + * @param {buffer} [certificateEnvelope.pfxBlob] Pfx blob. + * + * @param {string} certificateEnvelope.password Certificate password. + * + * @param {string} [certificateEnvelope.keyVaultId] Key Vault Csm resource Id. + * + * @param {string} [certificateEnvelope.keyVaultSecretName] Key Vault secret + * name. + * + * @param {string} [certificateEnvelope.serverFarmId] Resource ID of the + * associated App Service plan, formatted as: + * "/subscriptions/{subscriptionID}/resourceGroups/{groupName}/providers/Microsoft.Web/serverfarms/{appServicePlanName}". + * + * @param {string} [certificateEnvelope.kind] Kind of resource. + * + * @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 {Certificate} - 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 Certificate} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + update(resourceGroupName, name, certificateEnvelope, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._update(resourceGroupName, name, certificateEnvelope, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._update(resourceGroupName, name, certificateEnvelope, options, optionalCallback); + } + } + + /** + * @summary Get all certificates for a subscription. + * + * Get all certificates for a subscription. + * + * @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 Get all certificates for a subscription. + * + * Get all certificates for a subscription. + * + * @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 {CertificateCollection} - 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 CertificateCollection} 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); + } + } + + /** + * @summary Get all certificates in a resource group. + * + * Get all certificates in a resource group. + * + * @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. + */ + listByResourceGroupNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listByResourceGroupNext(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 Get all certificates in a resource group. + * + * Get all certificates in a resource group. + * + * @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 {CertificateCollection} - 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 CertificateCollection} 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. + */ + listByResourceGroupNext(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._listByResourceGroupNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listByResourceGroupNext(nextPageLink, options, optionalCallback); + } + } + +} + +module.exports = Certificates; diff --git a/lib/services/websiteManagement2/lib/operations/deletedWebApps.js b/lib/services/websiteManagement2/lib/operations/deletedWebApps.js new file mode 100644 index 0000000000..e8f1fec2a2 --- /dev/null +++ b/lib/services/websiteManagement2/lib/operations/deletedWebApps.js @@ -0,0 +1,471 @@ +/* + * 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 Get all deleted apps for a subscription. + * + * Get all deleted apps for a subscription. + * + * @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 DeletedWebAppCollection} 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.'); + } + // Validate + try { + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/providers/Microsoft.Web/deletedSites'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['DeletedWebAppCollection']().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 Get all deleted apps for a subscription. + * + * Get all deleted apps for a subscription. + * + * @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 DeletedWebAppCollection} 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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['DeletedWebAppCollection']().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 DeletedWebApps. */ +class DeletedWebApps { + /** + * Create a DeletedWebApps. + * @param {WebSiteManagementClient} client Reference to the service client. + */ + constructor(client) { + this.client = client; + this._list = _list; + this._listNext = _listNext; + } + + /** + * @summary Get all deleted apps for a subscription. + * + * Get all deleted apps for a subscription. + * + * @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. + */ + 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 Get all deleted apps for a subscription. + * + * Get all deleted apps for a subscription. + * + * @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 {DeletedWebAppCollection} - 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 DeletedWebAppCollection} 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 Get all deleted apps for a subscription. + * + * Get all deleted apps for a subscription. + * + * @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 Get all deleted apps for a subscription. + * + * Get all deleted apps for a subscription. + * + * @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 {DeletedWebAppCollection} - 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 DeletedWebAppCollection} 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 = DeletedWebApps; diff --git a/lib/services/websiteManagement2/lib/operations/diagnostics.js b/lib/services/websiteManagement2/lib/operations/diagnostics.js new file mode 100644 index 0000000000..92f387cbf1 --- /dev/null +++ b/lib/services/websiteManagement2/lib/operations/diagnostics.js @@ -0,0 +1,8797 @@ +/* + * 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 List Hosting Environment Detector Responses + * + * List Hosting Environment Detector Responses + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site Name + * + * @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 DetectorResponseCollection} 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 _listHostingEnvironmentDetectorResponses(resourceGroupName, name, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/detectors'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['DetectorResponseCollection']().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 Get Hosting Environment Detector Response + * + * Get Hosting Environment Detector Response + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name App Service Environment Name + * + * @param {string} detectorName Detector Resource Name + * + * @param {object} [options] Optional Parameters. + * + * @param {date} [options.startTime] Start Time + * + * @param {date} [options.endTime] End Time + * + * @param {string} [options.timeGrain] Time Grain + * + * @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 DetectorResponse} 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 _getHostingEnvironmentDetectorResponse(resourceGroupName, name, detectorName, 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 startTime = (options && options.startTime !== undefined) ? options.startTime : undefined; + let endTime = (options && options.endTime !== undefined) ? options.endTime : undefined; + let timeGrain = (options && options.timeGrain !== undefined) ? options.timeGrain : undefined; + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (detectorName === null || detectorName === undefined || typeof detectorName.valueOf() !== 'string') { + throw new Error('detectorName cannot be null or undefined and it must be of type string.'); + } + if (startTime && !(startTime instanceof Date || + (typeof startTime.valueOf() === 'string' && !isNaN(Date.parse(startTime))))) { + throw new Error('startTime must be of type date.'); + } + if (endTime && !(endTime instanceof Date || + (typeof endTime.valueOf() === 'string' && !isNaN(Date.parse(endTime))))) { + throw new Error('endTime must be of type date.'); + } + if (timeGrain !== null && timeGrain !== undefined && typeof timeGrain.valueOf() !== 'string') { + throw new Error('timeGrain must be of type string.'); + } + if (timeGrain !== null && timeGrain !== undefined) { + if (timeGrain.match(/PT[1-9][0-9]+[SMH]/) === null) + { + throw new Error('"timeGrain" should satisfy the constraint - "Pattern": /PT[1-9][0-9]+[SMH]/'); + } + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/detectors/{detectorName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{detectorName}', encodeURIComponent(detectorName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + if (startTime !== null && startTime !== undefined) { + queryParameters.push('startTime=' + encodeURIComponent(client.serializeObject(startTime))); + } + if (endTime !== null && endTime !== undefined) { + queryParameters.push('endTime=' + encodeURIComponent(client.serializeObject(endTime))); + } + if (timeGrain !== null && timeGrain !== undefined) { + queryParameters.push('timeGrain=' + encodeURIComponent(timeGrain)); + } + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['DetectorResponse']().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 List Site Detector Responses + * + * List Site Detector Responses + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} siteName Site Name + * + * @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 DetectorResponseCollection} 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 _listSiteDetectorResponses(resourceGroupName, siteName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (siteName === null || siteName === undefined || typeof siteName.valueOf() !== 'string') { + throw new Error('siteName cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/detectors'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{siteName}', encodeURIComponent(siteName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['DetectorResponseCollection']().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 Get site detector response + * + * Get site detector response + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} siteName Site Name + * + * @param {string} detectorName Detector Resource Name + * + * @param {object} [options] Optional Parameters. + * + * @param {date} [options.startTime] Start Time + * + * @param {date} [options.endTime] End Time + * + * @param {string} [options.timeGrain] Time Grain + * + * @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 DetectorResponse} 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 _getSiteDetectorResponse(resourceGroupName, siteName, detectorName, 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 startTime = (options && options.startTime !== undefined) ? options.startTime : undefined; + let endTime = (options && options.endTime !== undefined) ? options.endTime : undefined; + let timeGrain = (options && options.timeGrain !== undefined) ? options.timeGrain : undefined; + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (siteName === null || siteName === undefined || typeof siteName.valueOf() !== 'string') { + throw new Error('siteName cannot be null or undefined and it must be of type string.'); + } + if (detectorName === null || detectorName === undefined || typeof detectorName.valueOf() !== 'string') { + throw new Error('detectorName cannot be null or undefined and it must be of type string.'); + } + if (startTime && !(startTime instanceof Date || + (typeof startTime.valueOf() === 'string' && !isNaN(Date.parse(startTime))))) { + throw new Error('startTime must be of type date.'); + } + if (endTime && !(endTime instanceof Date || + (typeof endTime.valueOf() === 'string' && !isNaN(Date.parse(endTime))))) { + throw new Error('endTime must be of type date.'); + } + if (timeGrain !== null && timeGrain !== undefined && typeof timeGrain.valueOf() !== 'string') { + throw new Error('timeGrain must be of type string.'); + } + if (timeGrain !== null && timeGrain !== undefined) { + if (timeGrain.match(/PT[1-9][0-9]+[SMH]/) === null) + { + throw new Error('"timeGrain" should satisfy the constraint - "Pattern": /PT[1-9][0-9]+[SMH]/'); + } + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/detectors/{detectorName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{siteName}', encodeURIComponent(siteName)); + requestUrl = requestUrl.replace('{detectorName}', encodeURIComponent(detectorName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + if (startTime !== null && startTime !== undefined) { + queryParameters.push('startTime=' + encodeURIComponent(client.serializeObject(startTime))); + } + if (endTime !== null && endTime !== undefined) { + queryParameters.push('endTime=' + encodeURIComponent(client.serializeObject(endTime))); + } + if (timeGrain !== null && timeGrain !== undefined) { + queryParameters.push('timeGrain=' + encodeURIComponent(timeGrain)); + } + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['DetectorResponse']().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 Get Diagnostics Categories + * + * Get Diagnostics Categories + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} siteName Site Name + * + * @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 DiagnosticCategoryCollection} 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 _listSiteDiagnosticCategories(resourceGroupName, siteName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (siteName === null || siteName === undefined || typeof siteName.valueOf() !== 'string') { + throw new Error('siteName cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/diagnostics'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{siteName}', encodeURIComponent(siteName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['DiagnosticCategoryCollection']().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 Get Diagnostics Category + * + * Get Diagnostics Category + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} siteName Site Name + * + * @param {string} diagnosticCategory Diagnostic Category + * + * @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 DiagnosticCategory} 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 _getSiteDiagnosticCategory(resourceGroupName, siteName, diagnosticCategory, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (siteName === null || siteName === undefined || typeof siteName.valueOf() !== 'string') { + throw new Error('siteName cannot be null or undefined and it must be of type string.'); + } + if (diagnosticCategory === null || diagnosticCategory === undefined || typeof diagnosticCategory.valueOf() !== 'string') { + throw new Error('diagnosticCategory cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/diagnostics/{diagnosticCategory}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{siteName}', encodeURIComponent(siteName)); + requestUrl = requestUrl.replace('{diagnosticCategory}', encodeURIComponent(diagnosticCategory)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['DiagnosticCategory']().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 Get Site Analyses + * + * Get Site Analyses + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} siteName Site Name + * + * @param {string} diagnosticCategory Diagnostic Category + * + * @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 DiagnosticAnalysisCollection} 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 _listSiteAnalyses(resourceGroupName, siteName, diagnosticCategory, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (siteName === null || siteName === undefined || typeof siteName.valueOf() !== 'string') { + throw new Error('siteName cannot be null or undefined and it must be of type string.'); + } + if (diagnosticCategory === null || diagnosticCategory === undefined || typeof diagnosticCategory.valueOf() !== 'string') { + throw new Error('diagnosticCategory cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/diagnostics/{diagnosticCategory}/analyses'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{siteName}', encodeURIComponent(siteName)); + requestUrl = requestUrl.replace('{diagnosticCategory}', encodeURIComponent(diagnosticCategory)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['DiagnosticAnalysisCollection']().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 Get Site Analysis + * + * Get Site Analysis + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} siteName Site Name + * + * @param {string} diagnosticCategory Diagnostic Category + * + * @param {string} analysisName Analysis Name + * + * @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 DiagnosticAnalysis} 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 _getSiteAnalysis(resourceGroupName, siteName, diagnosticCategory, analysisName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (siteName === null || siteName === undefined || typeof siteName.valueOf() !== 'string') { + throw new Error('siteName cannot be null or undefined and it must be of type string.'); + } + if (diagnosticCategory === null || diagnosticCategory === undefined || typeof diagnosticCategory.valueOf() !== 'string') { + throw new Error('diagnosticCategory cannot be null or undefined and it must be of type string.'); + } + if (analysisName === null || analysisName === undefined || typeof analysisName.valueOf() !== 'string') { + throw new Error('analysisName cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/diagnostics/{diagnosticCategory}/analyses/{analysisName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{siteName}', encodeURIComponent(siteName)); + requestUrl = requestUrl.replace('{diagnosticCategory}', encodeURIComponent(diagnosticCategory)); + requestUrl = requestUrl.replace('{analysisName}', encodeURIComponent(analysisName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['DiagnosticAnalysis']().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 Execute Analysis + * + * Execute Analysis + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} siteName Site Name + * + * @param {string} diagnosticCategory Category Name + * + * @param {string} analysisName Analysis Resource Name + * + * @param {object} [options] Optional Parameters. + * + * @param {date} [options.startTime] Start Time + * + * @param {date} [options.endTime] End Time + * + * @param {string} [options.timeGrain] Time Grain + * + * @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 DiagnosticAnalysis} 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 _executeSiteAnalysis(resourceGroupName, siteName, diagnosticCategory, analysisName, 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 startTime = (options && options.startTime !== undefined) ? options.startTime : undefined; + let endTime = (options && options.endTime !== undefined) ? options.endTime : undefined; + let timeGrain = (options && options.timeGrain !== undefined) ? options.timeGrain : undefined; + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (siteName === null || siteName === undefined || typeof siteName.valueOf() !== 'string') { + throw new Error('siteName cannot be null or undefined and it must be of type string.'); + } + if (diagnosticCategory === null || diagnosticCategory === undefined || typeof diagnosticCategory.valueOf() !== 'string') { + throw new Error('diagnosticCategory cannot be null or undefined and it must be of type string.'); + } + if (analysisName === null || analysisName === undefined || typeof analysisName.valueOf() !== 'string') { + throw new Error('analysisName cannot be null or undefined and it must be of type string.'); + } + if (startTime && !(startTime instanceof Date || + (typeof startTime.valueOf() === 'string' && !isNaN(Date.parse(startTime))))) { + throw new Error('startTime must be of type date.'); + } + if (endTime && !(endTime instanceof Date || + (typeof endTime.valueOf() === 'string' && !isNaN(Date.parse(endTime))))) { + throw new Error('endTime must be of type date.'); + } + if (timeGrain !== null && timeGrain !== undefined && typeof timeGrain.valueOf() !== 'string') { + throw new Error('timeGrain must be of type string.'); + } + if (timeGrain !== null && timeGrain !== undefined) { + if (timeGrain.match(/PT[1-9][0-9]+[SMH]/) === null) + { + throw new Error('"timeGrain" should satisfy the constraint - "Pattern": /PT[1-9][0-9]+[SMH]/'); + } + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/diagnostics/{diagnosticCategory}/analyses/{analysisName}/execute'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{siteName}', encodeURIComponent(siteName)); + requestUrl = requestUrl.replace('{diagnosticCategory}', encodeURIComponent(diagnosticCategory)); + requestUrl = requestUrl.replace('{analysisName}', encodeURIComponent(analysisName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + if (startTime !== null && startTime !== undefined) { + queryParameters.push('startTime=' + encodeURIComponent(client.serializeObject(startTime))); + } + if (endTime !== null && endTime !== undefined) { + queryParameters.push('endTime=' + encodeURIComponent(client.serializeObject(endTime))); + } + if (timeGrain !== null && timeGrain !== undefined) { + queryParameters.push('timeGrain=' + encodeURIComponent(timeGrain)); + } + 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]; + } + } + } + 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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['DiagnosticAnalysis']().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 Get Detectors + * + * Get Detectors + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} siteName Site Name + * + * @param {string} diagnosticCategory Diagnostic Category + * + * @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 DiagnosticDetectorCollection} 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 _listSiteDetectors(resourceGroupName, siteName, diagnosticCategory, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (siteName === null || siteName === undefined || typeof siteName.valueOf() !== 'string') { + throw new Error('siteName cannot be null or undefined and it must be of type string.'); + } + if (diagnosticCategory === null || diagnosticCategory === undefined || typeof diagnosticCategory.valueOf() !== 'string') { + throw new Error('diagnosticCategory cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/diagnostics/{diagnosticCategory}/detectors'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{siteName}', encodeURIComponent(siteName)); + requestUrl = requestUrl.replace('{diagnosticCategory}', encodeURIComponent(diagnosticCategory)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['DiagnosticDetectorCollection']().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 Get Detector + * + * Get Detector + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} siteName Site Name + * + * @param {string} diagnosticCategory Diagnostic Category + * + * @param {string} detectorName Detector Name + * + * @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 DiagnosticDetectorCollection} 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 _getSiteDetector(resourceGroupName, siteName, diagnosticCategory, detectorName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (siteName === null || siteName === undefined || typeof siteName.valueOf() !== 'string') { + throw new Error('siteName cannot be null or undefined and it must be of type string.'); + } + if (diagnosticCategory === null || diagnosticCategory === undefined || typeof diagnosticCategory.valueOf() !== 'string') { + throw new Error('diagnosticCategory cannot be null or undefined and it must be of type string.'); + } + if (detectorName === null || detectorName === undefined || typeof detectorName.valueOf() !== 'string') { + throw new Error('detectorName cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/diagnostics/{diagnosticCategory}/detectors/{detectorName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{siteName}', encodeURIComponent(siteName)); + requestUrl = requestUrl.replace('{diagnosticCategory}', encodeURIComponent(diagnosticCategory)); + requestUrl = requestUrl.replace('{detectorName}', encodeURIComponent(detectorName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['DiagnosticDetectorCollection']().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 Execute Detector + * + * Execute Detector + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} siteName Site Name + * + * @param {string} detectorName Detector Resource Name + * + * @param {string} diagnosticCategory Category Name + * + * @param {object} [options] Optional Parameters. + * + * @param {date} [options.startTime] Start Time + * + * @param {date} [options.endTime] End Time + * + * @param {string} [options.timeGrain] Time Grain + * + * @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 DiagnosticDetectorResponse} 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 _executeSiteDetector(resourceGroupName, siteName, detectorName, diagnosticCategory, 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 startTime = (options && options.startTime !== undefined) ? options.startTime : undefined; + let endTime = (options && options.endTime !== undefined) ? options.endTime : undefined; + let timeGrain = (options && options.timeGrain !== undefined) ? options.timeGrain : undefined; + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (siteName === null || siteName === undefined || typeof siteName.valueOf() !== 'string') { + throw new Error('siteName cannot be null or undefined and it must be of type string.'); + } + if (detectorName === null || detectorName === undefined || typeof detectorName.valueOf() !== 'string') { + throw new Error('detectorName cannot be null or undefined and it must be of type string.'); + } + if (diagnosticCategory === null || diagnosticCategory === undefined || typeof diagnosticCategory.valueOf() !== 'string') { + throw new Error('diagnosticCategory cannot be null or undefined and it must be of type string.'); + } + if (startTime && !(startTime instanceof Date || + (typeof startTime.valueOf() === 'string' && !isNaN(Date.parse(startTime))))) { + throw new Error('startTime must be of type date.'); + } + if (endTime && !(endTime instanceof Date || + (typeof endTime.valueOf() === 'string' && !isNaN(Date.parse(endTime))))) { + throw new Error('endTime must be of type date.'); + } + if (timeGrain !== null && timeGrain !== undefined && typeof timeGrain.valueOf() !== 'string') { + throw new Error('timeGrain must be of type string.'); + } + if (timeGrain !== null && timeGrain !== undefined) { + if (timeGrain.match(/PT[1-9][0-9]+[SMH]/) === null) + { + throw new Error('"timeGrain" should satisfy the constraint - "Pattern": /PT[1-9][0-9]+[SMH]/'); + } + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/diagnostics/{diagnosticCategory}/detectors/{detectorName}/execute'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{siteName}', encodeURIComponent(siteName)); + requestUrl = requestUrl.replace('{detectorName}', encodeURIComponent(detectorName)); + requestUrl = requestUrl.replace('{diagnosticCategory}', encodeURIComponent(diagnosticCategory)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + if (startTime !== null && startTime !== undefined) { + queryParameters.push('startTime=' + encodeURIComponent(client.serializeObject(startTime))); + } + if (endTime !== null && endTime !== undefined) { + queryParameters.push('endTime=' + encodeURIComponent(client.serializeObject(endTime))); + } + if (timeGrain !== null && timeGrain !== undefined) { + queryParameters.push('timeGrain=' + encodeURIComponent(timeGrain)); + } + 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]; + } + } + } + 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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['DiagnosticDetectorResponse']().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 List Site Detector Responses + * + * List Site Detector Responses + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} siteName Site Name + * + * @param {string} slot Slot Name + * + * @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 DetectorResponseCollection} 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 _listSiteDetectorResponsesSlot(resourceGroupName, siteName, slot, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (siteName === null || siteName === undefined || typeof siteName.valueOf() !== 'string') { + throw new Error('siteName cannot be null or undefined and it must be of type string.'); + } + if (slot === null || slot === undefined || typeof slot.valueOf() !== 'string') { + throw new Error('slot cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/slots/{slot}/detectors'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{siteName}', encodeURIComponent(siteName)); + requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['DetectorResponseCollection']().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 Get site detector response + * + * Get site detector response + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} siteName Site Name + * + * @param {string} detectorName Detector Resource Name + * + * @param {string} slot Slot Name + * + * @param {object} [options] Optional Parameters. + * + * @param {date} [options.startTime] Start Time + * + * @param {date} [options.endTime] End Time + * + * @param {string} [options.timeGrain] Time Grain + * + * @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 DetectorResponse} 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 _getSiteDetectorResponseSlot(resourceGroupName, siteName, detectorName, slot, 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 startTime = (options && options.startTime !== undefined) ? options.startTime : undefined; + let endTime = (options && options.endTime !== undefined) ? options.endTime : undefined; + let timeGrain = (options && options.timeGrain !== undefined) ? options.timeGrain : undefined; + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (siteName === null || siteName === undefined || typeof siteName.valueOf() !== 'string') { + throw new Error('siteName cannot be null or undefined and it must be of type string.'); + } + if (detectorName === null || detectorName === undefined || typeof detectorName.valueOf() !== 'string') { + throw new Error('detectorName cannot be null or undefined and it must be of type string.'); + } + if (slot === null || slot === undefined || typeof slot.valueOf() !== 'string') { + throw new Error('slot cannot be null or undefined and it must be of type string.'); + } + if (startTime && !(startTime instanceof Date || + (typeof startTime.valueOf() === 'string' && !isNaN(Date.parse(startTime))))) { + throw new Error('startTime must be of type date.'); + } + if (endTime && !(endTime instanceof Date || + (typeof endTime.valueOf() === 'string' && !isNaN(Date.parse(endTime))))) { + throw new Error('endTime must be of type date.'); + } + if (timeGrain !== null && timeGrain !== undefined && typeof timeGrain.valueOf() !== 'string') { + throw new Error('timeGrain must be of type string.'); + } + if (timeGrain !== null && timeGrain !== undefined) { + if (timeGrain.match(/PT[1-9][0-9]+[SMH]/) === null) + { + throw new Error('"timeGrain" should satisfy the constraint - "Pattern": /PT[1-9][0-9]+[SMH]/'); + } + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/slots/{slot}/detectors/{detectorName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{siteName}', encodeURIComponent(siteName)); + requestUrl = requestUrl.replace('{detectorName}', encodeURIComponent(detectorName)); + requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + if (startTime !== null && startTime !== undefined) { + queryParameters.push('startTime=' + encodeURIComponent(client.serializeObject(startTime))); + } + if (endTime !== null && endTime !== undefined) { + queryParameters.push('endTime=' + encodeURIComponent(client.serializeObject(endTime))); + } + if (timeGrain !== null && timeGrain !== undefined) { + queryParameters.push('timeGrain=' + encodeURIComponent(timeGrain)); + } + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['DetectorResponse']().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 Get Diagnostics Categories + * + * Get Diagnostics Categories + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} siteName Site Name + * + * @param {string} slot Slot Name + * + * @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 DiagnosticCategoryCollection} 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 _listSiteDiagnosticCategoriesSlot(resourceGroupName, siteName, slot, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (siteName === null || siteName === undefined || typeof siteName.valueOf() !== 'string') { + throw new Error('siteName cannot be null or undefined and it must be of type string.'); + } + if (slot === null || slot === undefined || typeof slot.valueOf() !== 'string') { + throw new Error('slot cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/slots/{slot}/diagnostics'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{siteName}', encodeURIComponent(siteName)); + requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['DiagnosticCategoryCollection']().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 Get Diagnostics Category + * + * Get Diagnostics Category + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} siteName Site Name + * + * @param {string} diagnosticCategory Diagnostic Category + * + * @param {string} slot Slot Name + * + * @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 DiagnosticCategory} 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 _getSiteDiagnosticCategorySlot(resourceGroupName, siteName, diagnosticCategory, slot, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (siteName === null || siteName === undefined || typeof siteName.valueOf() !== 'string') { + throw new Error('siteName cannot be null or undefined and it must be of type string.'); + } + if (diagnosticCategory === null || diagnosticCategory === undefined || typeof diagnosticCategory.valueOf() !== 'string') { + throw new Error('diagnosticCategory cannot be null or undefined and it must be of type string.'); + } + if (slot === null || slot === undefined || typeof slot.valueOf() !== 'string') { + throw new Error('slot cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/slots/{slot}/diagnostics/{diagnosticCategory}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{siteName}', encodeURIComponent(siteName)); + requestUrl = requestUrl.replace('{diagnosticCategory}', encodeURIComponent(diagnosticCategory)); + requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['DiagnosticCategory']().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 Get Site Analyses + * + * Get Site Analyses + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} siteName Site Name + * + * @param {string} diagnosticCategory Diagnostic Category + * + * @param {string} slot Slot Name + * + * @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 DiagnosticAnalysisCollection} 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 _listSiteAnalysesSlot(resourceGroupName, siteName, diagnosticCategory, slot, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (siteName === null || siteName === undefined || typeof siteName.valueOf() !== 'string') { + throw new Error('siteName cannot be null or undefined and it must be of type string.'); + } + if (diagnosticCategory === null || diagnosticCategory === undefined || typeof diagnosticCategory.valueOf() !== 'string') { + throw new Error('diagnosticCategory cannot be null or undefined and it must be of type string.'); + } + if (slot === null || slot === undefined || typeof slot.valueOf() !== 'string') { + throw new Error('slot cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/slots/{slot}/diagnostics/{diagnosticCategory}/analyses'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{siteName}', encodeURIComponent(siteName)); + requestUrl = requestUrl.replace('{diagnosticCategory}', encodeURIComponent(diagnosticCategory)); + requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['DiagnosticAnalysisCollection']().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 Get Site Analysis + * + * Get Site Analysis + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} siteName Site Name + * + * @param {string} diagnosticCategory Diagnostic Category + * + * @param {string} analysisName Analysis Name + * + * @param {string} slot Slot - optional + * + * @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 DiagnosticAnalysis} 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 _getSiteAnalysisSlot(resourceGroupName, siteName, diagnosticCategory, analysisName, slot, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (siteName === null || siteName === undefined || typeof siteName.valueOf() !== 'string') { + throw new Error('siteName cannot be null or undefined and it must be of type string.'); + } + if (diagnosticCategory === null || diagnosticCategory === undefined || typeof diagnosticCategory.valueOf() !== 'string') { + throw new Error('diagnosticCategory cannot be null or undefined and it must be of type string.'); + } + if (analysisName === null || analysisName === undefined || typeof analysisName.valueOf() !== 'string') { + throw new Error('analysisName cannot be null or undefined and it must be of type string.'); + } + if (slot === null || slot === undefined || typeof slot.valueOf() !== 'string') { + throw new Error('slot cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/slots/{slot}/diagnostics/{diagnosticCategory}/analyses/{analysisName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{siteName}', encodeURIComponent(siteName)); + requestUrl = requestUrl.replace('{diagnosticCategory}', encodeURIComponent(diagnosticCategory)); + requestUrl = requestUrl.replace('{analysisName}', encodeURIComponent(analysisName)); + requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['DiagnosticAnalysis']().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 Execute Analysis + * + * Execute Analysis + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} siteName Site Name + * + * @param {string} diagnosticCategory Category Name + * + * @param {string} analysisName Analysis Resource Name + * + * @param {string} slot Slot Name + * + * @param {object} [options] Optional Parameters. + * + * @param {date} [options.startTime] Start Time + * + * @param {date} [options.endTime] End Time + * + * @param {string} [options.timeGrain] Time Grain + * + * @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 DiagnosticAnalysis} 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 _executeSiteAnalysisSlot(resourceGroupName, siteName, diagnosticCategory, analysisName, slot, 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 startTime = (options && options.startTime !== undefined) ? options.startTime : undefined; + let endTime = (options && options.endTime !== undefined) ? options.endTime : undefined; + let timeGrain = (options && options.timeGrain !== undefined) ? options.timeGrain : undefined; + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (siteName === null || siteName === undefined || typeof siteName.valueOf() !== 'string') { + throw new Error('siteName cannot be null or undefined and it must be of type string.'); + } + if (diagnosticCategory === null || diagnosticCategory === undefined || typeof diagnosticCategory.valueOf() !== 'string') { + throw new Error('diagnosticCategory cannot be null or undefined and it must be of type string.'); + } + if (analysisName === null || analysisName === undefined || typeof analysisName.valueOf() !== 'string') { + throw new Error('analysisName cannot be null or undefined and it must be of type string.'); + } + if (slot === null || slot === undefined || typeof slot.valueOf() !== 'string') { + throw new Error('slot cannot be null or undefined and it must be of type string.'); + } + if (startTime && !(startTime instanceof Date || + (typeof startTime.valueOf() === 'string' && !isNaN(Date.parse(startTime))))) { + throw new Error('startTime must be of type date.'); + } + if (endTime && !(endTime instanceof Date || + (typeof endTime.valueOf() === 'string' && !isNaN(Date.parse(endTime))))) { + throw new Error('endTime must be of type date.'); + } + if (timeGrain !== null && timeGrain !== undefined && typeof timeGrain.valueOf() !== 'string') { + throw new Error('timeGrain must be of type string.'); + } + if (timeGrain !== null && timeGrain !== undefined) { + if (timeGrain.match(/PT[1-9][0-9]+[SMH]/) === null) + { + throw new Error('"timeGrain" should satisfy the constraint - "Pattern": /PT[1-9][0-9]+[SMH]/'); + } + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/slots/{slot}/diagnostics/{diagnosticCategory}/analyses/{analysisName}/execute'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{siteName}', encodeURIComponent(siteName)); + requestUrl = requestUrl.replace('{diagnosticCategory}', encodeURIComponent(diagnosticCategory)); + requestUrl = requestUrl.replace('{analysisName}', encodeURIComponent(analysisName)); + requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + if (startTime !== null && startTime !== undefined) { + queryParameters.push('startTime=' + encodeURIComponent(client.serializeObject(startTime))); + } + if (endTime !== null && endTime !== undefined) { + queryParameters.push('endTime=' + encodeURIComponent(client.serializeObject(endTime))); + } + if (timeGrain !== null && timeGrain !== undefined) { + queryParameters.push('timeGrain=' + encodeURIComponent(timeGrain)); + } + 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]; + } + } + } + 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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['DiagnosticAnalysis']().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 Get Detectors + * + * Get Detectors + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} siteName Site Name + * + * @param {string} diagnosticCategory Diagnostic Category + * + * @param {string} slot Slot Name + * + * @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 DiagnosticDetectorCollection} 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 _listSiteDetectorsSlot(resourceGroupName, siteName, diagnosticCategory, slot, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (siteName === null || siteName === undefined || typeof siteName.valueOf() !== 'string') { + throw new Error('siteName cannot be null or undefined and it must be of type string.'); + } + if (diagnosticCategory === null || diagnosticCategory === undefined || typeof diagnosticCategory.valueOf() !== 'string') { + throw new Error('diagnosticCategory cannot be null or undefined and it must be of type string.'); + } + if (slot === null || slot === undefined || typeof slot.valueOf() !== 'string') { + throw new Error('slot cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/slots/{slot}/diagnostics/{diagnosticCategory}/detectors'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{siteName}', encodeURIComponent(siteName)); + requestUrl = requestUrl.replace('{diagnosticCategory}', encodeURIComponent(diagnosticCategory)); + requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['DiagnosticDetectorCollection']().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 Get Detector + * + * Get Detector + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} siteName Site Name + * + * @param {string} diagnosticCategory Diagnostic Category + * + * @param {string} detectorName Detector Name + * + * @param {string} slot Slot Name + * + * @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 DiagnosticDetectorCollection} 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 _getSiteDetectorSlot(resourceGroupName, siteName, diagnosticCategory, detectorName, slot, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (siteName === null || siteName === undefined || typeof siteName.valueOf() !== 'string') { + throw new Error('siteName cannot be null or undefined and it must be of type string.'); + } + if (diagnosticCategory === null || diagnosticCategory === undefined || typeof diagnosticCategory.valueOf() !== 'string') { + throw new Error('diagnosticCategory cannot be null or undefined and it must be of type string.'); + } + if (detectorName === null || detectorName === undefined || typeof detectorName.valueOf() !== 'string') { + throw new Error('detectorName cannot be null or undefined and it must be of type string.'); + } + if (slot === null || slot === undefined || typeof slot.valueOf() !== 'string') { + throw new Error('slot cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/slots/{slot}/diagnostics/{diagnosticCategory}/detectors/{detectorName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{siteName}', encodeURIComponent(siteName)); + requestUrl = requestUrl.replace('{diagnosticCategory}', encodeURIComponent(diagnosticCategory)); + requestUrl = requestUrl.replace('{detectorName}', encodeURIComponent(detectorName)); + requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['DiagnosticDetectorCollection']().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 Execute Detector + * + * Execute Detector + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} siteName Site Name + * + * @param {string} detectorName Detector Resource Name + * + * @param {string} diagnosticCategory Category Name + * + * @param {string} slot Slot Name + * + * @param {object} [options] Optional Parameters. + * + * @param {date} [options.startTime] Start Time + * + * @param {date} [options.endTime] End Time + * + * @param {string} [options.timeGrain] Time Grain + * + * @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 DiagnosticDetectorResponse} 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 _executeSiteDetectorSlot(resourceGroupName, siteName, detectorName, diagnosticCategory, slot, 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 startTime = (options && options.startTime !== undefined) ? options.startTime : undefined; + let endTime = (options && options.endTime !== undefined) ? options.endTime : undefined; + let timeGrain = (options && options.timeGrain !== undefined) ? options.timeGrain : undefined; + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (siteName === null || siteName === undefined || typeof siteName.valueOf() !== 'string') { + throw new Error('siteName cannot be null or undefined and it must be of type string.'); + } + if (detectorName === null || detectorName === undefined || typeof detectorName.valueOf() !== 'string') { + throw new Error('detectorName cannot be null or undefined and it must be of type string.'); + } + if (diagnosticCategory === null || diagnosticCategory === undefined || typeof diagnosticCategory.valueOf() !== 'string') { + throw new Error('diagnosticCategory cannot be null or undefined and it must be of type string.'); + } + if (slot === null || slot === undefined || typeof slot.valueOf() !== 'string') { + throw new Error('slot cannot be null or undefined and it must be of type string.'); + } + if (startTime && !(startTime instanceof Date || + (typeof startTime.valueOf() === 'string' && !isNaN(Date.parse(startTime))))) { + throw new Error('startTime must be of type date.'); + } + if (endTime && !(endTime instanceof Date || + (typeof endTime.valueOf() === 'string' && !isNaN(Date.parse(endTime))))) { + throw new Error('endTime must be of type date.'); + } + if (timeGrain !== null && timeGrain !== undefined && typeof timeGrain.valueOf() !== 'string') { + throw new Error('timeGrain must be of type string.'); + } + if (timeGrain !== null && timeGrain !== undefined) { + if (timeGrain.match(/PT[1-9][0-9]+[SMH]/) === null) + { + throw new Error('"timeGrain" should satisfy the constraint - "Pattern": /PT[1-9][0-9]+[SMH]/'); + } + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/slots/{slot}/diagnostics/{diagnosticCategory}/detectors/{detectorName}/execute'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{siteName}', encodeURIComponent(siteName)); + requestUrl = requestUrl.replace('{detectorName}', encodeURIComponent(detectorName)); + requestUrl = requestUrl.replace('{diagnosticCategory}', encodeURIComponent(diagnosticCategory)); + requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + if (startTime !== null && startTime !== undefined) { + queryParameters.push('startTime=' + encodeURIComponent(client.serializeObject(startTime))); + } + if (endTime !== null && endTime !== undefined) { + queryParameters.push('endTime=' + encodeURIComponent(client.serializeObject(endTime))); + } + if (timeGrain !== null && timeGrain !== undefined) { + queryParameters.push('timeGrain=' + encodeURIComponent(timeGrain)); + } + 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]; + } + } + } + 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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['DiagnosticDetectorResponse']().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 List Hosting Environment Detector Responses + * + * List Hosting Environment Detector Responses + * + * @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 DetectorResponseCollection} 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 _listHostingEnvironmentDetectorResponsesNext(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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['DetectorResponseCollection']().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 List Site Detector Responses + * + * List Site Detector Responses + * + * @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 DetectorResponseCollection} 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 _listSiteDetectorResponsesNext(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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['DetectorResponseCollection']().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 Get Diagnostics Categories + * + * Get Diagnostics Categories + * + * @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 DiagnosticCategoryCollection} 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 _listSiteDiagnosticCategoriesNext(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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['DiagnosticCategoryCollection']().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 Get Site Analyses + * + * Get Site Analyses + * + * @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 DiagnosticAnalysisCollection} 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 _listSiteAnalysesNext(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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['DiagnosticAnalysisCollection']().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 Get Detectors + * + * Get Detectors + * + * @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 DiagnosticDetectorCollection} 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 _listSiteDetectorsNext(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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['DiagnosticDetectorCollection']().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 Get Detector + * + * Get Detector + * + * @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 DiagnosticDetectorCollection} 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 _getSiteDetectorNext(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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['DiagnosticDetectorCollection']().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 List Site Detector Responses + * + * List Site Detector Responses + * + * @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 DetectorResponseCollection} 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 _listSiteDetectorResponsesSlotNext(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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['DetectorResponseCollection']().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 Get Diagnostics Categories + * + * Get Diagnostics Categories + * + * @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 DiagnosticCategoryCollection} 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 _listSiteDiagnosticCategoriesSlotNext(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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['DiagnosticCategoryCollection']().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 Get Site Analyses + * + * Get Site Analyses + * + * @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 DiagnosticAnalysisCollection} 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 _listSiteAnalysesSlotNext(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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['DiagnosticAnalysisCollection']().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 Get Detectors + * + * Get Detectors + * + * @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 DiagnosticDetectorCollection} 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 _listSiteDetectorsSlotNext(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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['DiagnosticDetectorCollection']().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 Get Detector + * + * Get Detector + * + * @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 DiagnosticDetectorCollection} 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 _getSiteDetectorSlotNext(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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['DiagnosticDetectorCollection']().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 Diagnostics. */ +class Diagnostics { + /** + * Create a Diagnostics. + * @param {WebSiteManagementClient} client Reference to the service client. + */ + constructor(client) { + this.client = client; + this._listHostingEnvironmentDetectorResponses = _listHostingEnvironmentDetectorResponses; + this._getHostingEnvironmentDetectorResponse = _getHostingEnvironmentDetectorResponse; + this._listSiteDetectorResponses = _listSiteDetectorResponses; + this._getSiteDetectorResponse = _getSiteDetectorResponse; + this._listSiteDiagnosticCategories = _listSiteDiagnosticCategories; + this._getSiteDiagnosticCategory = _getSiteDiagnosticCategory; + this._listSiteAnalyses = _listSiteAnalyses; + this._getSiteAnalysis = _getSiteAnalysis; + this._executeSiteAnalysis = _executeSiteAnalysis; + this._listSiteDetectors = _listSiteDetectors; + this._getSiteDetector = _getSiteDetector; + this._executeSiteDetector = _executeSiteDetector; + this._listSiteDetectorResponsesSlot = _listSiteDetectorResponsesSlot; + this._getSiteDetectorResponseSlot = _getSiteDetectorResponseSlot; + this._listSiteDiagnosticCategoriesSlot = _listSiteDiagnosticCategoriesSlot; + this._getSiteDiagnosticCategorySlot = _getSiteDiagnosticCategorySlot; + this._listSiteAnalysesSlot = _listSiteAnalysesSlot; + this._getSiteAnalysisSlot = _getSiteAnalysisSlot; + this._executeSiteAnalysisSlot = _executeSiteAnalysisSlot; + this._listSiteDetectorsSlot = _listSiteDetectorsSlot; + this._getSiteDetectorSlot = _getSiteDetectorSlot; + this._executeSiteDetectorSlot = _executeSiteDetectorSlot; + this._listHostingEnvironmentDetectorResponsesNext = _listHostingEnvironmentDetectorResponsesNext; + this._listSiteDetectorResponsesNext = _listSiteDetectorResponsesNext; + this._listSiteDiagnosticCategoriesNext = _listSiteDiagnosticCategoriesNext; + this._listSiteAnalysesNext = _listSiteAnalysesNext; + this._listSiteDetectorsNext = _listSiteDetectorsNext; + this._getSiteDetectorNext = _getSiteDetectorNext; + this._listSiteDetectorResponsesSlotNext = _listSiteDetectorResponsesSlotNext; + this._listSiteDiagnosticCategoriesSlotNext = _listSiteDiagnosticCategoriesSlotNext; + this._listSiteAnalysesSlotNext = _listSiteAnalysesSlotNext; + this._listSiteDetectorsSlotNext = _listSiteDetectorsSlotNext; + this._getSiteDetectorSlotNext = _getSiteDetectorSlotNext; + } + + /** + * @summary List Hosting Environment Detector Responses + * + * List Hosting Environment Detector Responses + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site Name + * + * @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. + */ + listHostingEnvironmentDetectorResponsesWithHttpOperationResponse(resourceGroupName, name, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listHostingEnvironmentDetectorResponses(resourceGroupName, name, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary List Hosting Environment Detector Responses + * + * List Hosting Environment Detector Responses + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site Name + * + * @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 {DetectorResponseCollection} - 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 DetectorResponseCollection} 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. + */ + listHostingEnvironmentDetectorResponses(resourceGroupName, name, 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._listHostingEnvironmentDetectorResponses(resourceGroupName, name, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listHostingEnvironmentDetectorResponses(resourceGroupName, name, options, optionalCallback); + } + } + + /** + * @summary Get Hosting Environment Detector Response + * + * Get Hosting Environment Detector Response + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name App Service Environment Name + * + * @param {string} detectorName Detector Resource Name + * + * @param {object} [options] Optional Parameters. + * + * @param {date} [options.startTime] Start Time + * + * @param {date} [options.endTime] End Time + * + * @param {string} [options.timeGrain] Time Grain + * + * @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. + */ + getHostingEnvironmentDetectorResponseWithHttpOperationResponse(resourceGroupName, name, detectorName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._getHostingEnvironmentDetectorResponse(resourceGroupName, name, detectorName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Get Hosting Environment Detector Response + * + * Get Hosting Environment Detector Response + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name App Service Environment Name + * + * @param {string} detectorName Detector Resource Name + * + * @param {object} [options] Optional Parameters. + * + * @param {date} [options.startTime] Start Time + * + * @param {date} [options.endTime] End Time + * + * @param {string} [options.timeGrain] Time Grain + * + * @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 {DetectorResponse} - 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 DetectorResponse} 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. + */ + getHostingEnvironmentDetectorResponse(resourceGroupName, name, detectorName, 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._getHostingEnvironmentDetectorResponse(resourceGroupName, name, detectorName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getHostingEnvironmentDetectorResponse(resourceGroupName, name, detectorName, options, optionalCallback); + } + } + + /** + * @summary List Site Detector Responses + * + * List Site Detector Responses + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} siteName Site Name + * + * @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. + */ + listSiteDetectorResponsesWithHttpOperationResponse(resourceGroupName, siteName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listSiteDetectorResponses(resourceGroupName, siteName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary List Site Detector Responses + * + * List Site Detector Responses + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} siteName Site Name + * + * @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 {DetectorResponseCollection} - 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 DetectorResponseCollection} 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. + */ + listSiteDetectorResponses(resourceGroupName, siteName, 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._listSiteDetectorResponses(resourceGroupName, siteName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listSiteDetectorResponses(resourceGroupName, siteName, options, optionalCallback); + } + } + + /** + * @summary Get site detector response + * + * Get site detector response + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} siteName Site Name + * + * @param {string} detectorName Detector Resource Name + * + * @param {object} [options] Optional Parameters. + * + * @param {date} [options.startTime] Start Time + * + * @param {date} [options.endTime] End Time + * + * @param {string} [options.timeGrain] Time Grain + * + * @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. + */ + getSiteDetectorResponseWithHttpOperationResponse(resourceGroupName, siteName, detectorName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._getSiteDetectorResponse(resourceGroupName, siteName, detectorName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Get site detector response + * + * Get site detector response + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} siteName Site Name + * + * @param {string} detectorName Detector Resource Name + * + * @param {object} [options] Optional Parameters. + * + * @param {date} [options.startTime] Start Time + * + * @param {date} [options.endTime] End Time + * + * @param {string} [options.timeGrain] Time Grain + * + * @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 {DetectorResponse} - 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 DetectorResponse} 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. + */ + getSiteDetectorResponse(resourceGroupName, siteName, detectorName, 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._getSiteDetectorResponse(resourceGroupName, siteName, detectorName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getSiteDetectorResponse(resourceGroupName, siteName, detectorName, options, optionalCallback); + } + } + + /** + * @summary Get Diagnostics Categories + * + * Get Diagnostics Categories + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} siteName Site Name + * + * @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. + */ + listSiteDiagnosticCategoriesWithHttpOperationResponse(resourceGroupName, siteName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listSiteDiagnosticCategories(resourceGroupName, siteName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Get Diagnostics Categories + * + * Get Diagnostics Categories + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} siteName Site Name + * + * @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 {DiagnosticCategoryCollection} - 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 DiagnosticCategoryCollection} 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. + */ + listSiteDiagnosticCategories(resourceGroupName, siteName, 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._listSiteDiagnosticCategories(resourceGroupName, siteName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listSiteDiagnosticCategories(resourceGroupName, siteName, options, optionalCallback); + } + } + + /** + * @summary Get Diagnostics Category + * + * Get Diagnostics Category + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} siteName Site Name + * + * @param {string} diagnosticCategory Diagnostic Category + * + * @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. + */ + getSiteDiagnosticCategoryWithHttpOperationResponse(resourceGroupName, siteName, diagnosticCategory, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._getSiteDiagnosticCategory(resourceGroupName, siteName, diagnosticCategory, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Get Diagnostics Category + * + * Get Diagnostics Category + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} siteName Site Name + * + * @param {string} diagnosticCategory Diagnostic Category + * + * @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 {DiagnosticCategory} - 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 DiagnosticCategory} 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. + */ + getSiteDiagnosticCategory(resourceGroupName, siteName, diagnosticCategory, 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._getSiteDiagnosticCategory(resourceGroupName, siteName, diagnosticCategory, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getSiteDiagnosticCategory(resourceGroupName, siteName, diagnosticCategory, options, optionalCallback); + } + } + + /** + * @summary Get Site Analyses + * + * Get Site Analyses + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} siteName Site Name + * + * @param {string} diagnosticCategory Diagnostic Category + * + * @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. + */ + listSiteAnalysesWithHttpOperationResponse(resourceGroupName, siteName, diagnosticCategory, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listSiteAnalyses(resourceGroupName, siteName, diagnosticCategory, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Get Site Analyses + * + * Get Site Analyses + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} siteName Site Name + * + * @param {string} diagnosticCategory Diagnostic Category + * + * @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 {DiagnosticAnalysisCollection} - 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 DiagnosticAnalysisCollection} 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. + */ + listSiteAnalyses(resourceGroupName, siteName, diagnosticCategory, 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._listSiteAnalyses(resourceGroupName, siteName, diagnosticCategory, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listSiteAnalyses(resourceGroupName, siteName, diagnosticCategory, options, optionalCallback); + } + } + + /** + * @summary Get Site Analysis + * + * Get Site Analysis + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} siteName Site Name + * + * @param {string} diagnosticCategory Diagnostic Category + * + * @param {string} analysisName Analysis Name + * + * @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. + */ + getSiteAnalysisWithHttpOperationResponse(resourceGroupName, siteName, diagnosticCategory, analysisName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._getSiteAnalysis(resourceGroupName, siteName, diagnosticCategory, analysisName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Get Site Analysis + * + * Get Site Analysis + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} siteName Site Name + * + * @param {string} diagnosticCategory Diagnostic Category + * + * @param {string} analysisName Analysis Name + * + * @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 {DiagnosticAnalysis} - 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 DiagnosticAnalysis} 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. + */ + getSiteAnalysis(resourceGroupName, siteName, diagnosticCategory, analysisName, 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._getSiteAnalysis(resourceGroupName, siteName, diagnosticCategory, analysisName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getSiteAnalysis(resourceGroupName, siteName, diagnosticCategory, analysisName, options, optionalCallback); + } + } + + /** + * @summary Execute Analysis + * + * Execute Analysis + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} siteName Site Name + * + * @param {string} diagnosticCategory Category Name + * + * @param {string} analysisName Analysis Resource Name + * + * @param {object} [options] Optional Parameters. + * + * @param {date} [options.startTime] Start Time + * + * @param {date} [options.endTime] End Time + * + * @param {string} [options.timeGrain] Time Grain + * + * @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. + */ + executeSiteAnalysisWithHttpOperationResponse(resourceGroupName, siteName, diagnosticCategory, analysisName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._executeSiteAnalysis(resourceGroupName, siteName, diagnosticCategory, analysisName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Execute Analysis + * + * Execute Analysis + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} siteName Site Name + * + * @param {string} diagnosticCategory Category Name + * + * @param {string} analysisName Analysis Resource Name + * + * @param {object} [options] Optional Parameters. + * + * @param {date} [options.startTime] Start Time + * + * @param {date} [options.endTime] End Time + * + * @param {string} [options.timeGrain] Time Grain + * + * @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 {DiagnosticAnalysis} - 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 DiagnosticAnalysis} 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. + */ + executeSiteAnalysis(resourceGroupName, siteName, diagnosticCategory, analysisName, 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._executeSiteAnalysis(resourceGroupName, siteName, diagnosticCategory, analysisName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._executeSiteAnalysis(resourceGroupName, siteName, diagnosticCategory, analysisName, options, optionalCallback); + } + } + + /** + * @summary Get Detectors + * + * Get Detectors + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} siteName Site Name + * + * @param {string} diagnosticCategory Diagnostic Category + * + * @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. + */ + listSiteDetectorsWithHttpOperationResponse(resourceGroupName, siteName, diagnosticCategory, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listSiteDetectors(resourceGroupName, siteName, diagnosticCategory, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Get Detectors + * + * Get Detectors + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} siteName Site Name + * + * @param {string} diagnosticCategory Diagnostic Category + * + * @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 {DiagnosticDetectorCollection} - 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 DiagnosticDetectorCollection} 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. + */ + listSiteDetectors(resourceGroupName, siteName, diagnosticCategory, 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._listSiteDetectors(resourceGroupName, siteName, diagnosticCategory, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listSiteDetectors(resourceGroupName, siteName, diagnosticCategory, options, optionalCallback); + } + } + + /** + * @summary Get Detector + * + * Get Detector + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} siteName Site Name + * + * @param {string} diagnosticCategory Diagnostic Category + * + * @param {string} detectorName Detector Name + * + * @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. + */ + getSiteDetectorWithHttpOperationResponse(resourceGroupName, siteName, diagnosticCategory, detectorName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._getSiteDetector(resourceGroupName, siteName, diagnosticCategory, detectorName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Get Detector + * + * Get Detector + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} siteName Site Name + * + * @param {string} diagnosticCategory Diagnostic Category + * + * @param {string} detectorName Detector Name + * + * @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 {DiagnosticDetectorCollection} - 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 DiagnosticDetectorCollection} 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. + */ + getSiteDetector(resourceGroupName, siteName, diagnosticCategory, detectorName, 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._getSiteDetector(resourceGroupName, siteName, diagnosticCategory, detectorName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getSiteDetector(resourceGroupName, siteName, diagnosticCategory, detectorName, options, optionalCallback); + } + } + + /** + * @summary Execute Detector + * + * Execute Detector + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} siteName Site Name + * + * @param {string} detectorName Detector Resource Name + * + * @param {string} diagnosticCategory Category Name + * + * @param {object} [options] Optional Parameters. + * + * @param {date} [options.startTime] Start Time + * + * @param {date} [options.endTime] End Time + * + * @param {string} [options.timeGrain] Time Grain + * + * @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. + */ + executeSiteDetectorWithHttpOperationResponse(resourceGroupName, siteName, detectorName, diagnosticCategory, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._executeSiteDetector(resourceGroupName, siteName, detectorName, diagnosticCategory, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Execute Detector + * + * Execute Detector + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} siteName Site Name + * + * @param {string} detectorName Detector Resource Name + * + * @param {string} diagnosticCategory Category Name + * + * @param {object} [options] Optional Parameters. + * + * @param {date} [options.startTime] Start Time + * + * @param {date} [options.endTime] End Time + * + * @param {string} [options.timeGrain] Time Grain + * + * @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 {DiagnosticDetectorResponse} - 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 DiagnosticDetectorResponse} 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. + */ + executeSiteDetector(resourceGroupName, siteName, detectorName, diagnosticCategory, 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._executeSiteDetector(resourceGroupName, siteName, detectorName, diagnosticCategory, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._executeSiteDetector(resourceGroupName, siteName, detectorName, diagnosticCategory, options, optionalCallback); + } + } + + /** + * @summary List Site Detector Responses + * + * List Site Detector Responses + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} siteName Site Name + * + * @param {string} slot Slot Name + * + * @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. + */ + listSiteDetectorResponsesSlotWithHttpOperationResponse(resourceGroupName, siteName, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listSiteDetectorResponsesSlot(resourceGroupName, siteName, slot, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary List Site Detector Responses + * + * List Site Detector Responses + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} siteName Site Name + * + * @param {string} slot Slot Name + * + * @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 {DetectorResponseCollection} - 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 DetectorResponseCollection} 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. + */ + listSiteDetectorResponsesSlot(resourceGroupName, siteName, slot, 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._listSiteDetectorResponsesSlot(resourceGroupName, siteName, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listSiteDetectorResponsesSlot(resourceGroupName, siteName, slot, options, optionalCallback); + } + } + + /** + * @summary Get site detector response + * + * Get site detector response + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} siteName Site Name + * + * @param {string} detectorName Detector Resource Name + * + * @param {string} slot Slot Name + * + * @param {object} [options] Optional Parameters. + * + * @param {date} [options.startTime] Start Time + * + * @param {date} [options.endTime] End Time + * + * @param {string} [options.timeGrain] Time Grain + * + * @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. + */ + getSiteDetectorResponseSlotWithHttpOperationResponse(resourceGroupName, siteName, detectorName, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._getSiteDetectorResponseSlot(resourceGroupName, siteName, detectorName, slot, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Get site detector response + * + * Get site detector response + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} siteName Site Name + * + * @param {string} detectorName Detector Resource Name + * + * @param {string} slot Slot Name + * + * @param {object} [options] Optional Parameters. + * + * @param {date} [options.startTime] Start Time + * + * @param {date} [options.endTime] End Time + * + * @param {string} [options.timeGrain] Time Grain + * + * @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 {DetectorResponse} - 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 DetectorResponse} 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. + */ + getSiteDetectorResponseSlot(resourceGroupName, siteName, detectorName, slot, 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._getSiteDetectorResponseSlot(resourceGroupName, siteName, detectorName, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getSiteDetectorResponseSlot(resourceGroupName, siteName, detectorName, slot, options, optionalCallback); + } + } + + /** + * @summary Get Diagnostics Categories + * + * Get Diagnostics Categories + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} siteName Site Name + * + * @param {string} slot Slot Name + * + * @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. + */ + listSiteDiagnosticCategoriesSlotWithHttpOperationResponse(resourceGroupName, siteName, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listSiteDiagnosticCategoriesSlot(resourceGroupName, siteName, slot, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Get Diagnostics Categories + * + * Get Diagnostics Categories + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} siteName Site Name + * + * @param {string} slot Slot Name + * + * @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 {DiagnosticCategoryCollection} - 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 DiagnosticCategoryCollection} 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. + */ + listSiteDiagnosticCategoriesSlot(resourceGroupName, siteName, slot, 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._listSiteDiagnosticCategoriesSlot(resourceGroupName, siteName, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listSiteDiagnosticCategoriesSlot(resourceGroupName, siteName, slot, options, optionalCallback); + } + } + + /** + * @summary Get Diagnostics Category + * + * Get Diagnostics Category + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} siteName Site Name + * + * @param {string} diagnosticCategory Diagnostic Category + * + * @param {string} slot Slot Name + * + * @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. + */ + getSiteDiagnosticCategorySlotWithHttpOperationResponse(resourceGroupName, siteName, diagnosticCategory, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._getSiteDiagnosticCategorySlot(resourceGroupName, siteName, diagnosticCategory, slot, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Get Diagnostics Category + * + * Get Diagnostics Category + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} siteName Site Name + * + * @param {string} diagnosticCategory Diagnostic Category + * + * @param {string} slot Slot Name + * + * @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 {DiagnosticCategory} - 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 DiagnosticCategory} 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. + */ + getSiteDiagnosticCategorySlot(resourceGroupName, siteName, diagnosticCategory, slot, 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._getSiteDiagnosticCategorySlot(resourceGroupName, siteName, diagnosticCategory, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getSiteDiagnosticCategorySlot(resourceGroupName, siteName, diagnosticCategory, slot, options, optionalCallback); + } + } + + /** + * @summary Get Site Analyses + * + * Get Site Analyses + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} siteName Site Name + * + * @param {string} diagnosticCategory Diagnostic Category + * + * @param {string} slot Slot Name + * + * @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. + */ + listSiteAnalysesSlotWithHttpOperationResponse(resourceGroupName, siteName, diagnosticCategory, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listSiteAnalysesSlot(resourceGroupName, siteName, diagnosticCategory, slot, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Get Site Analyses + * + * Get Site Analyses + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} siteName Site Name + * + * @param {string} diagnosticCategory Diagnostic Category + * + * @param {string} slot Slot Name + * + * @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 {DiagnosticAnalysisCollection} - 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 DiagnosticAnalysisCollection} 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. + */ + listSiteAnalysesSlot(resourceGroupName, siteName, diagnosticCategory, slot, 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._listSiteAnalysesSlot(resourceGroupName, siteName, diagnosticCategory, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listSiteAnalysesSlot(resourceGroupName, siteName, diagnosticCategory, slot, options, optionalCallback); + } + } + + /** + * @summary Get Site Analysis + * + * Get Site Analysis + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} siteName Site Name + * + * @param {string} diagnosticCategory Diagnostic Category + * + * @param {string} analysisName Analysis Name + * + * @param {string} slot Slot - optional + * + * @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. + */ + getSiteAnalysisSlotWithHttpOperationResponse(resourceGroupName, siteName, diagnosticCategory, analysisName, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._getSiteAnalysisSlot(resourceGroupName, siteName, diagnosticCategory, analysisName, slot, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Get Site Analysis + * + * Get Site Analysis + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} siteName Site Name + * + * @param {string} diagnosticCategory Diagnostic Category + * + * @param {string} analysisName Analysis Name + * + * @param {string} slot Slot - optional + * + * @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 {DiagnosticAnalysis} - 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 DiagnosticAnalysis} 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. + */ + getSiteAnalysisSlot(resourceGroupName, siteName, diagnosticCategory, analysisName, slot, 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._getSiteAnalysisSlot(resourceGroupName, siteName, diagnosticCategory, analysisName, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getSiteAnalysisSlot(resourceGroupName, siteName, diagnosticCategory, analysisName, slot, options, optionalCallback); + } + } + + /** + * @summary Execute Analysis + * + * Execute Analysis + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} siteName Site Name + * + * @param {string} diagnosticCategory Category Name + * + * @param {string} analysisName Analysis Resource Name + * + * @param {string} slot Slot Name + * + * @param {object} [options] Optional Parameters. + * + * @param {date} [options.startTime] Start Time + * + * @param {date} [options.endTime] End Time + * + * @param {string} [options.timeGrain] Time Grain + * + * @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. + */ + executeSiteAnalysisSlotWithHttpOperationResponse(resourceGroupName, siteName, diagnosticCategory, analysisName, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._executeSiteAnalysisSlot(resourceGroupName, siteName, diagnosticCategory, analysisName, slot, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Execute Analysis + * + * Execute Analysis + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} siteName Site Name + * + * @param {string} diagnosticCategory Category Name + * + * @param {string} analysisName Analysis Resource Name + * + * @param {string} slot Slot Name + * + * @param {object} [options] Optional Parameters. + * + * @param {date} [options.startTime] Start Time + * + * @param {date} [options.endTime] End Time + * + * @param {string} [options.timeGrain] Time Grain + * + * @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 {DiagnosticAnalysis} - 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 DiagnosticAnalysis} 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. + */ + executeSiteAnalysisSlot(resourceGroupName, siteName, diagnosticCategory, analysisName, slot, 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._executeSiteAnalysisSlot(resourceGroupName, siteName, diagnosticCategory, analysisName, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._executeSiteAnalysisSlot(resourceGroupName, siteName, diagnosticCategory, analysisName, slot, options, optionalCallback); + } + } + + /** + * @summary Get Detectors + * + * Get Detectors + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} siteName Site Name + * + * @param {string} diagnosticCategory Diagnostic Category + * + * @param {string} slot Slot Name + * + * @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. + */ + listSiteDetectorsSlotWithHttpOperationResponse(resourceGroupName, siteName, diagnosticCategory, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listSiteDetectorsSlot(resourceGroupName, siteName, diagnosticCategory, slot, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Get Detectors + * + * Get Detectors + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} siteName Site Name + * + * @param {string} diagnosticCategory Diagnostic Category + * + * @param {string} slot Slot Name + * + * @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 {DiagnosticDetectorCollection} - 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 DiagnosticDetectorCollection} 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. + */ + listSiteDetectorsSlot(resourceGroupName, siteName, diagnosticCategory, slot, 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._listSiteDetectorsSlot(resourceGroupName, siteName, diagnosticCategory, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listSiteDetectorsSlot(resourceGroupName, siteName, diagnosticCategory, slot, options, optionalCallback); + } + } + + /** + * @summary Get Detector + * + * Get Detector + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} siteName Site Name + * + * @param {string} diagnosticCategory Diagnostic Category + * + * @param {string} detectorName Detector Name + * + * @param {string} slot Slot Name + * + * @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. + */ + getSiteDetectorSlotWithHttpOperationResponse(resourceGroupName, siteName, diagnosticCategory, detectorName, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._getSiteDetectorSlot(resourceGroupName, siteName, diagnosticCategory, detectorName, slot, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Get Detector + * + * Get Detector + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} siteName Site Name + * + * @param {string} diagnosticCategory Diagnostic Category + * + * @param {string} detectorName Detector Name + * + * @param {string} slot Slot Name + * + * @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 {DiagnosticDetectorCollection} - 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 DiagnosticDetectorCollection} 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. + */ + getSiteDetectorSlot(resourceGroupName, siteName, diagnosticCategory, detectorName, slot, 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._getSiteDetectorSlot(resourceGroupName, siteName, diagnosticCategory, detectorName, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getSiteDetectorSlot(resourceGroupName, siteName, diagnosticCategory, detectorName, slot, options, optionalCallback); + } + } + + /** + * @summary Execute Detector + * + * Execute Detector + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} siteName Site Name + * + * @param {string} detectorName Detector Resource Name + * + * @param {string} diagnosticCategory Category Name + * + * @param {string} slot Slot Name + * + * @param {object} [options] Optional Parameters. + * + * @param {date} [options.startTime] Start Time + * + * @param {date} [options.endTime] End Time + * + * @param {string} [options.timeGrain] Time Grain + * + * @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. + */ + executeSiteDetectorSlotWithHttpOperationResponse(resourceGroupName, siteName, detectorName, diagnosticCategory, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._executeSiteDetectorSlot(resourceGroupName, siteName, detectorName, diagnosticCategory, slot, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Execute Detector + * + * Execute Detector + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} siteName Site Name + * + * @param {string} detectorName Detector Resource Name + * + * @param {string} diagnosticCategory Category Name + * + * @param {string} slot Slot Name + * + * @param {object} [options] Optional Parameters. + * + * @param {date} [options.startTime] Start Time + * + * @param {date} [options.endTime] End Time + * + * @param {string} [options.timeGrain] Time Grain + * + * @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 {DiagnosticDetectorResponse} - 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 DiagnosticDetectorResponse} 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. + */ + executeSiteDetectorSlot(resourceGroupName, siteName, detectorName, diagnosticCategory, slot, 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._executeSiteDetectorSlot(resourceGroupName, siteName, detectorName, diagnosticCategory, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._executeSiteDetectorSlot(resourceGroupName, siteName, detectorName, diagnosticCategory, slot, options, optionalCallback); + } + } + + /** + * @summary List Hosting Environment Detector Responses + * + * List Hosting Environment Detector Responses + * + * @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. + */ + listHostingEnvironmentDetectorResponsesNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listHostingEnvironmentDetectorResponsesNext(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 List Hosting Environment Detector Responses + * + * List Hosting Environment Detector Responses + * + * @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 {DetectorResponseCollection} - 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 DetectorResponseCollection} 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. + */ + listHostingEnvironmentDetectorResponsesNext(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._listHostingEnvironmentDetectorResponsesNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listHostingEnvironmentDetectorResponsesNext(nextPageLink, options, optionalCallback); + } + } + + /** + * @summary List Site Detector Responses + * + * List Site Detector Responses + * + * @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. + */ + listSiteDetectorResponsesNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listSiteDetectorResponsesNext(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 List Site Detector Responses + * + * List Site Detector Responses + * + * @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 {DetectorResponseCollection} - 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 DetectorResponseCollection} 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. + */ + listSiteDetectorResponsesNext(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._listSiteDetectorResponsesNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listSiteDetectorResponsesNext(nextPageLink, options, optionalCallback); + } + } + + /** + * @summary Get Diagnostics Categories + * + * Get Diagnostics Categories + * + * @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. + */ + listSiteDiagnosticCategoriesNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listSiteDiagnosticCategoriesNext(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 Get Diagnostics Categories + * + * Get Diagnostics Categories + * + * @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 {DiagnosticCategoryCollection} - 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 DiagnosticCategoryCollection} 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. + */ + listSiteDiagnosticCategoriesNext(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._listSiteDiagnosticCategoriesNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listSiteDiagnosticCategoriesNext(nextPageLink, options, optionalCallback); + } + } + + /** + * @summary Get Site Analyses + * + * Get Site Analyses + * + * @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. + */ + listSiteAnalysesNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listSiteAnalysesNext(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 Get Site Analyses + * + * Get Site Analyses + * + * @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 {DiagnosticAnalysisCollection} - 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 DiagnosticAnalysisCollection} 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. + */ + listSiteAnalysesNext(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._listSiteAnalysesNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listSiteAnalysesNext(nextPageLink, options, optionalCallback); + } + } + + /** + * @summary Get Detectors + * + * Get Detectors + * + * @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. + */ + listSiteDetectorsNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listSiteDetectorsNext(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 Get Detectors + * + * Get Detectors + * + * @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 {DiagnosticDetectorCollection} - 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 DiagnosticDetectorCollection} 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. + */ + listSiteDetectorsNext(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._listSiteDetectorsNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listSiteDetectorsNext(nextPageLink, options, optionalCallback); + } + } + + /** + * @summary Get Detector + * + * Get Detector + * + * @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. + */ + getSiteDetectorNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._getSiteDetectorNext(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 Get Detector + * + * Get Detector + * + * @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 {DiagnosticDetectorCollection} - 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 DiagnosticDetectorCollection} 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. + */ + getSiteDetectorNext(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._getSiteDetectorNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getSiteDetectorNext(nextPageLink, options, optionalCallback); + } + } + + /** + * @summary List Site Detector Responses + * + * List Site Detector Responses + * + * @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. + */ + listSiteDetectorResponsesSlotNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listSiteDetectorResponsesSlotNext(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 List Site Detector Responses + * + * List Site Detector Responses + * + * @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 {DetectorResponseCollection} - 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 DetectorResponseCollection} 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. + */ + listSiteDetectorResponsesSlotNext(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._listSiteDetectorResponsesSlotNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listSiteDetectorResponsesSlotNext(nextPageLink, options, optionalCallback); + } + } + + /** + * @summary Get Diagnostics Categories + * + * Get Diagnostics Categories + * + * @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. + */ + listSiteDiagnosticCategoriesSlotNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listSiteDiagnosticCategoriesSlotNext(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 Get Diagnostics Categories + * + * Get Diagnostics Categories + * + * @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 {DiagnosticCategoryCollection} - 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 DiagnosticCategoryCollection} 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. + */ + listSiteDiagnosticCategoriesSlotNext(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._listSiteDiagnosticCategoriesSlotNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listSiteDiagnosticCategoriesSlotNext(nextPageLink, options, optionalCallback); + } + } + + /** + * @summary Get Site Analyses + * + * Get Site Analyses + * + * @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. + */ + listSiteAnalysesSlotNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listSiteAnalysesSlotNext(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 Get Site Analyses + * + * Get Site Analyses + * + * @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 {DiagnosticAnalysisCollection} - 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 DiagnosticAnalysisCollection} 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. + */ + listSiteAnalysesSlotNext(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._listSiteAnalysesSlotNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listSiteAnalysesSlotNext(nextPageLink, options, optionalCallback); + } + } + + /** + * @summary Get Detectors + * + * Get Detectors + * + * @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. + */ + listSiteDetectorsSlotNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listSiteDetectorsSlotNext(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 Get Detectors + * + * Get Detectors + * + * @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 {DiagnosticDetectorCollection} - 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 DiagnosticDetectorCollection} 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. + */ + listSiteDetectorsSlotNext(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._listSiteDetectorsSlotNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listSiteDetectorsSlotNext(nextPageLink, options, optionalCallback); + } + } + + /** + * @summary Get Detector + * + * Get Detector + * + * @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. + */ + getSiteDetectorSlotNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._getSiteDetectorSlotNext(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 Get Detector + * + * Get Detector + * + * @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 {DiagnosticDetectorCollection} - 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 DiagnosticDetectorCollection} 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. + */ + getSiteDetectorSlotNext(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._getSiteDetectorSlotNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getSiteDetectorSlotNext(nextPageLink, options, optionalCallback); + } + } + +} + +module.exports = Diagnostics; diff --git a/lib/services/websiteManagement2/lib/operations/domainRegistrationProvider.js b/lib/services/websiteManagement2/lib/operations/domainRegistrationProvider.js new file mode 100644 index 0000000000..15f1b4c10e --- /dev/null +++ b/lib/services/websiteManagement2/lib/operations/domainRegistrationProvider.js @@ -0,0 +1,479 @@ +/* + * 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 Implements Csm operations Api to exposes the list of available Csm + * Apis under the resource provider + * + * Implements Csm operations Api to exposes the list of available Csm Apis + * under the resource provider + * + * @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 CsmOperationCollection} 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 _listOperations(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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'providers/Microsoft.DomainRegistration/operations'; + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['CsmOperationCollection']().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 Implements Csm operations Api to exposes the list of available Csm + * Apis under the resource provider + * + * Implements Csm operations Api to exposes the list of available Csm Apis + * under the resource provider + * + * @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 CsmOperationCollection} 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 _listOperationsNext(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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['CsmOperationCollection']().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 DomainRegistrationProvider. */ +class DomainRegistrationProvider { + /** + * Create a DomainRegistrationProvider. + * @param {WebSiteManagementClient} client Reference to the service client. + */ + constructor(client) { + this.client = client; + this._listOperations = _listOperations; + this._listOperationsNext = _listOperationsNext; + } + + /** + * @summary Implements Csm operations Api to exposes the list of available Csm + * Apis under the resource provider + * + * Implements Csm operations Api to exposes the list of available Csm Apis + * under the resource provider + * + * @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. + */ + listOperationsWithHttpOperationResponse(options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listOperations(options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Implements Csm operations Api to exposes the list of available Csm + * Apis under the resource provider + * + * Implements Csm operations Api to exposes the list of available Csm Apis + * under the resource provider + * + * @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 {CsmOperationCollection} - 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 CsmOperationCollection} 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. + */ + listOperations(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._listOperations(options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listOperations(options, optionalCallback); + } + } + + /** + * @summary Implements Csm operations Api to exposes the list of available Csm + * Apis under the resource provider + * + * Implements Csm operations Api to exposes the list of available Csm Apis + * under the resource provider + * + * @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. + */ + listOperationsNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listOperationsNext(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 Implements Csm operations Api to exposes the list of available Csm + * Apis under the resource provider + * + * Implements Csm operations Api to exposes the list of available Csm Apis + * under the resource provider + * + * @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 {CsmOperationCollection} - 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 CsmOperationCollection} 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. + */ + listOperationsNext(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._listOperationsNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listOperationsNext(nextPageLink, options, optionalCallback); + } + } + +} + +module.exports = DomainRegistrationProvider; diff --git a/lib/services/websiteManagement2/lib/operations/domains.js b/lib/services/websiteManagement2/lib/operations/domains.js new file mode 100644 index 0000000000..a1222e1242 --- /dev/null +++ b/lib/services/websiteManagement2/lib/operations/domains.js @@ -0,0 +1,5727 @@ +/* + * 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 Check if a domain is available for registration. + * + * Check if a domain is available for registration. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.name] Name of the object. + * + * @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 DomainAvailablilityCheckResult} 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 _checkAvailability(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 name = (options && options.name !== undefined) ? options.name : undefined; + // Validate + try { + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (name !== null && name !== undefined && typeof name.valueOf() !== 'string') { + throw new Error('name 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); + } + let identifier; + if (name !== null && name !== undefined) { + identifier = new client.models['NameIdentifier'](); + identifier.name = name; + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/providers/Microsoft.DomainRegistration/checkDomainAvailability'; + 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 (identifier !== null && identifier !== undefined) { + let requestModelMapper = new client.models['NameIdentifier']().mapper(); + requestModel = client.serialize(requestModelMapper, identifier, 'identifier'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(identifier, 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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['DomainAvailablilityCheckResult']().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 Get all domains in a subscription. + * + * Get all domains in a subscription. + * + * @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 DomainCollection} 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.'); + } + // Validate + try { + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/providers/Microsoft.DomainRegistration/domains'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['DomainCollection']().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 Generate a single sign-on request for the domain management portal. + * + * Generate a single sign-on request for the domain management portal. + * + * @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 DomainControlCenterSsoRequest} 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 _getControlCenterSsoRequest(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 (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/providers/Microsoft.DomainRegistration/generateSsoRequest'; + 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]; + } + } + } + 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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['DomainControlCenterSsoRequest']().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 Get domain name recommendations based on keywords. + * + * Get domain name recommendations based on keywords. + * + * @param {object} parameters Search parameters for domain name + * recommendations. + * + * @param {string} [parameters.keywords] Keywords to be used for generating + * domain recommendations. + * + * @param {number} [parameters.maxDomainRecommendations] Maximum number of + * recommendations. + * + * @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 NameIdentifierCollection} 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 _listRecommendations(parameters, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (parameters === null || parameters === undefined) { + throw new Error('parameters cannot be null or undefined.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/providers/Microsoft.DomainRegistration/listDomainRecommendations'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'POST'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (parameters !== null && parameters !== undefined) { + let requestModelMapper = new client.models['DomainRecommendationSearchParameters']().mapper(); + requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(parameters, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['NameIdentifierCollection']().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 Get all domains in a resource group. + * + * Get all domains in a resource group. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @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 DomainCollection} 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 _listByResourceGroup(resourceGroupName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DomainRegistration/domains'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['DomainCollection']().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 Get a domain. + * + * Get a domain. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} domainName Name of the domain. + * + * @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 Domain} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _get(resourceGroupName, domainName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (domainName === null || domainName === undefined || typeof domainName.valueOf() !== 'string') { + throw new Error('domainName cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DomainRegistration/domains/{domainName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{domainName}', encodeURIComponent(domainName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['Domain']().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 Creates or updates a domain. + * + * Creates or updates a domain. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} domainName Name of the domain. + * + * @param {object} domain Domain registration information. + * + * @param {object} domain.contactAdmin Administrative contact. + * + * @param {object} domain.contactBilling Billing contact. + * + * @param {object} domain.contactRegistrant Registrant contact. + * + * @param {object} domain.contactTech Technical contact. + * + * @param {object} [domain.contactTech.addressMailing] Mailing address. + * + * @param {string} domain.contactTech.addressMailing.address1 First line of an + * Address. + * + * @param {string} [domain.contactTech.addressMailing.address2] The second line + * of the Address. Optional. + * + * @param {string} domain.contactTech.addressMailing.city The city for the + * address. + * + * @param {string} domain.contactTech.addressMailing.country The country for + * the address. + * + * @param {string} domain.contactTech.addressMailing.postalCode The postal code + * for the address. + * + * @param {string} domain.contactTech.addressMailing.state The state or + * province for the address. + * + * @param {string} domain.contactTech.email Email address. + * + * @param {string} [domain.contactTech.fax] Fax number. + * + * @param {string} [domain.contactTech.jobTitle] Job title. + * + * @param {string} domain.contactTech.nameFirst First name. + * + * @param {string} domain.contactTech.nameLast Last name. + * + * @param {string} [domain.contactTech.nameMiddle] Middle name. + * + * @param {string} [domain.contactTech.organization] Organization contact + * belongs to. + * + * @param {string} domain.contactTech.phone Phone number. + * + * @param {boolean} [domain.privacy] true if domain privacy is + * enabled for this domain; otherwise, false. + * + * @param {boolean} [domain.autoRenew] true if the domain should + * be automatically renewed; otherwise, false. + * + * @param {object} domain.consent Legal agreement consent. + * + * @param {array} [domain.consent.agreementKeys] List of applicable legal + * agreement keys. This list can be retrieved using ListLegalAgreements API + * under TopLevelDomain resource. + * + * @param {string} [domain.consent.agreedBy] Client IP address. + * + * @param {date} [domain.consent.agreedAt] Timestamp when the agreements were + * accepted. + * + * @param {string} [domain.dnsType] Current DNS type. Possible values include: + * 'AzureDns', 'DefaultDomainRegistrarDns' + * + * @param {string} [domain.dnsZoneId] Azure DNS Zone to use + * + * @param {string} [domain.targetDnsType] Target DNS type (would be used for + * migration). Possible values include: 'AzureDns', 'DefaultDomainRegistrarDns' + * + * @param {string} [domain.authCode] + * + * @param {string} [domain.kind] Kind of resource. + * + * @param {string} domain.location Resource Location. + * + * @param {object} [domain.tags] Resource tags. + * + * @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 Domain} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _createOrUpdate(resourceGroupName, domainName, domain, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + + if (!callback) { + throw new Error('callback cannot be null.'); + } + + // Send request + this.beginCreateOrUpdate(resourceGroupName, domainName, domain, options, (err, parsedResult, httpRequest, response) => { + if (err) return callback(err); + + let initialResult = new msRest.HttpOperationResponse(); + initialResult.request = httpRequest; + initialResult.response = response; + initialResult.body = response.body; + client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { + if (err) return callback(err); + + // Create Result + let result = null; + + httpRequest = pollingResult.request; + response = pollingResult.response; + let responseBody = pollingResult.body; + if (responseBody === '') responseBody = null; + + // Deserialize Response + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['Domain']().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 Delete a domain. + * + * Delete a domain. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} domainName Name of the domain. + * + * @param {object} [options] Optional Parameters. + * + * @param {boolean} [options.forceHardDeleteDomain] Specify true + * to delete the domain immediately. The default is false which + * deletes the domain after 24 hours. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _deleteMethod(resourceGroupName, domainName, 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 forceHardDeleteDomain = (options && options.forceHardDeleteDomain !== undefined) ? options.forceHardDeleteDomain : undefined; + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (domainName === null || domainName === undefined || typeof domainName.valueOf() !== 'string') { + throw new Error('domainName cannot be null or undefined and it must be of type string.'); + } + if (forceHardDeleteDomain !== null && forceHardDeleteDomain !== undefined && typeof forceHardDeleteDomain !== 'boolean') { + throw new Error('forceHardDeleteDomain 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.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DomainRegistration/domains/{domainName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{domainName}', encodeURIComponent(domainName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + if (forceHardDeleteDomain !== null && forceHardDeleteDomain !== undefined) { + queryParameters.push('forceHardDeleteDomain=' + encodeURIComponent(forceHardDeleteDomain.toString())); + } + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'DELETE'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 204) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + + return callback(null, result, httpRequest, response); + }); +} + +/** + * @summary Creates or updates a domain. + * + * Creates or updates a domain. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} domainName Name of the domain. + * + * @param {object} domain Domain registration information. + * + * @param {object} domain.contactAdmin Administrative contact. + * + * @param {object} domain.contactBilling Billing contact. + * + * @param {object} domain.contactRegistrant Registrant contact. + * + * @param {object} domain.contactTech Technical contact. + * + * @param {object} [domain.contactTech.addressMailing] Mailing address. + * + * @param {string} domain.contactTech.addressMailing.address1 First line of an + * Address. + * + * @param {string} [domain.contactTech.addressMailing.address2] The second line + * of the Address. Optional. + * + * @param {string} domain.contactTech.addressMailing.city The city for the + * address. + * + * @param {string} domain.contactTech.addressMailing.country The country for + * the address. + * + * @param {string} domain.contactTech.addressMailing.postalCode The postal code + * for the address. + * + * @param {string} domain.contactTech.addressMailing.state The state or + * province for the address. + * + * @param {string} domain.contactTech.email Email address. + * + * @param {string} [domain.contactTech.fax] Fax number. + * + * @param {string} [domain.contactTech.jobTitle] Job title. + * + * @param {string} domain.contactTech.nameFirst First name. + * + * @param {string} domain.contactTech.nameLast Last name. + * + * @param {string} [domain.contactTech.nameMiddle] Middle name. + * + * @param {string} [domain.contactTech.organization] Organization contact + * belongs to. + * + * @param {string} domain.contactTech.phone Phone number. + * + * @param {boolean} [domain.privacy] true if domain privacy is + * enabled for this domain; otherwise, false. + * + * @param {boolean} [domain.autoRenew] true if the domain should + * be automatically renewed; otherwise, false. + * + * @param {object} domain.consent Legal agreement consent. + * + * @param {array} [domain.consent.agreementKeys] List of applicable legal + * agreement keys. This list can be retrieved using ListLegalAgreements API + * under TopLevelDomain resource. + * + * @param {string} [domain.consent.agreedBy] Client IP address. + * + * @param {date} [domain.consent.agreedAt] Timestamp when the agreements were + * accepted. + * + * @param {string} [domain.dnsType] Current DNS type. Possible values include: + * 'AzureDns', 'DefaultDomainRegistrarDns' + * + * @param {string} [domain.dnsZoneId] Azure DNS Zone to use + * + * @param {string} [domain.targetDnsType] Target DNS type (would be used for + * migration). Possible values include: 'AzureDns', 'DefaultDomainRegistrarDns' + * + * @param {string} [domain.authCode] + * + * @param {string} [domain.kind] Kind of resource. + * + * @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 Domain} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _update(resourceGroupName, domainName, domain, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (domainName === null || domainName === undefined || typeof domainName.valueOf() !== 'string') { + throw new Error('domainName cannot be null or undefined and it must be of type string.'); + } + if (domainName !== null && domainName !== undefined) { + if (domainName.match(/[a-zA-Z0-9][a-zA-Z0-9\.-]+/) === null) + { + throw new Error('"domainName" should satisfy the constraint - "Pattern": /[a-zA-Z0-9][a-zA-Z0-9\.-]+/'); + } + } + if (domain === null || domain === undefined) { + throw new Error('domain cannot be null or undefined.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DomainRegistration/domains/{domainName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{domainName}', encodeURIComponent(domainName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'PATCH'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (domain !== null && domain !== undefined) { + let requestModelMapper = new client.models['DomainPatchResource']().mapper(); + requestModel = client.serialize(requestModelMapper, domain, 'domain'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(domain, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 202) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['Domain']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + // Deserialize Response + if (statusCode === 202) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['Domain']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError1 = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError1.request = msRest.stripRequest(httpRequest); + deserializationError1.response = msRest.stripResponse(response); + return callback(deserializationError1); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * @summary Lists domain ownership identifiers. + * + * Lists domain ownership identifiers. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} domainName Name of domain. + * + * @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 DomainOwnershipIdentifierCollection} 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 _listOwnershipIdentifiers(resourceGroupName, domainName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (domainName === null || domainName === undefined || typeof domainName.valueOf() !== 'string') { + throw new Error('domainName cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DomainRegistration/domains/{domainName}/domainOwnershipIdentifiers'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{domainName}', encodeURIComponent(domainName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['DomainOwnershipIdentifierCollection']().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 Get ownership identifier for domain + * + * Get ownership identifier for domain + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} domainName Name of domain. + * + * @param {string} name Name of identifier. + * + * @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 DomainOwnershipIdentifier} 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 _getOwnershipIdentifier(resourceGroupName, domainName, name, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (domainName === null || domainName === undefined || typeof domainName.valueOf() !== 'string') { + throw new Error('domainName cannot be null or undefined and it must be of type string.'); + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DomainRegistration/domains/{domainName}/domainOwnershipIdentifiers/{name}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{domainName}', encodeURIComponent(domainName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['DomainOwnershipIdentifier']().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 Creates an ownership identifier for a domain or updates identifier + * details for an existing identifer + * + * Creates an ownership identifier for a domain or updates identifier details + * for an existing identifer + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} domainName Name of domain. + * + * @param {string} name Name of identifier. + * + * @param {object} domainOwnershipIdentifier A JSON representation of the + * domain ownership properties. + * + * @param {string} [domainOwnershipIdentifier.ownershipId] Ownership Id. + * + * @param {string} [domainOwnershipIdentifier.kind] Kind of resource. + * + * @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 DomainOwnershipIdentifier} 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 _createOrUpdateOwnershipIdentifier(resourceGroupName, domainName, name, domainOwnershipIdentifier, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (domainName === null || domainName === undefined || typeof domainName.valueOf() !== 'string') { + throw new Error('domainName cannot be null or undefined and it must be of type string.'); + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (domainOwnershipIdentifier === null || domainOwnershipIdentifier === undefined) { + throw new Error('domainOwnershipIdentifier cannot be null or undefined.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DomainRegistration/domains/{domainName}/domainOwnershipIdentifiers/{name}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{domainName}', encodeURIComponent(domainName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'PUT'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (domainOwnershipIdentifier !== null && domainOwnershipIdentifier !== undefined) { + let requestModelMapper = new client.models['DomainOwnershipIdentifier']().mapper(); + requestModel = client.serialize(requestModelMapper, domainOwnershipIdentifier, 'domainOwnershipIdentifier'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(domainOwnershipIdentifier, 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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['DomainOwnershipIdentifier']().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 Delete ownership identifier for domain + * + * Delete ownership identifier for domain + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} domainName Name of domain. + * + * @param {string} name Name of identifier. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _deleteOwnershipIdentifier(resourceGroupName, domainName, name, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (domainName === null || domainName === undefined || typeof domainName.valueOf() !== 'string') { + throw new Error('domainName cannot be null or undefined and it must be of type string.'); + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DomainRegistration/domains/{domainName}/domainOwnershipIdentifiers/{name}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{domainName}', encodeURIComponent(domainName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'DELETE'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 204) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + + return callback(null, result, httpRequest, response); + }); +} + +/** + * @summary Creates an ownership identifier for a domain or updates identifier + * details for an existing identifer + * + * Creates an ownership identifier for a domain or updates identifier details + * for an existing identifer + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} domainName Name of domain. + * + * @param {string} name Name of identifier. + * + * @param {object} domainOwnershipIdentifier A JSON representation of the + * domain ownership properties. + * + * @param {string} [domainOwnershipIdentifier.ownershipId] Ownership Id. + * + * @param {string} [domainOwnershipIdentifier.kind] Kind of resource. + * + * @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 DomainOwnershipIdentifier} 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 _updateOwnershipIdentifier(resourceGroupName, domainName, name, domainOwnershipIdentifier, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (domainName === null || domainName === undefined || typeof domainName.valueOf() !== 'string') { + throw new Error('domainName cannot be null or undefined and it must be of type string.'); + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (domainOwnershipIdentifier === null || domainOwnershipIdentifier === undefined) { + throw new Error('domainOwnershipIdentifier cannot be null or undefined.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DomainRegistration/domains/{domainName}/domainOwnershipIdentifiers/{name}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{domainName}', encodeURIComponent(domainName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'PATCH'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (domainOwnershipIdentifier !== null && domainOwnershipIdentifier !== undefined) { + let requestModelMapper = new client.models['DomainOwnershipIdentifier']().mapper(); + requestModel = client.serialize(requestModelMapper, domainOwnershipIdentifier, 'domainOwnershipIdentifier'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(domainOwnershipIdentifier, 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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['DomainOwnershipIdentifier']().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 Renew a domain. + * + * Renew a domain. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} domainName Name of the domain. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _renew(resourceGroupName, domainName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (domainName === null || domainName === undefined || typeof domainName.valueOf() !== 'string') { + throw new Error('domainName cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DomainRegistration/domains/{domainName}/renew'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{domainName}', encodeURIComponent(domainName)); + 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]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 202 && statusCode !== 204 && statusCode !== 400 && statusCode !== 500) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + + return callback(null, result, httpRequest, response); + }); +} + +/** + * @summary Creates or updates a domain. + * + * Creates or updates a domain. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} domainName Name of the domain. + * + * @param {object} domain Domain registration information. + * + * @param {object} domain.contactAdmin Administrative contact. + * + * @param {object} domain.contactBilling Billing contact. + * + * @param {object} domain.contactRegistrant Registrant contact. + * + * @param {object} domain.contactTech Technical contact. + * + * @param {object} [domain.contactTech.addressMailing] Mailing address. + * + * @param {string} domain.contactTech.addressMailing.address1 First line of an + * Address. + * + * @param {string} [domain.contactTech.addressMailing.address2] The second line + * of the Address. Optional. + * + * @param {string} domain.contactTech.addressMailing.city The city for the + * address. + * + * @param {string} domain.contactTech.addressMailing.country The country for + * the address. + * + * @param {string} domain.contactTech.addressMailing.postalCode The postal code + * for the address. + * + * @param {string} domain.contactTech.addressMailing.state The state or + * province for the address. + * + * @param {string} domain.contactTech.email Email address. + * + * @param {string} [domain.contactTech.fax] Fax number. + * + * @param {string} [domain.contactTech.jobTitle] Job title. + * + * @param {string} domain.contactTech.nameFirst First name. + * + * @param {string} domain.contactTech.nameLast Last name. + * + * @param {string} [domain.contactTech.nameMiddle] Middle name. + * + * @param {string} [domain.contactTech.organization] Organization contact + * belongs to. + * + * @param {string} domain.contactTech.phone Phone number. + * + * @param {boolean} [domain.privacy] true if domain privacy is + * enabled for this domain; otherwise, false. + * + * @param {boolean} [domain.autoRenew] true if the domain should + * be automatically renewed; otherwise, false. + * + * @param {object} domain.consent Legal agreement consent. + * + * @param {array} [domain.consent.agreementKeys] List of applicable legal + * agreement keys. This list can be retrieved using ListLegalAgreements API + * under TopLevelDomain resource. + * + * @param {string} [domain.consent.agreedBy] Client IP address. + * + * @param {date} [domain.consent.agreedAt] Timestamp when the agreements were + * accepted. + * + * @param {string} [domain.dnsType] Current DNS type. Possible values include: + * 'AzureDns', 'DefaultDomainRegistrarDns' + * + * @param {string} [domain.dnsZoneId] Azure DNS Zone to use + * + * @param {string} [domain.targetDnsType] Target DNS type (would be used for + * migration). Possible values include: 'AzureDns', 'DefaultDomainRegistrarDns' + * + * @param {string} [domain.authCode] + * + * @param {string} [domain.kind] Kind of resource. + * + * @param {string} domain.location Resource Location. + * + * @param {object} [domain.tags] Resource tags. + * + * @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 Domain} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _beginCreateOrUpdate(resourceGroupName, domainName, domain, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (domainName === null || domainName === undefined || typeof domainName.valueOf() !== 'string') { + throw new Error('domainName cannot be null or undefined and it must be of type string.'); + } + if (domainName !== null && domainName !== undefined) { + if (domainName.match(/[a-zA-Z0-9][a-zA-Z0-9\.-]+/) === null) + { + throw new Error('"domainName" should satisfy the constraint - "Pattern": /[a-zA-Z0-9][a-zA-Z0-9\.-]+/'); + } + } + if (domain === null || domain === undefined) { + throw new Error('domain cannot be null or undefined.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DomainRegistration/domains/{domainName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{domainName}', encodeURIComponent(domainName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'PUT'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (domain !== null && domain !== undefined) { + let requestModelMapper = new client.models['Domain']().mapper(); + requestModel = client.serialize(requestModelMapper, domain, 'domain'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(domain, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 202) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['Domain']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + // Deserialize Response + if (statusCode === 202) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['Domain']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError1 = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError1.request = msRest.stripRequest(httpRequest); + deserializationError1.response = msRest.stripResponse(response); + return callback(deserializationError1); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * @summary Get all domains in a subscription. + * + * Get all domains in a subscription. + * + * @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 DomainCollection} 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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['DomainCollection']().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 Get domain name recommendations based on keywords. + * + * Get domain name recommendations based on keywords. + * + * @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 NameIdentifierCollection} 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 _listRecommendationsNext(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 = '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]; + } + } + } + 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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['NameIdentifierCollection']().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 Get all domains in a resource group. + * + * Get all domains in a resource group. + * + * @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 DomainCollection} 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 _listByResourceGroupNext(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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['DomainCollection']().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 Lists domain ownership identifiers. + * + * Lists domain ownership identifiers. + * + * @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 DomainOwnershipIdentifierCollection} 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 _listOwnershipIdentifiersNext(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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['DomainOwnershipIdentifierCollection']().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 Domains. */ +class Domains { + /** + * Create a Domains. + * @param {WebSiteManagementClient} client Reference to the service client. + */ + constructor(client) { + this.client = client; + this._checkAvailability = _checkAvailability; + this._list = _list; + this._getControlCenterSsoRequest = _getControlCenterSsoRequest; + this._listRecommendations = _listRecommendations; + this._listByResourceGroup = _listByResourceGroup; + this._get = _get; + this._createOrUpdate = _createOrUpdate; + this._deleteMethod = _deleteMethod; + this._update = _update; + this._listOwnershipIdentifiers = _listOwnershipIdentifiers; + this._getOwnershipIdentifier = _getOwnershipIdentifier; + this._createOrUpdateOwnershipIdentifier = _createOrUpdateOwnershipIdentifier; + this._deleteOwnershipIdentifier = _deleteOwnershipIdentifier; + this._updateOwnershipIdentifier = _updateOwnershipIdentifier; + this._renew = _renew; + this._beginCreateOrUpdate = _beginCreateOrUpdate; + this._listNext = _listNext; + this._listRecommendationsNext = _listRecommendationsNext; + this._listByResourceGroupNext = _listByResourceGroupNext; + this._listOwnershipIdentifiersNext = _listOwnershipIdentifiersNext; + } + + /** + * @summary Check if a domain is available for registration. + * + * Check if a domain is available for registration. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.name] Name of the object. + * + * @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. + */ + checkAvailabilityWithHttpOperationResponse(options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._checkAvailability(options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Check if a domain is available for registration. + * + * Check if a domain is available for registration. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.name] Name of the object. + * + * @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 {DomainAvailablilityCheckResult} - 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 DomainAvailablilityCheckResult} 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. + */ + checkAvailability(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._checkAvailability(options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._checkAvailability(options, optionalCallback); + } + } + + /** + * @summary Get all domains in a subscription. + * + * Get all domains in a subscription. + * + * @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. + */ + 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 Get all domains in a subscription. + * + * Get all domains in a subscription. + * + * @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 {DomainCollection} - 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 DomainCollection} 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 Generate a single sign-on request for the domain management portal. + * + * Generate a single sign-on request for the domain management portal. + * + * @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. + */ + getControlCenterSsoRequestWithHttpOperationResponse(options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._getControlCenterSsoRequest(options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Generate a single sign-on request for the domain management portal. + * + * Generate a single sign-on request for the domain management portal. + * + * @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 {DomainControlCenterSsoRequest} - 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 DomainControlCenterSsoRequest} 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. + */ + getControlCenterSsoRequest(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._getControlCenterSsoRequest(options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getControlCenterSsoRequest(options, optionalCallback); + } + } + + /** + * @summary Get domain name recommendations based on keywords. + * + * Get domain name recommendations based on keywords. + * + * @param {object} parameters Search parameters for domain name + * recommendations. + * + * @param {string} [parameters.keywords] Keywords to be used for generating + * domain recommendations. + * + * @param {number} [parameters.maxDomainRecommendations] Maximum number of + * recommendations. + * + * @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. + */ + listRecommendationsWithHttpOperationResponse(parameters, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listRecommendations(parameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Get domain name recommendations based on keywords. + * + * Get domain name recommendations based on keywords. + * + * @param {object} parameters Search parameters for domain name + * recommendations. + * + * @param {string} [parameters.keywords] Keywords to be used for generating + * domain recommendations. + * + * @param {number} [parameters.maxDomainRecommendations] Maximum number of + * recommendations. + * + * @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 {NameIdentifierCollection} - 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 NameIdentifierCollection} 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. + */ + listRecommendations(parameters, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._listRecommendations(parameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listRecommendations(parameters, options, optionalCallback); + } + } + + /** + * @summary Get all domains in a resource group. + * + * Get all domains in a resource group. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @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. + */ + listByResourceGroupWithHttpOperationResponse(resourceGroupName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listByResourceGroup(resourceGroupName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Get all domains in a resource group. + * + * Get all domains in a resource group. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @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 {DomainCollection} - 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 DomainCollection} 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. + */ + listByResourceGroup(resourceGroupName, 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._listByResourceGroup(resourceGroupName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listByResourceGroup(resourceGroupName, options, optionalCallback); + } + } + + /** + * @summary Get a domain. + * + * Get a domain. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} domainName Name of the domain. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + getWithHttpOperationResponse(resourceGroupName, domainName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._get(resourceGroupName, domainName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Get a domain. + * + * Get a domain. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} domainName Name of the domain. + * + * @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 {Domain} - 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 Domain} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + get(resourceGroupName, domainName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._get(resourceGroupName, domainName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._get(resourceGroupName, domainName, options, optionalCallback); + } + } + + /** + * @summary Creates or updates a domain. + * + * Creates or updates a domain. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} domainName Name of the domain. + * + * @param {object} domain Domain registration information. + * + * @param {object} domain.contactAdmin Administrative contact. + * + * @param {object} domain.contactBilling Billing contact. + * + * @param {object} domain.contactRegistrant Registrant contact. + * + * @param {object} domain.contactTech Technical contact. + * + * @param {object} [domain.contactTech.addressMailing] Mailing address. + * + * @param {string} domain.contactTech.addressMailing.address1 First line of an + * Address. + * + * @param {string} [domain.contactTech.addressMailing.address2] The second line + * of the Address. Optional. + * + * @param {string} domain.contactTech.addressMailing.city The city for the + * address. + * + * @param {string} domain.contactTech.addressMailing.country The country for + * the address. + * + * @param {string} domain.contactTech.addressMailing.postalCode The postal code + * for the address. + * + * @param {string} domain.contactTech.addressMailing.state The state or + * province for the address. + * + * @param {string} domain.contactTech.email Email address. + * + * @param {string} [domain.contactTech.fax] Fax number. + * + * @param {string} [domain.contactTech.jobTitle] Job title. + * + * @param {string} domain.contactTech.nameFirst First name. + * + * @param {string} domain.contactTech.nameLast Last name. + * + * @param {string} [domain.contactTech.nameMiddle] Middle name. + * + * @param {string} [domain.contactTech.organization] Organization contact + * belongs to. + * + * @param {string} domain.contactTech.phone Phone number. + * + * @param {boolean} [domain.privacy] true if domain privacy is + * enabled for this domain; otherwise, false. + * + * @param {boolean} [domain.autoRenew] true if the domain should + * be automatically renewed; otherwise, false. + * + * @param {object} domain.consent Legal agreement consent. + * + * @param {array} [domain.consent.agreementKeys] List of applicable legal + * agreement keys. This list can be retrieved using ListLegalAgreements API + * under TopLevelDomain resource. + * + * @param {string} [domain.consent.agreedBy] Client IP address. + * + * @param {date} [domain.consent.agreedAt] Timestamp when the agreements were + * accepted. + * + * @param {string} [domain.dnsType] Current DNS type. Possible values include: + * 'AzureDns', 'DefaultDomainRegistrarDns' + * + * @param {string} [domain.dnsZoneId] Azure DNS Zone to use + * + * @param {string} [domain.targetDnsType] Target DNS type (would be used for + * migration). Possible values include: 'AzureDns', 'DefaultDomainRegistrarDns' + * + * @param {string} [domain.authCode] + * + * @param {string} [domain.kind] Kind of resource. + * + * @param {string} domain.location Resource Location. + * + * @param {object} [domain.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + createOrUpdateWithHttpOperationResponse(resourceGroupName, domainName, domain, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._createOrUpdate(resourceGroupName, domainName, domain, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Creates or updates a domain. + * + * Creates or updates a domain. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} domainName Name of the domain. + * + * @param {object} domain Domain registration information. + * + * @param {object} domain.contactAdmin Administrative contact. + * + * @param {object} domain.contactBilling Billing contact. + * + * @param {object} domain.contactRegistrant Registrant contact. + * + * @param {object} domain.contactTech Technical contact. + * + * @param {object} [domain.contactTech.addressMailing] Mailing address. + * + * @param {string} domain.contactTech.addressMailing.address1 First line of an + * Address. + * + * @param {string} [domain.contactTech.addressMailing.address2] The second line + * of the Address. Optional. + * + * @param {string} domain.contactTech.addressMailing.city The city for the + * address. + * + * @param {string} domain.contactTech.addressMailing.country The country for + * the address. + * + * @param {string} domain.contactTech.addressMailing.postalCode The postal code + * for the address. + * + * @param {string} domain.contactTech.addressMailing.state The state or + * province for the address. + * + * @param {string} domain.contactTech.email Email address. + * + * @param {string} [domain.contactTech.fax] Fax number. + * + * @param {string} [domain.contactTech.jobTitle] Job title. + * + * @param {string} domain.contactTech.nameFirst First name. + * + * @param {string} domain.contactTech.nameLast Last name. + * + * @param {string} [domain.contactTech.nameMiddle] Middle name. + * + * @param {string} [domain.contactTech.organization] Organization contact + * belongs to. + * + * @param {string} domain.contactTech.phone Phone number. + * + * @param {boolean} [domain.privacy] true if domain privacy is + * enabled for this domain; otherwise, false. + * + * @param {boolean} [domain.autoRenew] true if the domain should + * be automatically renewed; otherwise, false. + * + * @param {object} domain.consent Legal agreement consent. + * + * @param {array} [domain.consent.agreementKeys] List of applicable legal + * agreement keys. This list can be retrieved using ListLegalAgreements API + * under TopLevelDomain resource. + * + * @param {string} [domain.consent.agreedBy] Client IP address. + * + * @param {date} [domain.consent.agreedAt] Timestamp when the agreements were + * accepted. + * + * @param {string} [domain.dnsType] Current DNS type. Possible values include: + * 'AzureDns', 'DefaultDomainRegistrarDns' + * + * @param {string} [domain.dnsZoneId] Azure DNS Zone to use + * + * @param {string} [domain.targetDnsType] Target DNS type (would be used for + * migration). Possible values include: 'AzureDns', 'DefaultDomainRegistrarDns' + * + * @param {string} [domain.authCode] + * + * @param {string} [domain.kind] Kind of resource. + * + * @param {string} domain.location Resource Location. + * + * @param {object} [domain.tags] Resource tags. + * + * @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 {Domain} - 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 Domain} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + createOrUpdate(resourceGroupName, domainName, domain, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._createOrUpdate(resourceGroupName, domainName, domain, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._createOrUpdate(resourceGroupName, domainName, domain, options, optionalCallback); + } + } + + /** + * @summary Delete a domain. + * + * Delete a domain. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} domainName Name of the domain. + * + * @param {object} [options] Optional Parameters. + * + * @param {boolean} [options.forceHardDeleteDomain] Specify true + * to delete the domain immediately. The default is false which + * deletes the domain after 24 hours. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + deleteMethodWithHttpOperationResponse(resourceGroupName, domainName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._deleteMethod(resourceGroupName, domainName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Delete a domain. + * + * Delete a domain. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} domainName Name of the domain. + * + * @param {object} [options] Optional Parameters. + * + * @param {boolean} [options.forceHardDeleteDomain] Specify true + * to delete the domain immediately. The default is false which + * deletes the domain after 24 hours. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + deleteMethod(resourceGroupName, domainName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._deleteMethod(resourceGroupName, domainName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._deleteMethod(resourceGroupName, domainName, options, optionalCallback); + } + } + + /** + * @summary Creates or updates a domain. + * + * Creates or updates a domain. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} domainName Name of the domain. + * + * @param {object} domain Domain registration information. + * + * @param {object} domain.contactAdmin Administrative contact. + * + * @param {object} domain.contactBilling Billing contact. + * + * @param {object} domain.contactRegistrant Registrant contact. + * + * @param {object} domain.contactTech Technical contact. + * + * @param {object} [domain.contactTech.addressMailing] Mailing address. + * + * @param {string} domain.contactTech.addressMailing.address1 First line of an + * Address. + * + * @param {string} [domain.contactTech.addressMailing.address2] The second line + * of the Address. Optional. + * + * @param {string} domain.contactTech.addressMailing.city The city for the + * address. + * + * @param {string} domain.contactTech.addressMailing.country The country for + * the address. + * + * @param {string} domain.contactTech.addressMailing.postalCode The postal code + * for the address. + * + * @param {string} domain.contactTech.addressMailing.state The state or + * province for the address. + * + * @param {string} domain.contactTech.email Email address. + * + * @param {string} [domain.contactTech.fax] Fax number. + * + * @param {string} [domain.contactTech.jobTitle] Job title. + * + * @param {string} domain.contactTech.nameFirst First name. + * + * @param {string} domain.contactTech.nameLast Last name. + * + * @param {string} [domain.contactTech.nameMiddle] Middle name. + * + * @param {string} [domain.contactTech.organization] Organization contact + * belongs to. + * + * @param {string} domain.contactTech.phone Phone number. + * + * @param {boolean} [domain.privacy] true if domain privacy is + * enabled for this domain; otherwise, false. + * + * @param {boolean} [domain.autoRenew] true if the domain should + * be automatically renewed; otherwise, false. + * + * @param {object} domain.consent Legal agreement consent. + * + * @param {array} [domain.consent.agreementKeys] List of applicable legal + * agreement keys. This list can be retrieved using ListLegalAgreements API + * under TopLevelDomain resource. + * + * @param {string} [domain.consent.agreedBy] Client IP address. + * + * @param {date} [domain.consent.agreedAt] Timestamp when the agreements were + * accepted. + * + * @param {string} [domain.dnsType] Current DNS type. Possible values include: + * 'AzureDns', 'DefaultDomainRegistrarDns' + * + * @param {string} [domain.dnsZoneId] Azure DNS Zone to use + * + * @param {string} [domain.targetDnsType] Target DNS type (would be used for + * migration). Possible values include: 'AzureDns', 'DefaultDomainRegistrarDns' + * + * @param {string} [domain.authCode] + * + * @param {string} [domain.kind] Kind of resource. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + updateWithHttpOperationResponse(resourceGroupName, domainName, domain, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._update(resourceGroupName, domainName, domain, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Creates or updates a domain. + * + * Creates or updates a domain. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} domainName Name of the domain. + * + * @param {object} domain Domain registration information. + * + * @param {object} domain.contactAdmin Administrative contact. + * + * @param {object} domain.contactBilling Billing contact. + * + * @param {object} domain.contactRegistrant Registrant contact. + * + * @param {object} domain.contactTech Technical contact. + * + * @param {object} [domain.contactTech.addressMailing] Mailing address. + * + * @param {string} domain.contactTech.addressMailing.address1 First line of an + * Address. + * + * @param {string} [domain.contactTech.addressMailing.address2] The second line + * of the Address. Optional. + * + * @param {string} domain.contactTech.addressMailing.city The city for the + * address. + * + * @param {string} domain.contactTech.addressMailing.country The country for + * the address. + * + * @param {string} domain.contactTech.addressMailing.postalCode The postal code + * for the address. + * + * @param {string} domain.contactTech.addressMailing.state The state or + * province for the address. + * + * @param {string} domain.contactTech.email Email address. + * + * @param {string} [domain.contactTech.fax] Fax number. + * + * @param {string} [domain.contactTech.jobTitle] Job title. + * + * @param {string} domain.contactTech.nameFirst First name. + * + * @param {string} domain.contactTech.nameLast Last name. + * + * @param {string} [domain.contactTech.nameMiddle] Middle name. + * + * @param {string} [domain.contactTech.organization] Organization contact + * belongs to. + * + * @param {string} domain.contactTech.phone Phone number. + * + * @param {boolean} [domain.privacy] true if domain privacy is + * enabled for this domain; otherwise, false. + * + * @param {boolean} [domain.autoRenew] true if the domain should + * be automatically renewed; otherwise, false. + * + * @param {object} domain.consent Legal agreement consent. + * + * @param {array} [domain.consent.agreementKeys] List of applicable legal + * agreement keys. This list can be retrieved using ListLegalAgreements API + * under TopLevelDomain resource. + * + * @param {string} [domain.consent.agreedBy] Client IP address. + * + * @param {date} [domain.consent.agreedAt] Timestamp when the agreements were + * accepted. + * + * @param {string} [domain.dnsType] Current DNS type. Possible values include: + * 'AzureDns', 'DefaultDomainRegistrarDns' + * + * @param {string} [domain.dnsZoneId] Azure DNS Zone to use + * + * @param {string} [domain.targetDnsType] Target DNS type (would be used for + * migration). Possible values include: 'AzureDns', 'DefaultDomainRegistrarDns' + * + * @param {string} [domain.authCode] + * + * @param {string} [domain.kind] Kind of resource. + * + * @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 {Domain} - 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 Domain} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + update(resourceGroupName, domainName, domain, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._update(resourceGroupName, domainName, domain, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._update(resourceGroupName, domainName, domain, options, optionalCallback); + } + } + + /** + * @summary Lists domain ownership identifiers. + * + * Lists domain ownership identifiers. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} domainName Name of domain. + * + * @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. + */ + listOwnershipIdentifiersWithHttpOperationResponse(resourceGroupName, domainName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listOwnershipIdentifiers(resourceGroupName, domainName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Lists domain ownership identifiers. + * + * Lists domain ownership identifiers. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} domainName Name of domain. + * + * @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 {DomainOwnershipIdentifierCollection} - 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 DomainOwnershipIdentifierCollection} 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. + */ + listOwnershipIdentifiers(resourceGroupName, domainName, 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._listOwnershipIdentifiers(resourceGroupName, domainName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listOwnershipIdentifiers(resourceGroupName, domainName, options, optionalCallback); + } + } + + /** + * @summary Get ownership identifier for domain + * + * Get ownership identifier for domain + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} domainName Name of domain. + * + * @param {string} name Name of identifier. + * + * @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. + */ + getOwnershipIdentifierWithHttpOperationResponse(resourceGroupName, domainName, name, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._getOwnershipIdentifier(resourceGroupName, domainName, name, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Get ownership identifier for domain + * + * Get ownership identifier for domain + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} domainName Name of domain. + * + * @param {string} name Name of identifier. + * + * @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 {DomainOwnershipIdentifier} - 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 DomainOwnershipIdentifier} 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. + */ + getOwnershipIdentifier(resourceGroupName, domainName, name, 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._getOwnershipIdentifier(resourceGroupName, domainName, name, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getOwnershipIdentifier(resourceGroupName, domainName, name, options, optionalCallback); + } + } + + /** + * @summary Creates an ownership identifier for a domain or updates identifier + * details for an existing identifer + * + * Creates an ownership identifier for a domain or updates identifier details + * for an existing identifer + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} domainName Name of domain. + * + * @param {string} name Name of identifier. + * + * @param {object} domainOwnershipIdentifier A JSON representation of the + * domain ownership properties. + * + * @param {string} [domainOwnershipIdentifier.ownershipId] Ownership Id. + * + * @param {string} [domainOwnershipIdentifier.kind] Kind of resource. + * + * @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. + */ + createOrUpdateOwnershipIdentifierWithHttpOperationResponse(resourceGroupName, domainName, name, domainOwnershipIdentifier, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._createOrUpdateOwnershipIdentifier(resourceGroupName, domainName, name, domainOwnershipIdentifier, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Creates an ownership identifier for a domain or updates identifier + * details for an existing identifer + * + * Creates an ownership identifier for a domain or updates identifier details + * for an existing identifer + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} domainName Name of domain. + * + * @param {string} name Name of identifier. + * + * @param {object} domainOwnershipIdentifier A JSON representation of the + * domain ownership properties. + * + * @param {string} [domainOwnershipIdentifier.ownershipId] Ownership Id. + * + * @param {string} [domainOwnershipIdentifier.kind] Kind of resource. + * + * @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 {DomainOwnershipIdentifier} - 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 DomainOwnershipIdentifier} 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. + */ + createOrUpdateOwnershipIdentifier(resourceGroupName, domainName, name, domainOwnershipIdentifier, 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._createOrUpdateOwnershipIdentifier(resourceGroupName, domainName, name, domainOwnershipIdentifier, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._createOrUpdateOwnershipIdentifier(resourceGroupName, domainName, name, domainOwnershipIdentifier, options, optionalCallback); + } + } + + /** + * @summary Delete ownership identifier for domain + * + * Delete ownership identifier for domain + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} domainName Name of domain. + * + * @param {string} name Name of identifier. + * + * @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. + */ + deleteOwnershipIdentifierWithHttpOperationResponse(resourceGroupName, domainName, name, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._deleteOwnershipIdentifier(resourceGroupName, domainName, name, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Delete ownership identifier for domain + * + * Delete ownership identifier for domain + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} domainName Name of domain. + * + * @param {string} name Name of identifier. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + deleteOwnershipIdentifier(resourceGroupName, domainName, name, 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._deleteOwnershipIdentifier(resourceGroupName, domainName, name, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._deleteOwnershipIdentifier(resourceGroupName, domainName, name, options, optionalCallback); + } + } + + /** + * @summary Creates an ownership identifier for a domain or updates identifier + * details for an existing identifer + * + * Creates an ownership identifier for a domain or updates identifier details + * for an existing identifer + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} domainName Name of domain. + * + * @param {string} name Name of identifier. + * + * @param {object} domainOwnershipIdentifier A JSON representation of the + * domain ownership properties. + * + * @param {string} [domainOwnershipIdentifier.ownershipId] Ownership Id. + * + * @param {string} [domainOwnershipIdentifier.kind] Kind of resource. + * + * @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. + */ + updateOwnershipIdentifierWithHttpOperationResponse(resourceGroupName, domainName, name, domainOwnershipIdentifier, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._updateOwnershipIdentifier(resourceGroupName, domainName, name, domainOwnershipIdentifier, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Creates an ownership identifier for a domain or updates identifier + * details for an existing identifer + * + * Creates an ownership identifier for a domain or updates identifier details + * for an existing identifer + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} domainName Name of domain. + * + * @param {string} name Name of identifier. + * + * @param {object} domainOwnershipIdentifier A JSON representation of the + * domain ownership properties. + * + * @param {string} [domainOwnershipIdentifier.ownershipId] Ownership Id. + * + * @param {string} [domainOwnershipIdentifier.kind] Kind of resource. + * + * @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 {DomainOwnershipIdentifier} - 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 DomainOwnershipIdentifier} 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. + */ + updateOwnershipIdentifier(resourceGroupName, domainName, name, domainOwnershipIdentifier, 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._updateOwnershipIdentifier(resourceGroupName, domainName, name, domainOwnershipIdentifier, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._updateOwnershipIdentifier(resourceGroupName, domainName, name, domainOwnershipIdentifier, options, optionalCallback); + } + } + + /** + * @summary Renew a domain. + * + * Renew a domain. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} domainName Name of the domain. + * + * @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. + */ + renewWithHttpOperationResponse(resourceGroupName, domainName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._renew(resourceGroupName, domainName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Renew a domain. + * + * Renew a domain. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} domainName Name of the domain. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + renew(resourceGroupName, domainName, 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._renew(resourceGroupName, domainName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._renew(resourceGroupName, domainName, options, optionalCallback); + } + } + + /** + * @summary Creates or updates a domain. + * + * Creates or updates a domain. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} domainName Name of the domain. + * + * @param {object} domain Domain registration information. + * + * @param {object} domain.contactAdmin Administrative contact. + * + * @param {object} domain.contactBilling Billing contact. + * + * @param {object} domain.contactRegistrant Registrant contact. + * + * @param {object} domain.contactTech Technical contact. + * + * @param {object} [domain.contactTech.addressMailing] Mailing address. + * + * @param {string} domain.contactTech.addressMailing.address1 First line of an + * Address. + * + * @param {string} [domain.contactTech.addressMailing.address2] The second line + * of the Address. Optional. + * + * @param {string} domain.contactTech.addressMailing.city The city for the + * address. + * + * @param {string} domain.contactTech.addressMailing.country The country for + * the address. + * + * @param {string} domain.contactTech.addressMailing.postalCode The postal code + * for the address. + * + * @param {string} domain.contactTech.addressMailing.state The state or + * province for the address. + * + * @param {string} domain.contactTech.email Email address. + * + * @param {string} [domain.contactTech.fax] Fax number. + * + * @param {string} [domain.contactTech.jobTitle] Job title. + * + * @param {string} domain.contactTech.nameFirst First name. + * + * @param {string} domain.contactTech.nameLast Last name. + * + * @param {string} [domain.contactTech.nameMiddle] Middle name. + * + * @param {string} [domain.contactTech.organization] Organization contact + * belongs to. + * + * @param {string} domain.contactTech.phone Phone number. + * + * @param {boolean} [domain.privacy] true if domain privacy is + * enabled for this domain; otherwise, false. + * + * @param {boolean} [domain.autoRenew] true if the domain should + * be automatically renewed; otherwise, false. + * + * @param {object} domain.consent Legal agreement consent. + * + * @param {array} [domain.consent.agreementKeys] List of applicable legal + * agreement keys. This list can be retrieved using ListLegalAgreements API + * under TopLevelDomain resource. + * + * @param {string} [domain.consent.agreedBy] Client IP address. + * + * @param {date} [domain.consent.agreedAt] Timestamp when the agreements were + * accepted. + * + * @param {string} [domain.dnsType] Current DNS type. Possible values include: + * 'AzureDns', 'DefaultDomainRegistrarDns' + * + * @param {string} [domain.dnsZoneId] Azure DNS Zone to use + * + * @param {string} [domain.targetDnsType] Target DNS type (would be used for + * migration). Possible values include: 'AzureDns', 'DefaultDomainRegistrarDns' + * + * @param {string} [domain.authCode] + * + * @param {string} [domain.kind] Kind of resource. + * + * @param {string} domain.location Resource Location. + * + * @param {object} [domain.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName, domainName, domain, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginCreateOrUpdate(resourceGroupName, domainName, domain, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Creates or updates a domain. + * + * Creates or updates a domain. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} domainName Name of the domain. + * + * @param {object} domain Domain registration information. + * + * @param {object} domain.contactAdmin Administrative contact. + * + * @param {object} domain.contactBilling Billing contact. + * + * @param {object} domain.contactRegistrant Registrant contact. + * + * @param {object} domain.contactTech Technical contact. + * + * @param {object} [domain.contactTech.addressMailing] Mailing address. + * + * @param {string} domain.contactTech.addressMailing.address1 First line of an + * Address. + * + * @param {string} [domain.contactTech.addressMailing.address2] The second line + * of the Address. Optional. + * + * @param {string} domain.contactTech.addressMailing.city The city for the + * address. + * + * @param {string} domain.contactTech.addressMailing.country The country for + * the address. + * + * @param {string} domain.contactTech.addressMailing.postalCode The postal code + * for the address. + * + * @param {string} domain.contactTech.addressMailing.state The state or + * province for the address. + * + * @param {string} domain.contactTech.email Email address. + * + * @param {string} [domain.contactTech.fax] Fax number. + * + * @param {string} [domain.contactTech.jobTitle] Job title. + * + * @param {string} domain.contactTech.nameFirst First name. + * + * @param {string} domain.contactTech.nameLast Last name. + * + * @param {string} [domain.contactTech.nameMiddle] Middle name. + * + * @param {string} [domain.contactTech.organization] Organization contact + * belongs to. + * + * @param {string} domain.contactTech.phone Phone number. + * + * @param {boolean} [domain.privacy] true if domain privacy is + * enabled for this domain; otherwise, false. + * + * @param {boolean} [domain.autoRenew] true if the domain should + * be automatically renewed; otherwise, false. + * + * @param {object} domain.consent Legal agreement consent. + * + * @param {array} [domain.consent.agreementKeys] List of applicable legal + * agreement keys. This list can be retrieved using ListLegalAgreements API + * under TopLevelDomain resource. + * + * @param {string} [domain.consent.agreedBy] Client IP address. + * + * @param {date} [domain.consent.agreedAt] Timestamp when the agreements were + * accepted. + * + * @param {string} [domain.dnsType] Current DNS type. Possible values include: + * 'AzureDns', 'DefaultDomainRegistrarDns' + * + * @param {string} [domain.dnsZoneId] Azure DNS Zone to use + * + * @param {string} [domain.targetDnsType] Target DNS type (would be used for + * migration). Possible values include: 'AzureDns', 'DefaultDomainRegistrarDns' + * + * @param {string} [domain.authCode] + * + * @param {string} [domain.kind] Kind of resource. + * + * @param {string} domain.location Resource Location. + * + * @param {object} [domain.tags] Resource tags. + * + * @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 {Domain} - 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 Domain} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + beginCreateOrUpdate(resourceGroupName, domainName, domain, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._beginCreateOrUpdate(resourceGroupName, domainName, domain, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginCreateOrUpdate(resourceGroupName, domainName, domain, options, optionalCallback); + } + } + + /** + * @summary Get all domains in a subscription. + * + * Get all domains in a subscription. + * + * @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 Get all domains in a subscription. + * + * Get all domains in a subscription. + * + * @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 {DomainCollection} - 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 DomainCollection} 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); + } + } + + /** + * @summary Get domain name recommendations based on keywords. + * + * Get domain name recommendations based on keywords. + * + * @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. + */ + listRecommendationsNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listRecommendationsNext(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 Get domain name recommendations based on keywords. + * + * Get domain name recommendations based on keywords. + * + * @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 {NameIdentifierCollection} - 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 NameIdentifierCollection} 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. + */ + listRecommendationsNext(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._listRecommendationsNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listRecommendationsNext(nextPageLink, options, optionalCallback); + } + } + + /** + * @summary Get all domains in a resource group. + * + * Get all domains in a resource group. + * + * @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. + */ + listByResourceGroupNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listByResourceGroupNext(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 Get all domains in a resource group. + * + * Get all domains in a resource group. + * + * @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 {DomainCollection} - 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 DomainCollection} 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. + */ + listByResourceGroupNext(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._listByResourceGroupNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listByResourceGroupNext(nextPageLink, options, optionalCallback); + } + } + + /** + * @summary Lists domain ownership identifiers. + * + * Lists domain ownership identifiers. + * + * @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. + */ + listOwnershipIdentifiersNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listOwnershipIdentifiersNext(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 Lists domain ownership identifiers. + * + * Lists domain ownership identifiers. + * + * @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 {DomainOwnershipIdentifierCollection} - 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 DomainOwnershipIdentifierCollection} 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. + */ + listOwnershipIdentifiersNext(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._listOwnershipIdentifiersNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listOwnershipIdentifiersNext(nextPageLink, options, optionalCallback); + } + } + +} + +module.exports = Domains; diff --git a/lib/services/websiteManagement2/lib/operations/index.d.ts b/lib/services/websiteManagement2/lib/operations/index.d.ts new file mode 100644 index 0000000000..fa393ddcd3 --- /dev/null +++ b/lib/services/websiteManagement2/lib/operations/index.d.ts @@ -0,0 +1,59360 @@ +/* + * 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. +*/ + +import { ServiceClientOptions, RequestOptions, ServiceCallback, HttpOperationResponse } from 'ms-rest'; +import * as stream from 'stream'; +import * as models from '../models'; + + +/** + * @class + * AppServiceCertificateOrders + * __NOTE__: An instance of this class is automatically created for an + * instance of the WebSiteManagementClient. + */ +export interface AppServiceCertificateOrders { + + + /** + * @summary List all certificate orders in a subscription. + * + * List all certificate orders in a subscription. + * + * @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. + */ + listWithHttpOperationResponse(options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary List all certificate orders in a subscription. + * + * List all certificate orders in a subscription. + * + * @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 {AppServiceCertificateOrderCollection} - 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. + * + * {AppServiceCertificateOrderCollection} [result] - The deserialized result object if an error did not occur. + * See {@link AppServiceCertificateOrderCollection} 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?: { customHeaders? : { [headerName: string]: string; } }): Promise; + list(callback: ServiceCallback): void; + list(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Validate information for a certificate order. + * + * Validate information for a certificate order. + * + * @param {object} appServiceCertificateOrder Information for a certificate + * order. + * + * @param {object} [appServiceCertificateOrder.certificates] State of the Key + * Vault secret. + * + * @param {string} [appServiceCertificateOrder.distinguishedName] Certificate + * distinguished name. + * + * @param {number} [appServiceCertificateOrder.validityInYears] Duration in + * years (must be between 1 and 3). + * + * @param {number} [appServiceCertificateOrder.keySize] Certificate key size. + * + * @param {string} appServiceCertificateOrder.productType Certificate product + * type. Possible values include: 'StandardDomainValidatedSsl', + * 'StandardDomainValidatedWildCardSsl' + * + * @param {boolean} [appServiceCertificateOrder.autoRenew] true if + * the certificate should be automatically renewed when it expires; otherwise, + * false. + * + * @param {string} [appServiceCertificateOrder.csr] Last CSR that was created + * for this order. + * + * @param {string} [appServiceCertificateOrder.kind] Kind of resource. + * + * @param {string} appServiceCertificateOrder.location Resource Location. + * + * @param {object} [appServiceCertificateOrder.tags] Resource tags. + * + * @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. + */ + validatePurchaseInformationWithHttpOperationResponse(appServiceCertificateOrder: models.AppServiceCertificateOrder, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Validate information for a certificate order. + * + * Validate information for a certificate order. + * + * @param {object} appServiceCertificateOrder Information for a certificate + * order. + * + * @param {object} [appServiceCertificateOrder.certificates] State of the Key + * Vault secret. + * + * @param {string} [appServiceCertificateOrder.distinguishedName] Certificate + * distinguished name. + * + * @param {number} [appServiceCertificateOrder.validityInYears] Duration in + * years (must be between 1 and 3). + * + * @param {number} [appServiceCertificateOrder.keySize] Certificate key size. + * + * @param {string} appServiceCertificateOrder.productType Certificate product + * type. Possible values include: 'StandardDomainValidatedSsl', + * 'StandardDomainValidatedWildCardSsl' + * + * @param {boolean} [appServiceCertificateOrder.autoRenew] true if + * the certificate should be automatically renewed when it expires; otherwise, + * false. + * + * @param {string} [appServiceCertificateOrder.csr] Last CSR that was created + * for this order. + * + * @param {string} [appServiceCertificateOrder.kind] Kind of resource. + * + * @param {string} appServiceCertificateOrder.location Resource Location. + * + * @param {object} [appServiceCertificateOrder.tags] Resource tags. + * + * @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 {null} - 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. + * + * {null} [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. + */ + validatePurchaseInformation(appServiceCertificateOrder: models.AppServiceCertificateOrder, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + validatePurchaseInformation(appServiceCertificateOrder: models.AppServiceCertificateOrder, callback: ServiceCallback): void; + validatePurchaseInformation(appServiceCertificateOrder: models.AppServiceCertificateOrder, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Get certificate orders in a resource group. + * + * Get certificate orders in a resource group. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @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. + */ + listByResourceGroupWithHttpOperationResponse(resourceGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get certificate orders in a resource group. + * + * Get certificate orders in a resource group. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @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 {AppServiceCertificateOrderCollection} - 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. + * + * {AppServiceCertificateOrderCollection} [result] - The deserialized result object if an error did not occur. + * See {@link AppServiceCertificateOrderCollection} 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. + */ + listByResourceGroup(resourceGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByResourceGroup(resourceGroupName: string, callback: ServiceCallback): void; + listByResourceGroup(resourceGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Get a certificate order. + * + * Get a certificate order. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} certificateOrderName Name of the certificate order.. + * + * @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. + */ + getWithHttpOperationResponse(resourceGroupName: string, certificateOrderName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get a certificate order. + * + * Get a certificate order. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} certificateOrderName Name of the certificate order.. + * + * @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 {AppServiceCertificateOrder} - 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. + * + * {AppServiceCertificateOrder} [result] - The deserialized result object if an error did not occur. + * See {@link AppServiceCertificateOrder} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + get(resourceGroupName: string, certificateOrderName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(resourceGroupName: string, certificateOrderName: string, callback: ServiceCallback): void; + get(resourceGroupName: string, certificateOrderName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Create or update a certificate purchase order. + * + * Create or update a certificate purchase order. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} certificateOrderName Name of the certificate order. + * + * @param {object} certificateDistinguishedName Distinguished name to to use + * for the certificate order. + * + * @param {object} [certificateDistinguishedName.certificates] State of the Key + * Vault secret. + * + * @param {string} [certificateDistinguishedName.distinguishedName] Certificate + * distinguished name. + * + * @param {number} [certificateDistinguishedName.validityInYears] Duration in + * years (must be between 1 and 3). + * + * @param {number} [certificateDistinguishedName.keySize] Certificate key size. + * + * @param {string} certificateDistinguishedName.productType Certificate product + * type. Possible values include: 'StandardDomainValidatedSsl', + * 'StandardDomainValidatedWildCardSsl' + * + * @param {boolean} [certificateDistinguishedName.autoRenew] true + * if the certificate should be automatically renewed when it expires; + * otherwise, false. + * + * @param {string} [certificateDistinguishedName.csr] Last CSR that was created + * for this order. + * + * @param {string} [certificateDistinguishedName.kind] Kind of resource. + * + * @param {string} certificateDistinguishedName.location Resource Location. + * + * @param {object} [certificateDistinguishedName.tags] Resource tags. + * + * @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. + */ + createOrUpdateWithHttpOperationResponse(resourceGroupName: string, certificateOrderName: string, certificateDistinguishedName: models.AppServiceCertificateOrder, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Create or update a certificate purchase order. + * + * Create or update a certificate purchase order. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} certificateOrderName Name of the certificate order. + * + * @param {object} certificateDistinguishedName Distinguished name to to use + * for the certificate order. + * + * @param {object} [certificateDistinguishedName.certificates] State of the Key + * Vault secret. + * + * @param {string} [certificateDistinguishedName.distinguishedName] Certificate + * distinguished name. + * + * @param {number} [certificateDistinguishedName.validityInYears] Duration in + * years (must be between 1 and 3). + * + * @param {number} [certificateDistinguishedName.keySize] Certificate key size. + * + * @param {string} certificateDistinguishedName.productType Certificate product + * type. Possible values include: 'StandardDomainValidatedSsl', + * 'StandardDomainValidatedWildCardSsl' + * + * @param {boolean} [certificateDistinguishedName.autoRenew] true + * if the certificate should be automatically renewed when it expires; + * otherwise, false. + * + * @param {string} [certificateDistinguishedName.csr] Last CSR that was created + * for this order. + * + * @param {string} [certificateDistinguishedName.kind] Kind of resource. + * + * @param {string} certificateDistinguishedName.location Resource Location. + * + * @param {object} [certificateDistinguishedName.tags] Resource tags. + * + * @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 {AppServiceCertificateOrder} - 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. + * + * {AppServiceCertificateOrder} [result] - The deserialized result object if an error did not occur. + * See {@link AppServiceCertificateOrder} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + createOrUpdate(resourceGroupName: string, certificateOrderName: string, certificateDistinguishedName: models.AppServiceCertificateOrder, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdate(resourceGroupName: string, certificateOrderName: string, certificateDistinguishedName: models.AppServiceCertificateOrder, callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, certificateOrderName: string, certificateDistinguishedName: models.AppServiceCertificateOrder, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Delete an existing certificate order. + * + * Delete an existing certificate order. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} certificateOrderName Name of the certificate order. + * + * @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. + */ + deleteMethodWithHttpOperationResponse(resourceGroupName: string, certificateOrderName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Delete an existing certificate order. + * + * Delete an existing certificate order. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} certificateOrderName Name of the certificate order. + * + * @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 {null} - 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. + * + * {null} [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. + */ + deleteMethod(resourceGroupName: string, certificateOrderName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteMethod(resourceGroupName: string, certificateOrderName: string, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, certificateOrderName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Create or update a certificate purchase order. + * + * Create or update a certificate purchase order. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} certificateOrderName Name of the certificate order. + * + * @param {object} certificateDistinguishedName Distinguished name to to use + * for the certificate order. + * + * @param {object} [certificateDistinguishedName.certificates] State of the Key + * Vault secret. + * + * @param {string} [certificateDistinguishedName.distinguishedName] Certificate + * distinguished name. + * + * @param {number} [certificateDistinguishedName.validityInYears] Duration in + * years (must be between 1 and 3). + * + * @param {number} [certificateDistinguishedName.keySize] Certificate key size. + * + * @param {string} certificateDistinguishedName.productType Certificate product + * type. Possible values include: 'StandardDomainValidatedSsl', + * 'StandardDomainValidatedWildCardSsl' + * + * @param {boolean} [certificateDistinguishedName.autoRenew] true + * if the certificate should be automatically renewed when it expires; + * otherwise, false. + * + * @param {string} [certificateDistinguishedName.csr] Last CSR that was created + * for this order. + * + * @param {string} [certificateDistinguishedName.kind] Kind of resource. + * + * @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. + */ + updateWithHttpOperationResponse(resourceGroupName: string, certificateOrderName: string, certificateDistinguishedName: models.AppServiceCertificateOrderPatchResource, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Create or update a certificate purchase order. + * + * Create or update a certificate purchase order. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} certificateOrderName Name of the certificate order. + * + * @param {object} certificateDistinguishedName Distinguished name to to use + * for the certificate order. + * + * @param {object} [certificateDistinguishedName.certificates] State of the Key + * Vault secret. + * + * @param {string} [certificateDistinguishedName.distinguishedName] Certificate + * distinguished name. + * + * @param {number} [certificateDistinguishedName.validityInYears] Duration in + * years (must be between 1 and 3). + * + * @param {number} [certificateDistinguishedName.keySize] Certificate key size. + * + * @param {string} certificateDistinguishedName.productType Certificate product + * type. Possible values include: 'StandardDomainValidatedSsl', + * 'StandardDomainValidatedWildCardSsl' + * + * @param {boolean} [certificateDistinguishedName.autoRenew] true + * if the certificate should be automatically renewed when it expires; + * otherwise, false. + * + * @param {string} [certificateDistinguishedName.csr] Last CSR that was created + * for this order. + * + * @param {string} [certificateDistinguishedName.kind] Kind of resource. + * + * @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 {AppServiceCertificateOrder} - 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. + * + * {AppServiceCertificateOrder} [result] - The deserialized result object if an error did not occur. + * See {@link AppServiceCertificateOrder} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + update(resourceGroupName: string, certificateOrderName: string, certificateDistinguishedName: models.AppServiceCertificateOrderPatchResource, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + update(resourceGroupName: string, certificateOrderName: string, certificateDistinguishedName: models.AppServiceCertificateOrderPatchResource, callback: ServiceCallback): void; + update(resourceGroupName: string, certificateOrderName: string, certificateDistinguishedName: models.AppServiceCertificateOrderPatchResource, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary List all certificates associated with a certificate order. + * + * List all certificates associated with a certificate order. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} certificateOrderName Name of the certificate order. + * + * @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. + */ + listCertificatesWithHttpOperationResponse(resourceGroupName: string, certificateOrderName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary List all certificates associated with a certificate order. + * + * List all certificates associated with a certificate order. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} certificateOrderName Name of the certificate order. + * + * @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 {AppServiceCertificateCollection} - 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. + * + * {AppServiceCertificateCollection} [result] - The deserialized result object if an error did not occur. + * See {@link AppServiceCertificateCollection} 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. + */ + listCertificates(resourceGroupName: string, certificateOrderName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listCertificates(resourceGroupName: string, certificateOrderName: string, callback: ServiceCallback): void; + listCertificates(resourceGroupName: string, certificateOrderName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Get the certificate associated with a certificate order. + * + * Get the certificate associated with a certificate order. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} certificateOrderName Name of the certificate order. + * + * @param {string} name Name of the certificate. + * + * @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. + */ + getCertificateWithHttpOperationResponse(resourceGroupName: string, certificateOrderName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get the certificate associated with a certificate order. + * + * Get the certificate associated with a certificate order. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} certificateOrderName Name of the certificate order. + * + * @param {string} name Name of the certificate. + * + * @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 {AppServiceCertificateResource} - 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. + * + * {AppServiceCertificateResource} [result] - The deserialized result object if an error did not occur. + * See {@link AppServiceCertificateResource} 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. + */ + getCertificate(resourceGroupName: string, certificateOrderName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getCertificate(resourceGroupName: string, certificateOrderName: string, name: string, callback: ServiceCallback): void; + getCertificate(resourceGroupName: string, certificateOrderName: string, name: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Creates or updates a certificate and associates with key vault + * secret. + * + * Creates or updates a certificate and associates with key vault secret. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} certificateOrderName Name of the certificate order. + * + * @param {string} name Name of the certificate. + * + * @param {object} keyVaultCertificate Key vault certificate resource Id. + * + * @param {string} [keyVaultCertificate.keyVaultId] Key Vault resource Id. + * + * @param {string} [keyVaultCertificate.keyVaultSecretName] Key Vault secret + * name. + * + * @param {string} [keyVaultCertificate.kind] Kind of resource. + * + * @param {string} keyVaultCertificate.location Resource Location. + * + * @param {object} [keyVaultCertificate.tags] Resource tags. + * + * @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. + */ + createOrUpdateCertificateWithHttpOperationResponse(resourceGroupName: string, certificateOrderName: string, name: string, keyVaultCertificate: models.AppServiceCertificateResource, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Creates or updates a certificate and associates with key vault + * secret. + * + * Creates or updates a certificate and associates with key vault secret. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} certificateOrderName Name of the certificate order. + * + * @param {string} name Name of the certificate. + * + * @param {object} keyVaultCertificate Key vault certificate resource Id. + * + * @param {string} [keyVaultCertificate.keyVaultId] Key Vault resource Id. + * + * @param {string} [keyVaultCertificate.keyVaultSecretName] Key Vault secret + * name. + * + * @param {string} [keyVaultCertificate.kind] Kind of resource. + * + * @param {string} keyVaultCertificate.location Resource Location. + * + * @param {object} [keyVaultCertificate.tags] Resource tags. + * + * @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 {AppServiceCertificateResource} - 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. + * + * {AppServiceCertificateResource} [result] - The deserialized result object if an error did not occur. + * See {@link AppServiceCertificateResource} 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. + */ + createOrUpdateCertificate(resourceGroupName: string, certificateOrderName: string, name: string, keyVaultCertificate: models.AppServiceCertificateResource, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdateCertificate(resourceGroupName: string, certificateOrderName: string, name: string, keyVaultCertificate: models.AppServiceCertificateResource, callback: ServiceCallback): void; + createOrUpdateCertificate(resourceGroupName: string, certificateOrderName: string, name: string, keyVaultCertificate: models.AppServiceCertificateResource, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Delete the certificate associated with a certificate order. + * + * Delete the certificate associated with a certificate order. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} certificateOrderName Name of the certificate order. + * + * @param {string} name Name of the certificate. + * + * @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. + */ + deleteCertificateWithHttpOperationResponse(resourceGroupName: string, certificateOrderName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Delete the certificate associated with a certificate order. + * + * Delete the certificate associated with a certificate order. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} certificateOrderName Name of the certificate order. + * + * @param {string} name Name of the certificate. + * + * @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 {null} - 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. + * + * {null} [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. + */ + deleteCertificate(resourceGroupName: string, certificateOrderName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteCertificate(resourceGroupName: string, certificateOrderName: string, name: string, callback: ServiceCallback): void; + deleteCertificate(resourceGroupName: string, certificateOrderName: string, name: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Creates or updates a certificate and associates with key vault + * secret. + * + * Creates or updates a certificate and associates with key vault secret. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} certificateOrderName Name of the certificate order. + * + * @param {string} name Name of the certificate. + * + * @param {object} keyVaultCertificate Key vault certificate resource Id. + * + * @param {string} [keyVaultCertificate.keyVaultId] Key Vault resource Id. + * + * @param {string} [keyVaultCertificate.keyVaultSecretName] Key Vault secret + * name. + * + * @param {string} [keyVaultCertificate.kind] Kind of resource. + * + * @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. + */ + updateCertificateWithHttpOperationResponse(resourceGroupName: string, certificateOrderName: string, name: string, keyVaultCertificate: models.AppServiceCertificatePatchResource, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Creates or updates a certificate and associates with key vault + * secret. + * + * Creates or updates a certificate and associates with key vault secret. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} certificateOrderName Name of the certificate order. + * + * @param {string} name Name of the certificate. + * + * @param {object} keyVaultCertificate Key vault certificate resource Id. + * + * @param {string} [keyVaultCertificate.keyVaultId] Key Vault resource Id. + * + * @param {string} [keyVaultCertificate.keyVaultSecretName] Key Vault secret + * name. + * + * @param {string} [keyVaultCertificate.kind] Kind of resource. + * + * @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 {AppServiceCertificateResource} - 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. + * + * {AppServiceCertificateResource} [result] - The deserialized result object if an error did not occur. + * See {@link AppServiceCertificateResource} 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. + */ + updateCertificate(resourceGroupName: string, certificateOrderName: string, name: string, keyVaultCertificate: models.AppServiceCertificatePatchResource, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + updateCertificate(resourceGroupName: string, certificateOrderName: string, name: string, keyVaultCertificate: models.AppServiceCertificatePatchResource, callback: ServiceCallback): void; + updateCertificate(resourceGroupName: string, certificateOrderName: string, name: string, keyVaultCertificate: models.AppServiceCertificatePatchResource, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Reissue an existing certificate order. + * + * Reissue an existing certificate order. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} certificateOrderName Name of the certificate order. + * + * @param {object} reissueCertificateOrderRequest Parameters for the reissue. + * + * @param {number} [reissueCertificateOrderRequest.keySize] Certificate Key + * Size. + * + * @param {number} [reissueCertificateOrderRequest.delayExistingRevokeInHours] + * Delay in hours to revoke existing certificate after the new certificate is + * issued. + * + * @param {string} [reissueCertificateOrderRequest.csr] Csr to be used for + * re-key operation. + * + * @param {boolean} [reissueCertificateOrderRequest.isPrivateKeyExternal] + * Should we change the ASC type (from managed private key to external private + * key and vice versa). + * + * @param {string} [reissueCertificateOrderRequest.kind] Kind of resource. + * + * @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. + */ + reissueWithHttpOperationResponse(resourceGroupName: string, certificateOrderName: string, reissueCertificateOrderRequest: models.ReissueCertificateOrderRequest, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Reissue an existing certificate order. + * + * Reissue an existing certificate order. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} certificateOrderName Name of the certificate order. + * + * @param {object} reissueCertificateOrderRequest Parameters for the reissue. + * + * @param {number} [reissueCertificateOrderRequest.keySize] Certificate Key + * Size. + * + * @param {number} [reissueCertificateOrderRequest.delayExistingRevokeInHours] + * Delay in hours to revoke existing certificate after the new certificate is + * issued. + * + * @param {string} [reissueCertificateOrderRequest.csr] Csr to be used for + * re-key operation. + * + * @param {boolean} [reissueCertificateOrderRequest.isPrivateKeyExternal] + * Should we change the ASC type (from managed private key to external private + * key and vice versa). + * + * @param {string} [reissueCertificateOrderRequest.kind] Kind of resource. + * + * @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 {null} - 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. + * + * {null} [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. + */ + reissue(resourceGroupName: string, certificateOrderName: string, reissueCertificateOrderRequest: models.ReissueCertificateOrderRequest, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + reissue(resourceGroupName: string, certificateOrderName: string, reissueCertificateOrderRequest: models.ReissueCertificateOrderRequest, callback: ServiceCallback): void; + reissue(resourceGroupName: string, certificateOrderName: string, reissueCertificateOrderRequest: models.ReissueCertificateOrderRequest, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Renew an existing certificate order. + * + * Renew an existing certificate order. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} certificateOrderName Name of the certificate order. + * + * @param {object} renewCertificateOrderRequest Renew parameters + * + * @param {number} [renewCertificateOrderRequest.keySize] Certificate Key Size. + * + * @param {string} [renewCertificateOrderRequest.csr] Csr to be used for re-key + * operation. + * + * @param {boolean} [renewCertificateOrderRequest.isPrivateKeyExternal] Should + * we change the ASC type (from managed private key to external private key and + * vice versa). + * + * @param {string} [renewCertificateOrderRequest.kind] Kind of resource. + * + * @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. + */ + renewWithHttpOperationResponse(resourceGroupName: string, certificateOrderName: string, renewCertificateOrderRequest: models.RenewCertificateOrderRequest, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Renew an existing certificate order. + * + * Renew an existing certificate order. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} certificateOrderName Name of the certificate order. + * + * @param {object} renewCertificateOrderRequest Renew parameters + * + * @param {number} [renewCertificateOrderRequest.keySize] Certificate Key Size. + * + * @param {string} [renewCertificateOrderRequest.csr] Csr to be used for re-key + * operation. + * + * @param {boolean} [renewCertificateOrderRequest.isPrivateKeyExternal] Should + * we change the ASC type (from managed private key to external private key and + * vice versa). + * + * @param {string} [renewCertificateOrderRequest.kind] Kind of resource. + * + * @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 {null} - 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. + * + * {null} [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. + */ + renew(resourceGroupName: string, certificateOrderName: string, renewCertificateOrderRequest: models.RenewCertificateOrderRequest, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + renew(resourceGroupName: string, certificateOrderName: string, renewCertificateOrderRequest: models.RenewCertificateOrderRequest, callback: ServiceCallback): void; + renew(resourceGroupName: string, certificateOrderName: string, renewCertificateOrderRequest: models.RenewCertificateOrderRequest, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Resend certificate email. + * + * Resend certificate email. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} certificateOrderName Name of the certificate order. + * + * @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. + */ + resendEmailWithHttpOperationResponse(resourceGroupName: string, certificateOrderName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Resend certificate email. + * + * Resend certificate email. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} certificateOrderName Name of the certificate order. + * + * @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 {null} - 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. + * + * {null} [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. + */ + resendEmail(resourceGroupName: string, certificateOrderName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + resendEmail(resourceGroupName: string, certificateOrderName: string, callback: ServiceCallback): void; + resendEmail(resourceGroupName: string, certificateOrderName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Verify domain ownership for this certificate order. + * + * Verify domain ownership for this certificate order. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} certificateOrderName Name of the certificate order. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.name] Name of the object. + * + * @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. + */ + resendRequestEmailsWithHttpOperationResponse(resourceGroupName: string, certificateOrderName: string, options?: { name? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Verify domain ownership for this certificate order. + * + * Verify domain ownership for this certificate order. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} certificateOrderName Name of the certificate order. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.name] Name of the object. + * + * @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 {null} - 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. + * + * {null} [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. + */ + resendRequestEmails(resourceGroupName: string, certificateOrderName: string, options?: { name? : string, customHeaders? : { [headerName: string]: string; } }): Promise; + resendRequestEmails(resourceGroupName: string, certificateOrderName: string, callback: ServiceCallback): void; + resendRequestEmails(resourceGroupName: string, certificateOrderName: string, options: { name? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Verify domain ownership for this certificate order. + * + * Verify domain ownership for this certificate order. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} certificateOrderName Name of the certificate order. + * + * @param {object} siteSealRequest Site seal request. + * + * @param {boolean} [siteSealRequest.lightTheme] If true use the + * light color theme for site seal; otherwise, use the default color theme. + * + * @param {string} [siteSealRequest.locale] Locale of site seal. + * + * @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. + */ + retrieveSiteSealWithHttpOperationResponse(resourceGroupName: string, certificateOrderName: string, siteSealRequest: models.SiteSealRequest, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Verify domain ownership for this certificate order. + * + * Verify domain ownership for this certificate order. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} certificateOrderName Name of the certificate order. + * + * @param {object} siteSealRequest Site seal request. + * + * @param {boolean} [siteSealRequest.lightTheme] If true use the + * light color theme for site seal; otherwise, use the default color theme. + * + * @param {string} [siteSealRequest.locale] Locale of site seal. + * + * @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 {SiteSeal} - 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. + * + * {SiteSeal} [result] - The deserialized result object if an error did not occur. + * See {@link SiteSeal} 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. + */ + retrieveSiteSeal(resourceGroupName: string, certificateOrderName: string, siteSealRequest: models.SiteSealRequest, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + retrieveSiteSeal(resourceGroupName: string, certificateOrderName: string, siteSealRequest: models.SiteSealRequest, callback: ServiceCallback): void; + retrieveSiteSeal(resourceGroupName: string, certificateOrderName: string, siteSealRequest: models.SiteSealRequest, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Verify domain ownership for this certificate order. + * + * Verify domain ownership for this certificate order. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} certificateOrderName Name of the certificate order. + * + * @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. + */ + verifyDomainOwnershipWithHttpOperationResponse(resourceGroupName: string, certificateOrderName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Verify domain ownership for this certificate order. + * + * Verify domain ownership for this certificate order. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} certificateOrderName Name of the certificate order. + * + * @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 {null} - 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. + * + * {null} [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. + */ + verifyDomainOwnership(resourceGroupName: string, certificateOrderName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + verifyDomainOwnership(resourceGroupName: string, certificateOrderName: string, callback: ServiceCallback): void; + verifyDomainOwnership(resourceGroupName: string, certificateOrderName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Retrieve the list of certificate actions. + * + * Retrieve the list of certificate actions. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the certificate order. + * + * @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. + */ + retrieveCertificateActionsWithHttpOperationResponse(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Retrieve the list of certificate actions. + * + * Retrieve the list of certificate actions. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the certificate order. + * + * @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. + */ + retrieveCertificateActions(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + retrieveCertificateActions(resourceGroupName: string, name: string, callback: ServiceCallback): void; + retrieveCertificateActions(resourceGroupName: string, name: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Retrieve email history. + * + * Retrieve email history. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the certificate order. + * + * @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. + */ + retrieveCertificateEmailHistoryWithHttpOperationResponse(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Retrieve email history. + * + * Retrieve email history. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the certificate order. + * + * @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. + */ + retrieveCertificateEmailHistory(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + retrieveCertificateEmailHistory(resourceGroupName: string, name: string, callback: ServiceCallback): void; + retrieveCertificateEmailHistory(resourceGroupName: string, name: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Create or update a certificate purchase order. + * + * Create or update a certificate purchase order. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} certificateOrderName Name of the certificate order. + * + * @param {object} certificateDistinguishedName Distinguished name to to use + * for the certificate order. + * + * @param {object} [certificateDistinguishedName.certificates] State of the Key + * Vault secret. + * + * @param {string} [certificateDistinguishedName.distinguishedName] Certificate + * distinguished name. + * + * @param {number} [certificateDistinguishedName.validityInYears] Duration in + * years (must be between 1 and 3). + * + * @param {number} [certificateDistinguishedName.keySize] Certificate key size. + * + * @param {string} certificateDistinguishedName.productType Certificate product + * type. Possible values include: 'StandardDomainValidatedSsl', + * 'StandardDomainValidatedWildCardSsl' + * + * @param {boolean} [certificateDistinguishedName.autoRenew] true + * if the certificate should be automatically renewed when it expires; + * otherwise, false. + * + * @param {string} [certificateDistinguishedName.csr] Last CSR that was created + * for this order. + * + * @param {string} [certificateDistinguishedName.kind] Kind of resource. + * + * @param {string} certificateDistinguishedName.location Resource Location. + * + * @param {object} [certificateDistinguishedName.tags] Resource tags. + * + * @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. + */ + beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, certificateOrderName: string, certificateDistinguishedName: models.AppServiceCertificateOrder, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Create or update a certificate purchase order. + * + * Create or update a certificate purchase order. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} certificateOrderName Name of the certificate order. + * + * @param {object} certificateDistinguishedName Distinguished name to to use + * for the certificate order. + * + * @param {object} [certificateDistinguishedName.certificates] State of the Key + * Vault secret. + * + * @param {string} [certificateDistinguishedName.distinguishedName] Certificate + * distinguished name. + * + * @param {number} [certificateDistinguishedName.validityInYears] Duration in + * years (must be between 1 and 3). + * + * @param {number} [certificateDistinguishedName.keySize] Certificate key size. + * + * @param {string} certificateDistinguishedName.productType Certificate product + * type. Possible values include: 'StandardDomainValidatedSsl', + * 'StandardDomainValidatedWildCardSsl' + * + * @param {boolean} [certificateDistinguishedName.autoRenew] true + * if the certificate should be automatically renewed when it expires; + * otherwise, false. + * + * @param {string} [certificateDistinguishedName.csr] Last CSR that was created + * for this order. + * + * @param {string} [certificateDistinguishedName.kind] Kind of resource. + * + * @param {string} certificateDistinguishedName.location Resource Location. + * + * @param {object} [certificateDistinguishedName.tags] Resource tags. + * + * @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 {AppServiceCertificateOrder} - 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. + * + * {AppServiceCertificateOrder} [result] - The deserialized result object if an error did not occur. + * See {@link AppServiceCertificateOrder} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + beginCreateOrUpdate(resourceGroupName: string, certificateOrderName: string, certificateDistinguishedName: models.AppServiceCertificateOrder, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginCreateOrUpdate(resourceGroupName: string, certificateOrderName: string, certificateDistinguishedName: models.AppServiceCertificateOrder, callback: ServiceCallback): void; + beginCreateOrUpdate(resourceGroupName: string, certificateOrderName: string, certificateDistinguishedName: models.AppServiceCertificateOrder, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Creates or updates a certificate and associates with key vault + * secret. + * + * Creates or updates a certificate and associates with key vault secret. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} certificateOrderName Name of the certificate order. + * + * @param {string} name Name of the certificate. + * + * @param {object} keyVaultCertificate Key vault certificate resource Id. + * + * @param {string} [keyVaultCertificate.keyVaultId] Key Vault resource Id. + * + * @param {string} [keyVaultCertificate.keyVaultSecretName] Key Vault secret + * name. + * + * @param {string} [keyVaultCertificate.kind] Kind of resource. + * + * @param {string} keyVaultCertificate.location Resource Location. + * + * @param {object} [keyVaultCertificate.tags] Resource tags. + * + * @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. + */ + beginCreateOrUpdateCertificateWithHttpOperationResponse(resourceGroupName: string, certificateOrderName: string, name: string, keyVaultCertificate: models.AppServiceCertificateResource, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Creates or updates a certificate and associates with key vault + * secret. + * + * Creates or updates a certificate and associates with key vault secret. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} certificateOrderName Name of the certificate order. + * + * @param {string} name Name of the certificate. + * + * @param {object} keyVaultCertificate Key vault certificate resource Id. + * + * @param {string} [keyVaultCertificate.keyVaultId] Key Vault resource Id. + * + * @param {string} [keyVaultCertificate.keyVaultSecretName] Key Vault secret + * name. + * + * @param {string} [keyVaultCertificate.kind] Kind of resource. + * + * @param {string} keyVaultCertificate.location Resource Location. + * + * @param {object} [keyVaultCertificate.tags] Resource tags. + * + * @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 {AppServiceCertificateResource} - 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. + * + * {AppServiceCertificateResource} [result] - The deserialized result object if an error did not occur. + * See {@link AppServiceCertificateResource} 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. + */ + beginCreateOrUpdateCertificate(resourceGroupName: string, certificateOrderName: string, name: string, keyVaultCertificate: models.AppServiceCertificateResource, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginCreateOrUpdateCertificate(resourceGroupName: string, certificateOrderName: string, name: string, keyVaultCertificate: models.AppServiceCertificateResource, callback: ServiceCallback): void; + beginCreateOrUpdateCertificate(resourceGroupName: string, certificateOrderName: string, name: string, keyVaultCertificate: models.AppServiceCertificateResource, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary List all certificate orders in a subscription. + * + * List all certificate orders in a subscription. + * + * @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 List all certificate orders in a subscription. + * + * List all certificate orders in a subscription. + * + * @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 {AppServiceCertificateOrderCollection} - 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. + * + * {AppServiceCertificateOrderCollection} [result] - The deserialized result object if an error did not occur. + * See {@link AppServiceCertificateOrderCollection} 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; + + + /** + * @summary Get certificate orders in a resource group. + * + * Get certificate orders in a resource group. + * + * @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. + */ + listByResourceGroupNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get certificate orders in a resource group. + * + * Get certificate orders in a resource group. + * + * @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 {AppServiceCertificateOrderCollection} - 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. + * + * {AppServiceCertificateOrderCollection} [result] - The deserialized result object if an error did not occur. + * See {@link AppServiceCertificateOrderCollection} 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. + */ + listByResourceGroupNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByResourceGroupNext(nextPageLink: string, callback: ServiceCallback): void; + listByResourceGroupNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary List all certificates associated with a certificate order. + * + * List all certificates associated with a certificate order. + * + * @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. + */ + listCertificatesNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary List all certificates associated with a certificate order. + * + * List all certificates associated with a certificate order. + * + * @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 {AppServiceCertificateCollection} - 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. + * + * {AppServiceCertificateCollection} [result] - The deserialized result object if an error did not occur. + * See {@link AppServiceCertificateCollection} 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. + */ + listCertificatesNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listCertificatesNext(nextPageLink: string, callback: ServiceCallback): void; + listCertificatesNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + +/** + * @class + * CertificateRegistrationProvider + * __NOTE__: An instance of this class is automatically created for an + * instance of the WebSiteManagementClient. + */ +export interface CertificateRegistrationProvider { + + + /** + * @summary Implements Csm operations Api to exposes the list of available Csm + * Apis under the resource provider + * + * Implements Csm operations Api to exposes the list of available Csm Apis + * under the resource provider + * + * @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. + */ + listOperationsWithHttpOperationResponse(options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Implements Csm operations Api to exposes the list of available Csm + * Apis under the resource provider + * + * Implements Csm operations Api to exposes the list of available Csm Apis + * under the resource provider + * + * @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 {CsmOperationCollection} - 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. + * + * {CsmOperationCollection} [result] - The deserialized result object if an error did not occur. + * See {@link CsmOperationCollection} 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. + */ + listOperations(options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listOperations(callback: ServiceCallback): void; + listOperations(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Implements Csm operations Api to exposes the list of available Csm + * Apis under the resource provider + * + * Implements Csm operations Api to exposes the list of available Csm Apis + * under the resource provider + * + * @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. + */ + listOperationsNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Implements Csm operations Api to exposes the list of available Csm + * Apis under the resource provider + * + * Implements Csm operations Api to exposes the list of available Csm Apis + * under the resource provider + * + * @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 {CsmOperationCollection} - 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. + * + * {CsmOperationCollection} [result] - The deserialized result object if an error did not occur. + * See {@link CsmOperationCollection} 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. + */ + listOperationsNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listOperationsNext(nextPageLink: string, callback: ServiceCallback): void; + listOperationsNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + +/** + * @class + * Domains + * __NOTE__: An instance of this class is automatically created for an + * instance of the WebSiteManagementClient. + */ +export interface Domains { + + + /** + * @summary Check if a domain is available for registration. + * + * Check if a domain is available for registration. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.name] Name of the object. + * + * @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. + */ + checkAvailabilityWithHttpOperationResponse(options?: { name? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Check if a domain is available for registration. + * + * Check if a domain is available for registration. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.name] Name of the object. + * + * @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 {DomainAvailablilityCheckResult} - 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. + * + * {DomainAvailablilityCheckResult} [result] - The deserialized result object if an error did not occur. + * See {@link DomainAvailablilityCheckResult} 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. + */ + checkAvailability(options?: { name? : string, customHeaders? : { [headerName: string]: string; } }): Promise; + checkAvailability(callback: ServiceCallback): void; + checkAvailability(options: { name? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Get all domains in a subscription. + * + * Get all domains in a subscription. + * + * @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. + */ + listWithHttpOperationResponse(options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get all domains in a subscription. + * + * Get all domains in a subscription. + * + * @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 {DomainCollection} - 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. + * + * {DomainCollection} [result] - The deserialized result object if an error did not occur. + * See {@link DomainCollection} 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?: { customHeaders? : { [headerName: string]: string; } }): Promise; + list(callback: ServiceCallback): void; + list(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Generate a single sign-on request for the domain management portal. + * + * Generate a single sign-on request for the domain management portal. + * + * @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. + */ + getControlCenterSsoRequestWithHttpOperationResponse(options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Generate a single sign-on request for the domain management portal. + * + * Generate a single sign-on request for the domain management portal. + * + * @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 {DomainControlCenterSsoRequest} - 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. + * + * {DomainControlCenterSsoRequest} [result] - The deserialized result object if an error did not occur. + * See {@link DomainControlCenterSsoRequest} 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. + */ + getControlCenterSsoRequest(options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getControlCenterSsoRequest(callback: ServiceCallback): void; + getControlCenterSsoRequest(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Get domain name recommendations based on keywords. + * + * Get domain name recommendations based on keywords. + * + * @param {object} parameters Search parameters for domain name + * recommendations. + * + * @param {string} [parameters.keywords] Keywords to be used for generating + * domain recommendations. + * + * @param {number} [parameters.maxDomainRecommendations] Maximum number of + * recommendations. + * + * @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. + */ + listRecommendationsWithHttpOperationResponse(parameters: models.DomainRecommendationSearchParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get domain name recommendations based on keywords. + * + * Get domain name recommendations based on keywords. + * + * @param {object} parameters Search parameters for domain name + * recommendations. + * + * @param {string} [parameters.keywords] Keywords to be used for generating + * domain recommendations. + * + * @param {number} [parameters.maxDomainRecommendations] Maximum number of + * recommendations. + * + * @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 {NameIdentifierCollection} - 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. + * + * {NameIdentifierCollection} [result] - The deserialized result object if an error did not occur. + * See {@link NameIdentifierCollection} 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. + */ + listRecommendations(parameters: models.DomainRecommendationSearchParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listRecommendations(parameters: models.DomainRecommendationSearchParameters, callback: ServiceCallback): void; + listRecommendations(parameters: models.DomainRecommendationSearchParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Get all domains in a resource group. + * + * Get all domains in a resource group. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @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. + */ + listByResourceGroupWithHttpOperationResponse(resourceGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get all domains in a resource group. + * + * Get all domains in a resource group. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @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 {DomainCollection} - 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. + * + * {DomainCollection} [result] - The deserialized result object if an error did not occur. + * See {@link DomainCollection} 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. + */ + listByResourceGroup(resourceGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByResourceGroup(resourceGroupName: string, callback: ServiceCallback): void; + listByResourceGroup(resourceGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Get a domain. + * + * Get a domain. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} domainName Name of the domain. + * + * @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. + */ + getWithHttpOperationResponse(resourceGroupName: string, domainName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get a domain. + * + * Get a domain. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} domainName Name of the domain. + * + * @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 {Domain} - 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. + * + * {Domain} [result] - The deserialized result object if an error did not occur. + * See {@link Domain} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + get(resourceGroupName: string, domainName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(resourceGroupName: string, domainName: string, callback: ServiceCallback): void; + get(resourceGroupName: string, domainName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Creates or updates a domain. + * + * Creates or updates a domain. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} domainName Name of the domain. + * + * @param {object} domain Domain registration information. + * + * @param {object} domain.contactAdmin Administrative contact. + * + * @param {object} domain.contactBilling Billing contact. + * + * @param {object} domain.contactRegistrant Registrant contact. + * + * @param {object} domain.contactTech Technical contact. + * + * @param {object} [domain.contactTech.addressMailing] Mailing address. + * + * @param {string} domain.contactTech.addressMailing.address1 First line of an + * Address. + * + * @param {string} [domain.contactTech.addressMailing.address2] The second line + * of the Address. Optional. + * + * @param {string} domain.contactTech.addressMailing.city The city for the + * address. + * + * @param {string} domain.contactTech.addressMailing.country The country for + * the address. + * + * @param {string} domain.contactTech.addressMailing.postalCode The postal code + * for the address. + * + * @param {string} domain.contactTech.addressMailing.state The state or + * province for the address. + * + * @param {string} domain.contactTech.email Email address. + * + * @param {string} [domain.contactTech.fax] Fax number. + * + * @param {string} [domain.contactTech.jobTitle] Job title. + * + * @param {string} domain.contactTech.nameFirst First name. + * + * @param {string} domain.contactTech.nameLast Last name. + * + * @param {string} [domain.contactTech.nameMiddle] Middle name. + * + * @param {string} [domain.contactTech.organization] Organization contact + * belongs to. + * + * @param {string} domain.contactTech.phone Phone number. + * + * @param {boolean} [domain.privacy] true if domain privacy is + * enabled for this domain; otherwise, false. + * + * @param {boolean} [domain.autoRenew] true if the domain should + * be automatically renewed; otherwise, false. + * + * @param {object} domain.consent Legal agreement consent. + * + * @param {array} [domain.consent.agreementKeys] List of applicable legal + * agreement keys. This list can be retrieved using ListLegalAgreements API + * under TopLevelDomain resource. + * + * @param {string} [domain.consent.agreedBy] Client IP address. + * + * @param {date} [domain.consent.agreedAt] Timestamp when the agreements were + * accepted. + * + * @param {string} [domain.dnsType] Current DNS type. Possible values include: + * 'AzureDns', 'DefaultDomainRegistrarDns' + * + * @param {string} [domain.dnsZoneId] Azure DNS Zone to use + * + * @param {string} [domain.targetDnsType] Target DNS type (would be used for + * migration). Possible values include: 'AzureDns', 'DefaultDomainRegistrarDns' + * + * @param {string} [domain.authCode] + * + * @param {string} [domain.kind] Kind of resource. + * + * @param {string} domain.location Resource Location. + * + * @param {object} [domain.tags] Resource tags. + * + * @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. + */ + createOrUpdateWithHttpOperationResponse(resourceGroupName: string, domainName: string, domain: models.Domain, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Creates or updates a domain. + * + * Creates or updates a domain. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} domainName Name of the domain. + * + * @param {object} domain Domain registration information. + * + * @param {object} domain.contactAdmin Administrative contact. + * + * @param {object} domain.contactBilling Billing contact. + * + * @param {object} domain.contactRegistrant Registrant contact. + * + * @param {object} domain.contactTech Technical contact. + * + * @param {object} [domain.contactTech.addressMailing] Mailing address. + * + * @param {string} domain.contactTech.addressMailing.address1 First line of an + * Address. + * + * @param {string} [domain.contactTech.addressMailing.address2] The second line + * of the Address. Optional. + * + * @param {string} domain.contactTech.addressMailing.city The city for the + * address. + * + * @param {string} domain.contactTech.addressMailing.country The country for + * the address. + * + * @param {string} domain.contactTech.addressMailing.postalCode The postal code + * for the address. + * + * @param {string} domain.contactTech.addressMailing.state The state or + * province for the address. + * + * @param {string} domain.contactTech.email Email address. + * + * @param {string} [domain.contactTech.fax] Fax number. + * + * @param {string} [domain.contactTech.jobTitle] Job title. + * + * @param {string} domain.contactTech.nameFirst First name. + * + * @param {string} domain.contactTech.nameLast Last name. + * + * @param {string} [domain.contactTech.nameMiddle] Middle name. + * + * @param {string} [domain.contactTech.organization] Organization contact + * belongs to. + * + * @param {string} domain.contactTech.phone Phone number. + * + * @param {boolean} [domain.privacy] true if domain privacy is + * enabled for this domain; otherwise, false. + * + * @param {boolean} [domain.autoRenew] true if the domain should + * be automatically renewed; otherwise, false. + * + * @param {object} domain.consent Legal agreement consent. + * + * @param {array} [domain.consent.agreementKeys] List of applicable legal + * agreement keys. This list can be retrieved using ListLegalAgreements API + * under TopLevelDomain resource. + * + * @param {string} [domain.consent.agreedBy] Client IP address. + * + * @param {date} [domain.consent.agreedAt] Timestamp when the agreements were + * accepted. + * + * @param {string} [domain.dnsType] Current DNS type. Possible values include: + * 'AzureDns', 'DefaultDomainRegistrarDns' + * + * @param {string} [domain.dnsZoneId] Azure DNS Zone to use + * + * @param {string} [domain.targetDnsType] Target DNS type (would be used for + * migration). Possible values include: 'AzureDns', 'DefaultDomainRegistrarDns' + * + * @param {string} [domain.authCode] + * + * @param {string} [domain.kind] Kind of resource. + * + * @param {string} domain.location Resource Location. + * + * @param {object} [domain.tags] Resource tags. + * + * @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 {Domain} - 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. + * + * {Domain} [result] - The deserialized result object if an error did not occur. + * See {@link Domain} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + createOrUpdate(resourceGroupName: string, domainName: string, domain: models.Domain, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdate(resourceGroupName: string, domainName: string, domain: models.Domain, callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, domainName: string, domain: models.Domain, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Delete a domain. + * + * Delete a domain. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} domainName Name of the domain. + * + * @param {object} [options] Optional Parameters. + * + * @param {boolean} [options.forceHardDeleteDomain] Specify true + * to delete the domain immediately. The default is false which + * deletes the domain after 24 hours. + * + * @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. + */ + deleteMethodWithHttpOperationResponse(resourceGroupName: string, domainName: string, options?: { forceHardDeleteDomain? : boolean, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Delete a domain. + * + * Delete a domain. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} domainName Name of the domain. + * + * @param {object} [options] Optional Parameters. + * + * @param {boolean} [options.forceHardDeleteDomain] Specify true + * to delete the domain immediately. The default is false which + * deletes the domain after 24 hours. + * + * @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 {null} - 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. + * + * {null} [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. + */ + deleteMethod(resourceGroupName: string, domainName: string, options?: { forceHardDeleteDomain? : boolean, customHeaders? : { [headerName: string]: string; } }): Promise; + deleteMethod(resourceGroupName: string, domainName: string, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, domainName: string, options: { forceHardDeleteDomain? : boolean, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Creates or updates a domain. + * + * Creates or updates a domain. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} domainName Name of the domain. + * + * @param {object} domain Domain registration information. + * + * @param {object} domain.contactAdmin Administrative contact. + * + * @param {object} domain.contactBilling Billing contact. + * + * @param {object} domain.contactRegistrant Registrant contact. + * + * @param {object} domain.contactTech Technical contact. + * + * @param {object} [domain.contactTech.addressMailing] Mailing address. + * + * @param {string} domain.contactTech.addressMailing.address1 First line of an + * Address. + * + * @param {string} [domain.contactTech.addressMailing.address2] The second line + * of the Address. Optional. + * + * @param {string} domain.contactTech.addressMailing.city The city for the + * address. + * + * @param {string} domain.contactTech.addressMailing.country The country for + * the address. + * + * @param {string} domain.contactTech.addressMailing.postalCode The postal code + * for the address. + * + * @param {string} domain.contactTech.addressMailing.state The state or + * province for the address. + * + * @param {string} domain.contactTech.email Email address. + * + * @param {string} [domain.contactTech.fax] Fax number. + * + * @param {string} [domain.contactTech.jobTitle] Job title. + * + * @param {string} domain.contactTech.nameFirst First name. + * + * @param {string} domain.contactTech.nameLast Last name. + * + * @param {string} [domain.contactTech.nameMiddle] Middle name. + * + * @param {string} [domain.contactTech.organization] Organization contact + * belongs to. + * + * @param {string} domain.contactTech.phone Phone number. + * + * @param {boolean} [domain.privacy] true if domain privacy is + * enabled for this domain; otherwise, false. + * + * @param {boolean} [domain.autoRenew] true if the domain should + * be automatically renewed; otherwise, false. + * + * @param {object} domain.consent Legal agreement consent. + * + * @param {array} [domain.consent.agreementKeys] List of applicable legal + * agreement keys. This list can be retrieved using ListLegalAgreements API + * under TopLevelDomain resource. + * + * @param {string} [domain.consent.agreedBy] Client IP address. + * + * @param {date} [domain.consent.agreedAt] Timestamp when the agreements were + * accepted. + * + * @param {string} [domain.dnsType] Current DNS type. Possible values include: + * 'AzureDns', 'DefaultDomainRegistrarDns' + * + * @param {string} [domain.dnsZoneId] Azure DNS Zone to use + * + * @param {string} [domain.targetDnsType] Target DNS type (would be used for + * migration). Possible values include: 'AzureDns', 'DefaultDomainRegistrarDns' + * + * @param {string} [domain.authCode] + * + * @param {string} [domain.kind] Kind of resource. + * + * @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. + */ + updateWithHttpOperationResponse(resourceGroupName: string, domainName: string, domain: models.DomainPatchResource, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Creates or updates a domain. + * + * Creates or updates a domain. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} domainName Name of the domain. + * + * @param {object} domain Domain registration information. + * + * @param {object} domain.contactAdmin Administrative contact. + * + * @param {object} domain.contactBilling Billing contact. + * + * @param {object} domain.contactRegistrant Registrant contact. + * + * @param {object} domain.contactTech Technical contact. + * + * @param {object} [domain.contactTech.addressMailing] Mailing address. + * + * @param {string} domain.contactTech.addressMailing.address1 First line of an + * Address. + * + * @param {string} [domain.contactTech.addressMailing.address2] The second line + * of the Address. Optional. + * + * @param {string} domain.contactTech.addressMailing.city The city for the + * address. + * + * @param {string} domain.contactTech.addressMailing.country The country for + * the address. + * + * @param {string} domain.contactTech.addressMailing.postalCode The postal code + * for the address. + * + * @param {string} domain.contactTech.addressMailing.state The state or + * province for the address. + * + * @param {string} domain.contactTech.email Email address. + * + * @param {string} [domain.contactTech.fax] Fax number. + * + * @param {string} [domain.contactTech.jobTitle] Job title. + * + * @param {string} domain.contactTech.nameFirst First name. + * + * @param {string} domain.contactTech.nameLast Last name. + * + * @param {string} [domain.contactTech.nameMiddle] Middle name. + * + * @param {string} [domain.contactTech.organization] Organization contact + * belongs to. + * + * @param {string} domain.contactTech.phone Phone number. + * + * @param {boolean} [domain.privacy] true if domain privacy is + * enabled for this domain; otherwise, false. + * + * @param {boolean} [domain.autoRenew] true if the domain should + * be automatically renewed; otherwise, false. + * + * @param {object} domain.consent Legal agreement consent. + * + * @param {array} [domain.consent.agreementKeys] List of applicable legal + * agreement keys. This list can be retrieved using ListLegalAgreements API + * under TopLevelDomain resource. + * + * @param {string} [domain.consent.agreedBy] Client IP address. + * + * @param {date} [domain.consent.agreedAt] Timestamp when the agreements were + * accepted. + * + * @param {string} [domain.dnsType] Current DNS type. Possible values include: + * 'AzureDns', 'DefaultDomainRegistrarDns' + * + * @param {string} [domain.dnsZoneId] Azure DNS Zone to use + * + * @param {string} [domain.targetDnsType] Target DNS type (would be used for + * migration). Possible values include: 'AzureDns', 'DefaultDomainRegistrarDns' + * + * @param {string} [domain.authCode] + * + * @param {string} [domain.kind] Kind of resource. + * + * @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 {Domain} - 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. + * + * {Domain} [result] - The deserialized result object if an error did not occur. + * See {@link Domain} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + update(resourceGroupName: string, domainName: string, domain: models.DomainPatchResource, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + update(resourceGroupName: string, domainName: string, domain: models.DomainPatchResource, callback: ServiceCallback): void; + update(resourceGroupName: string, domainName: string, domain: models.DomainPatchResource, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Lists domain ownership identifiers. + * + * Lists domain ownership identifiers. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} domainName Name of domain. + * + * @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. + */ + listOwnershipIdentifiersWithHttpOperationResponse(resourceGroupName: string, domainName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Lists domain ownership identifiers. + * + * Lists domain ownership identifiers. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} domainName Name of domain. + * + * @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 {DomainOwnershipIdentifierCollection} - 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. + * + * {DomainOwnershipIdentifierCollection} [result] - The deserialized result object if an error did not occur. + * See {@link DomainOwnershipIdentifierCollection} 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. + */ + listOwnershipIdentifiers(resourceGroupName: string, domainName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listOwnershipIdentifiers(resourceGroupName: string, domainName: string, callback: ServiceCallback): void; + listOwnershipIdentifiers(resourceGroupName: string, domainName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Get ownership identifier for domain + * + * Get ownership identifier for domain + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} domainName Name of domain. + * + * @param {string} name Name of identifier. + * + * @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. + */ + getOwnershipIdentifierWithHttpOperationResponse(resourceGroupName: string, domainName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get ownership identifier for domain + * + * Get ownership identifier for domain + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} domainName Name of domain. + * + * @param {string} name Name of identifier. + * + * @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 {DomainOwnershipIdentifier} - 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. + * + * {DomainOwnershipIdentifier} [result] - The deserialized result object if an error did not occur. + * See {@link DomainOwnershipIdentifier} 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. + */ + getOwnershipIdentifier(resourceGroupName: string, domainName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getOwnershipIdentifier(resourceGroupName: string, domainName: string, name: string, callback: ServiceCallback): void; + getOwnershipIdentifier(resourceGroupName: string, domainName: string, name: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Creates an ownership identifier for a domain or updates identifier + * details for an existing identifer + * + * Creates an ownership identifier for a domain or updates identifier details + * for an existing identifer + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} domainName Name of domain. + * + * @param {string} name Name of identifier. + * + * @param {object} domainOwnershipIdentifier A JSON representation of the + * domain ownership properties. + * + * @param {string} [domainOwnershipIdentifier.ownershipId] Ownership Id. + * + * @param {string} [domainOwnershipIdentifier.kind] Kind of resource. + * + * @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. + */ + createOrUpdateOwnershipIdentifierWithHttpOperationResponse(resourceGroupName: string, domainName: string, name: string, domainOwnershipIdentifier: models.DomainOwnershipIdentifier, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Creates an ownership identifier for a domain or updates identifier + * details for an existing identifer + * + * Creates an ownership identifier for a domain or updates identifier details + * for an existing identifer + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} domainName Name of domain. + * + * @param {string} name Name of identifier. + * + * @param {object} domainOwnershipIdentifier A JSON representation of the + * domain ownership properties. + * + * @param {string} [domainOwnershipIdentifier.ownershipId] Ownership Id. + * + * @param {string} [domainOwnershipIdentifier.kind] Kind of resource. + * + * @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 {DomainOwnershipIdentifier} - 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. + * + * {DomainOwnershipIdentifier} [result] - The deserialized result object if an error did not occur. + * See {@link DomainOwnershipIdentifier} 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. + */ + createOrUpdateOwnershipIdentifier(resourceGroupName: string, domainName: string, name: string, domainOwnershipIdentifier: models.DomainOwnershipIdentifier, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdateOwnershipIdentifier(resourceGroupName: string, domainName: string, name: string, domainOwnershipIdentifier: models.DomainOwnershipIdentifier, callback: ServiceCallback): void; + createOrUpdateOwnershipIdentifier(resourceGroupName: string, domainName: string, name: string, domainOwnershipIdentifier: models.DomainOwnershipIdentifier, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Delete ownership identifier for domain + * + * Delete ownership identifier for domain + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} domainName Name of domain. + * + * @param {string} name Name of identifier. + * + * @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. + */ + deleteOwnershipIdentifierWithHttpOperationResponse(resourceGroupName: string, domainName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Delete ownership identifier for domain + * + * Delete ownership identifier for domain + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} domainName Name of domain. + * + * @param {string} name Name of identifier. + * + * @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 {null} - 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. + * + * {null} [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. + */ + deleteOwnershipIdentifier(resourceGroupName: string, domainName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteOwnershipIdentifier(resourceGroupName: string, domainName: string, name: string, callback: ServiceCallback): void; + deleteOwnershipIdentifier(resourceGroupName: string, domainName: string, name: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Creates an ownership identifier for a domain or updates identifier + * details for an existing identifer + * + * Creates an ownership identifier for a domain or updates identifier details + * for an existing identifer + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} domainName Name of domain. + * + * @param {string} name Name of identifier. + * + * @param {object} domainOwnershipIdentifier A JSON representation of the + * domain ownership properties. + * + * @param {string} [domainOwnershipIdentifier.ownershipId] Ownership Id. + * + * @param {string} [domainOwnershipIdentifier.kind] Kind of resource. + * + * @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. + */ + updateOwnershipIdentifierWithHttpOperationResponse(resourceGroupName: string, domainName: string, name: string, domainOwnershipIdentifier: models.DomainOwnershipIdentifier, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Creates an ownership identifier for a domain or updates identifier + * details for an existing identifer + * + * Creates an ownership identifier for a domain or updates identifier details + * for an existing identifer + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} domainName Name of domain. + * + * @param {string} name Name of identifier. + * + * @param {object} domainOwnershipIdentifier A JSON representation of the + * domain ownership properties. + * + * @param {string} [domainOwnershipIdentifier.ownershipId] Ownership Id. + * + * @param {string} [domainOwnershipIdentifier.kind] Kind of resource. + * + * @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 {DomainOwnershipIdentifier} - 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. + * + * {DomainOwnershipIdentifier} [result] - The deserialized result object if an error did not occur. + * See {@link DomainOwnershipIdentifier} 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. + */ + updateOwnershipIdentifier(resourceGroupName: string, domainName: string, name: string, domainOwnershipIdentifier: models.DomainOwnershipIdentifier, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + updateOwnershipIdentifier(resourceGroupName: string, domainName: string, name: string, domainOwnershipIdentifier: models.DomainOwnershipIdentifier, callback: ServiceCallback): void; + updateOwnershipIdentifier(resourceGroupName: string, domainName: string, name: string, domainOwnershipIdentifier: models.DomainOwnershipIdentifier, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Renew a domain. + * + * Renew a domain. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} domainName Name of the domain. + * + * @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. + */ + renewWithHttpOperationResponse(resourceGroupName: string, domainName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Renew a domain. + * + * Renew a domain. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} domainName Name of the domain. + * + * @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 {null} - 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. + * + * {null} [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. + */ + renew(resourceGroupName: string, domainName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + renew(resourceGroupName: string, domainName: string, callback: ServiceCallback): void; + renew(resourceGroupName: string, domainName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Creates or updates a domain. + * + * Creates or updates a domain. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} domainName Name of the domain. + * + * @param {object} domain Domain registration information. + * + * @param {object} domain.contactAdmin Administrative contact. + * + * @param {object} domain.contactBilling Billing contact. + * + * @param {object} domain.contactRegistrant Registrant contact. + * + * @param {object} domain.contactTech Technical contact. + * + * @param {object} [domain.contactTech.addressMailing] Mailing address. + * + * @param {string} domain.contactTech.addressMailing.address1 First line of an + * Address. + * + * @param {string} [domain.contactTech.addressMailing.address2] The second line + * of the Address. Optional. + * + * @param {string} domain.contactTech.addressMailing.city The city for the + * address. + * + * @param {string} domain.contactTech.addressMailing.country The country for + * the address. + * + * @param {string} domain.contactTech.addressMailing.postalCode The postal code + * for the address. + * + * @param {string} domain.contactTech.addressMailing.state The state or + * province for the address. + * + * @param {string} domain.contactTech.email Email address. + * + * @param {string} [domain.contactTech.fax] Fax number. + * + * @param {string} [domain.contactTech.jobTitle] Job title. + * + * @param {string} domain.contactTech.nameFirst First name. + * + * @param {string} domain.contactTech.nameLast Last name. + * + * @param {string} [domain.contactTech.nameMiddle] Middle name. + * + * @param {string} [domain.contactTech.organization] Organization contact + * belongs to. + * + * @param {string} domain.contactTech.phone Phone number. + * + * @param {boolean} [domain.privacy] true if domain privacy is + * enabled for this domain; otherwise, false. + * + * @param {boolean} [domain.autoRenew] true if the domain should + * be automatically renewed; otherwise, false. + * + * @param {object} domain.consent Legal agreement consent. + * + * @param {array} [domain.consent.agreementKeys] List of applicable legal + * agreement keys. This list can be retrieved using ListLegalAgreements API + * under TopLevelDomain resource. + * + * @param {string} [domain.consent.agreedBy] Client IP address. + * + * @param {date} [domain.consent.agreedAt] Timestamp when the agreements were + * accepted. + * + * @param {string} [domain.dnsType] Current DNS type. Possible values include: + * 'AzureDns', 'DefaultDomainRegistrarDns' + * + * @param {string} [domain.dnsZoneId] Azure DNS Zone to use + * + * @param {string} [domain.targetDnsType] Target DNS type (would be used for + * migration). Possible values include: 'AzureDns', 'DefaultDomainRegistrarDns' + * + * @param {string} [domain.authCode] + * + * @param {string} [domain.kind] Kind of resource. + * + * @param {string} domain.location Resource Location. + * + * @param {object} [domain.tags] Resource tags. + * + * @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. + */ + beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, domainName: string, domain: models.Domain, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Creates or updates a domain. + * + * Creates or updates a domain. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} domainName Name of the domain. + * + * @param {object} domain Domain registration information. + * + * @param {object} domain.contactAdmin Administrative contact. + * + * @param {object} domain.contactBilling Billing contact. + * + * @param {object} domain.contactRegistrant Registrant contact. + * + * @param {object} domain.contactTech Technical contact. + * + * @param {object} [domain.contactTech.addressMailing] Mailing address. + * + * @param {string} domain.contactTech.addressMailing.address1 First line of an + * Address. + * + * @param {string} [domain.contactTech.addressMailing.address2] The second line + * of the Address. Optional. + * + * @param {string} domain.contactTech.addressMailing.city The city for the + * address. + * + * @param {string} domain.contactTech.addressMailing.country The country for + * the address. + * + * @param {string} domain.contactTech.addressMailing.postalCode The postal code + * for the address. + * + * @param {string} domain.contactTech.addressMailing.state The state or + * province for the address. + * + * @param {string} domain.contactTech.email Email address. + * + * @param {string} [domain.contactTech.fax] Fax number. + * + * @param {string} [domain.contactTech.jobTitle] Job title. + * + * @param {string} domain.contactTech.nameFirst First name. + * + * @param {string} domain.contactTech.nameLast Last name. + * + * @param {string} [domain.contactTech.nameMiddle] Middle name. + * + * @param {string} [domain.contactTech.organization] Organization contact + * belongs to. + * + * @param {string} domain.contactTech.phone Phone number. + * + * @param {boolean} [domain.privacy] true if domain privacy is + * enabled for this domain; otherwise, false. + * + * @param {boolean} [domain.autoRenew] true if the domain should + * be automatically renewed; otherwise, false. + * + * @param {object} domain.consent Legal agreement consent. + * + * @param {array} [domain.consent.agreementKeys] List of applicable legal + * agreement keys. This list can be retrieved using ListLegalAgreements API + * under TopLevelDomain resource. + * + * @param {string} [domain.consent.agreedBy] Client IP address. + * + * @param {date} [domain.consent.agreedAt] Timestamp when the agreements were + * accepted. + * + * @param {string} [domain.dnsType] Current DNS type. Possible values include: + * 'AzureDns', 'DefaultDomainRegistrarDns' + * + * @param {string} [domain.dnsZoneId] Azure DNS Zone to use + * + * @param {string} [domain.targetDnsType] Target DNS type (would be used for + * migration). Possible values include: 'AzureDns', 'DefaultDomainRegistrarDns' + * + * @param {string} [domain.authCode] + * + * @param {string} [domain.kind] Kind of resource. + * + * @param {string} domain.location Resource Location. + * + * @param {object} [domain.tags] Resource tags. + * + * @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 {Domain} - 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. + * + * {Domain} [result] - The deserialized result object if an error did not occur. + * See {@link Domain} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + beginCreateOrUpdate(resourceGroupName: string, domainName: string, domain: models.Domain, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginCreateOrUpdate(resourceGroupName: string, domainName: string, domain: models.Domain, callback: ServiceCallback): void; + beginCreateOrUpdate(resourceGroupName: string, domainName: string, domain: models.Domain, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Get all domains in a subscription. + * + * Get all domains in a subscription. + * + * @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 Get all domains in a subscription. + * + * Get all domains in a subscription. + * + * @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 {DomainCollection} - 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. + * + * {DomainCollection} [result] - The deserialized result object if an error did not occur. + * See {@link DomainCollection} 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; + + + /** + * @summary Get domain name recommendations based on keywords. + * + * Get domain name recommendations based on keywords. + * + * @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. + */ + listRecommendationsNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get domain name recommendations based on keywords. + * + * Get domain name recommendations based on keywords. + * + * @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 {NameIdentifierCollection} - 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. + * + * {NameIdentifierCollection} [result] - The deserialized result object if an error did not occur. + * See {@link NameIdentifierCollection} 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. + */ + listRecommendationsNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listRecommendationsNext(nextPageLink: string, callback: ServiceCallback): void; + listRecommendationsNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Get all domains in a resource group. + * + * Get all domains in a resource group. + * + * @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. + */ + listByResourceGroupNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get all domains in a resource group. + * + * Get all domains in a resource group. + * + * @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 {DomainCollection} - 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. + * + * {DomainCollection} [result] - The deserialized result object if an error did not occur. + * See {@link DomainCollection} 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. + */ + listByResourceGroupNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByResourceGroupNext(nextPageLink: string, callback: ServiceCallback): void; + listByResourceGroupNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Lists domain ownership identifiers. + * + * Lists domain ownership identifiers. + * + * @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. + */ + listOwnershipIdentifiersNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Lists domain ownership identifiers. + * + * Lists domain ownership identifiers. + * + * @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 {DomainOwnershipIdentifierCollection} - 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. + * + * {DomainOwnershipIdentifierCollection} [result] - The deserialized result object if an error did not occur. + * See {@link DomainOwnershipIdentifierCollection} 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. + */ + listOwnershipIdentifiersNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listOwnershipIdentifiersNext(nextPageLink: string, callback: ServiceCallback): void; + listOwnershipIdentifiersNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + +/** + * @class + * TopLevelDomains + * __NOTE__: An instance of this class is automatically created for an + * instance of the WebSiteManagementClient. + */ +export interface TopLevelDomains { + + + /** + * @summary Get all top-level domains supported for registration. + * + * Get all top-level domains supported for registration. + * + * @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. + */ + listWithHttpOperationResponse(options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get all top-level domains supported for registration. + * + * Get all top-level domains supported for registration. + * + * @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 {TopLevelDomainCollection} - 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. + * + * {TopLevelDomainCollection} [result] - The deserialized result object if an error did not occur. + * See {@link TopLevelDomainCollection} 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?: { customHeaders? : { [headerName: string]: string; } }): Promise; + list(callback: ServiceCallback): void; + list(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Get details of a top-level domain. + * + * Get details of a top-level domain. + * + * @param {string} name Name of the top-level domain. + * + * @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. + */ + getWithHttpOperationResponse(name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get details of a top-level domain. + * + * Get details of a top-level domain. + * + * @param {string} name Name of the top-level domain. + * + * @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 {TopLevelDomain} - 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. + * + * {TopLevelDomain} [result] - The deserialized result object if an error did not occur. + * See {@link TopLevelDomain} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + get(name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(name: string, callback: ServiceCallback): void; + get(name: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Gets all legal agreements that user needs to accept before + * purchasing a domain. + * + * Gets all legal agreements that user needs to accept before purchasing a + * domain. + * + * @param {string} name Name of the top-level domain. + * + * @param {object} agreementOption Domain agreement options. + * + * @param {boolean} [agreementOption.includePrivacy] If true, then + * the list of agreements will include agreements for domain privacy as well; + * otherwise, false. + * + * @param {boolean} [agreementOption.forTransfer] If true, then + * the list of agreements will include agreements for domain transfer as well; + * otherwise, false. + * + * @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. + */ + listAgreementsWithHttpOperationResponse(name: string, agreementOption: models.TopLevelDomainAgreementOption, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets all legal agreements that user needs to accept before + * purchasing a domain. + * + * Gets all legal agreements that user needs to accept before purchasing a + * domain. + * + * @param {string} name Name of the top-level domain. + * + * @param {object} agreementOption Domain agreement options. + * + * @param {boolean} [agreementOption.includePrivacy] If true, then + * the list of agreements will include agreements for domain privacy as well; + * otherwise, false. + * + * @param {boolean} [agreementOption.forTransfer] If true, then + * the list of agreements will include agreements for domain transfer as well; + * otherwise, false. + * + * @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 {TldLegalAgreementCollection} - 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. + * + * {TldLegalAgreementCollection} [result] - The deserialized result object if an error did not occur. + * See {@link TldLegalAgreementCollection} 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. + */ + listAgreements(name: string, agreementOption: models.TopLevelDomainAgreementOption, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listAgreements(name: string, agreementOption: models.TopLevelDomainAgreementOption, callback: ServiceCallback): void; + listAgreements(name: string, agreementOption: models.TopLevelDomainAgreementOption, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Get all top-level domains supported for registration. + * + * Get all top-level domains supported for registration. + * + * @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 Get all top-level domains supported for registration. + * + * Get all top-level domains supported for registration. + * + * @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 {TopLevelDomainCollection} - 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. + * + * {TopLevelDomainCollection} [result] - The deserialized result object if an error did not occur. + * See {@link TopLevelDomainCollection} 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; + + + /** + * @summary Gets all legal agreements that user needs to accept before + * purchasing a domain. + * + * Gets all legal agreements that user needs to accept before purchasing a + * domain. + * + * @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. + */ + listAgreementsNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets all legal agreements that user needs to accept before + * purchasing a domain. + * + * Gets all legal agreements that user needs to accept before purchasing a + * domain. + * + * @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 {TldLegalAgreementCollection} - 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. + * + * {TldLegalAgreementCollection} [result] - The deserialized result object if an error did not occur. + * See {@link TldLegalAgreementCollection} 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. + */ + listAgreementsNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listAgreementsNext(nextPageLink: string, callback: ServiceCallback): void; + listAgreementsNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + +/** + * @class + * DomainRegistrationProvider + * __NOTE__: An instance of this class is automatically created for an + * instance of the WebSiteManagementClient. + */ +export interface DomainRegistrationProvider { + + + /** + * @summary Implements Csm operations Api to exposes the list of available Csm + * Apis under the resource provider + * + * Implements Csm operations Api to exposes the list of available Csm Apis + * under the resource provider + * + * @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. + */ + listOperationsWithHttpOperationResponse(options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Implements Csm operations Api to exposes the list of available Csm + * Apis under the resource provider + * + * Implements Csm operations Api to exposes the list of available Csm Apis + * under the resource provider + * + * @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 {CsmOperationCollection} - 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. + * + * {CsmOperationCollection} [result] - The deserialized result object if an error did not occur. + * See {@link CsmOperationCollection} 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. + */ + listOperations(options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listOperations(callback: ServiceCallback): void; + listOperations(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Implements Csm operations Api to exposes the list of available Csm + * Apis under the resource provider + * + * Implements Csm operations Api to exposes the list of available Csm Apis + * under the resource provider + * + * @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. + */ + listOperationsNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Implements Csm operations Api to exposes the list of available Csm + * Apis under the resource provider + * + * Implements Csm operations Api to exposes the list of available Csm Apis + * under the resource provider + * + * @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 {CsmOperationCollection} - 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. + * + * {CsmOperationCollection} [result] - The deserialized result object if an error did not occur. + * See {@link CsmOperationCollection} 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. + */ + listOperationsNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listOperationsNext(nextPageLink: string, callback: ServiceCallback): void; + listOperationsNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + +/** + * @class + * Certificates + * __NOTE__: An instance of this class is automatically created for an + * instance of the WebSiteManagementClient. + */ +export interface Certificates { + + + /** + * @summary Get all certificates for a subscription. + * + * Get all certificates for a subscription. + * + * @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. + */ + listWithHttpOperationResponse(options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get all certificates for a subscription. + * + * Get all certificates for a subscription. + * + * @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 {CertificateCollection} - 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. + * + * {CertificateCollection} [result] - The deserialized result object if an error did not occur. + * See {@link CertificateCollection} 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?: { customHeaders? : { [headerName: string]: string; } }): Promise; + list(callback: ServiceCallback): void; + list(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Get all certificates in a resource group. + * + * Get all certificates in a resource group. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @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. + */ + listByResourceGroupWithHttpOperationResponse(resourceGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get all certificates in a resource group. + * + * Get all certificates in a resource group. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @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 {CertificateCollection} - 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. + * + * {CertificateCollection} [result] - The deserialized result object if an error did not occur. + * See {@link CertificateCollection} 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. + */ + listByResourceGroup(resourceGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByResourceGroup(resourceGroupName: string, callback: ServiceCallback): void; + listByResourceGroup(resourceGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Get a certificate. + * + * Get a certificate. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the certificate. + * + * @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. + */ + getWithHttpOperationResponse(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get a certificate. + * + * Get a certificate. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the certificate. + * + * @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 {Certificate} - 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. + * + * {Certificate} [result] - The deserialized result object if an error did not occur. + * See {@link Certificate} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + get(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(resourceGroupName: string, name: string, callback: ServiceCallback): void; + get(resourceGroupName: string, name: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Create or update a certificate. + * + * Create or update a certificate. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the certificate. + * + * @param {object} certificateEnvelope Details of certificate, if it exists + * already. + * + * @param {array} [certificateEnvelope.hostNames] Host names the certificate + * applies to. + * + * @param {buffer} [certificateEnvelope.pfxBlob] Pfx blob. + * + * @param {string} certificateEnvelope.password Certificate password. + * + * @param {string} [certificateEnvelope.keyVaultId] Key Vault Csm resource Id. + * + * @param {string} [certificateEnvelope.keyVaultSecretName] Key Vault secret + * name. + * + * @param {string} [certificateEnvelope.serverFarmId] Resource ID of the + * associated App Service plan, formatted as: + * "/subscriptions/{subscriptionID}/resourceGroups/{groupName}/providers/Microsoft.Web/serverfarms/{appServicePlanName}". + * + * @param {string} [certificateEnvelope.kind] Kind of resource. + * + * @param {string} certificateEnvelope.location Resource Location. + * + * @param {object} [certificateEnvelope.tags] Resource tags. + * + * @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. + */ + createOrUpdateWithHttpOperationResponse(resourceGroupName: string, name: string, certificateEnvelope: models.Certificate, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Create or update a certificate. + * + * Create or update a certificate. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the certificate. + * + * @param {object} certificateEnvelope Details of certificate, if it exists + * already. + * + * @param {array} [certificateEnvelope.hostNames] Host names the certificate + * applies to. + * + * @param {buffer} [certificateEnvelope.pfxBlob] Pfx blob. + * + * @param {string} certificateEnvelope.password Certificate password. + * + * @param {string} [certificateEnvelope.keyVaultId] Key Vault Csm resource Id. + * + * @param {string} [certificateEnvelope.keyVaultSecretName] Key Vault secret + * name. + * + * @param {string} [certificateEnvelope.serverFarmId] Resource ID of the + * associated App Service plan, formatted as: + * "/subscriptions/{subscriptionID}/resourceGroups/{groupName}/providers/Microsoft.Web/serverfarms/{appServicePlanName}". + * + * @param {string} [certificateEnvelope.kind] Kind of resource. + * + * @param {string} certificateEnvelope.location Resource Location. + * + * @param {object} [certificateEnvelope.tags] Resource tags. + * + * @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 {Certificate} - 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. + * + * {Certificate} [result] - The deserialized result object if an error did not occur. + * See {@link Certificate} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + createOrUpdate(resourceGroupName: string, name: string, certificateEnvelope: models.Certificate, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdate(resourceGroupName: string, name: string, certificateEnvelope: models.Certificate, callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, name: string, certificateEnvelope: models.Certificate, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Delete a certificate. + * + * Delete a certificate. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the certificate. + * + * @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. + */ + deleteMethodWithHttpOperationResponse(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Delete a certificate. + * + * Delete a certificate. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the certificate. + * + * @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 {null} - 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. + * + * {null} [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. + */ + deleteMethod(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteMethod(resourceGroupName: string, name: string, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, name: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Create or update a certificate. + * + * Create or update a certificate. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the certificate. + * + * @param {object} certificateEnvelope Details of certificate, if it exists + * already. + * + * @param {array} [certificateEnvelope.hostNames] Host names the certificate + * applies to. + * + * @param {buffer} [certificateEnvelope.pfxBlob] Pfx blob. + * + * @param {string} certificateEnvelope.password Certificate password. + * + * @param {string} [certificateEnvelope.keyVaultId] Key Vault Csm resource Id. + * + * @param {string} [certificateEnvelope.keyVaultSecretName] Key Vault secret + * name. + * + * @param {string} [certificateEnvelope.serverFarmId] Resource ID of the + * associated App Service plan, formatted as: + * "/subscriptions/{subscriptionID}/resourceGroups/{groupName}/providers/Microsoft.Web/serverfarms/{appServicePlanName}". + * + * @param {string} [certificateEnvelope.kind] Kind of resource. + * + * @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. + */ + updateWithHttpOperationResponse(resourceGroupName: string, name: string, certificateEnvelope: models.CertificatePatchResource, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Create or update a certificate. + * + * Create or update a certificate. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the certificate. + * + * @param {object} certificateEnvelope Details of certificate, if it exists + * already. + * + * @param {array} [certificateEnvelope.hostNames] Host names the certificate + * applies to. + * + * @param {buffer} [certificateEnvelope.pfxBlob] Pfx blob. + * + * @param {string} certificateEnvelope.password Certificate password. + * + * @param {string} [certificateEnvelope.keyVaultId] Key Vault Csm resource Id. + * + * @param {string} [certificateEnvelope.keyVaultSecretName] Key Vault secret + * name. + * + * @param {string} [certificateEnvelope.serverFarmId] Resource ID of the + * associated App Service plan, formatted as: + * "/subscriptions/{subscriptionID}/resourceGroups/{groupName}/providers/Microsoft.Web/serverfarms/{appServicePlanName}". + * + * @param {string} [certificateEnvelope.kind] Kind of resource. + * + * @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 {Certificate} - 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. + * + * {Certificate} [result] - The deserialized result object if an error did not occur. + * See {@link Certificate} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + update(resourceGroupName: string, name: string, certificateEnvelope: models.CertificatePatchResource, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + update(resourceGroupName: string, name: string, certificateEnvelope: models.CertificatePatchResource, callback: ServiceCallback): void; + update(resourceGroupName: string, name: string, certificateEnvelope: models.CertificatePatchResource, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Get all certificates for a subscription. + * + * Get all certificates for a subscription. + * + * @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 Get all certificates for a subscription. + * + * Get all certificates for a subscription. + * + * @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 {CertificateCollection} - 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. + * + * {CertificateCollection} [result] - The deserialized result object if an error did not occur. + * See {@link CertificateCollection} 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; + + + /** + * @summary Get all certificates in a resource group. + * + * Get all certificates in a resource group. + * + * @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. + */ + listByResourceGroupNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get all certificates in a resource group. + * + * Get all certificates in a resource group. + * + * @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 {CertificateCollection} - 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. + * + * {CertificateCollection} [result] - The deserialized result object if an error did not occur. + * See {@link CertificateCollection} 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. + */ + listByResourceGroupNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByResourceGroupNext(nextPageLink: string, callback: ServiceCallback): void; + listByResourceGroupNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + +/** + * @class + * DeletedWebApps + * __NOTE__: An instance of this class is automatically created for an + * instance of the WebSiteManagementClient. + */ +export interface DeletedWebApps { + + + /** + * @summary Get all deleted apps for a subscription. + * + * Get all deleted apps for a subscription. + * + * @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. + */ + listWithHttpOperationResponse(options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get all deleted apps for a subscription. + * + * Get all deleted apps for a subscription. + * + * @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 {DeletedWebAppCollection} - 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. + * + * {DeletedWebAppCollection} [result] - The deserialized result object if an error did not occur. + * See {@link DeletedWebAppCollection} 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?: { customHeaders? : { [headerName: string]: string; } }): Promise; + list(callback: ServiceCallback): void; + list(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Get all deleted apps for a subscription. + * + * Get all deleted apps for a subscription. + * + * @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 Get all deleted apps for a subscription. + * + * Get all deleted apps for a subscription. + * + * @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 {DeletedWebAppCollection} - 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. + * + * {DeletedWebAppCollection} [result] - The deserialized result object if an error did not occur. + * See {@link DeletedWebAppCollection} 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 + * Diagnostics + * __NOTE__: An instance of this class is automatically created for an + * instance of the WebSiteManagementClient. + */ +export interface Diagnostics { + + + /** + * @summary List Hosting Environment Detector Responses + * + * List Hosting Environment Detector Responses + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site Name + * + * @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. + */ + listHostingEnvironmentDetectorResponsesWithHttpOperationResponse(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary List Hosting Environment Detector Responses + * + * List Hosting Environment Detector Responses + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site Name + * + * @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 {DetectorResponseCollection} - 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. + * + * {DetectorResponseCollection} [result] - The deserialized result object if an error did not occur. + * See {@link DetectorResponseCollection} 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. + */ + listHostingEnvironmentDetectorResponses(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listHostingEnvironmentDetectorResponses(resourceGroupName: string, name: string, callback: ServiceCallback): void; + listHostingEnvironmentDetectorResponses(resourceGroupName: string, name: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Get Hosting Environment Detector Response + * + * Get Hosting Environment Detector Response + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name App Service Environment Name + * + * @param {string} detectorName Detector Resource Name + * + * @param {object} [options] Optional Parameters. + * + * @param {date} [options.startTime] Start Time + * + * @param {date} [options.endTime] End Time + * + * @param {string} [options.timeGrain] Time Grain + * + * @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. + */ + getHostingEnvironmentDetectorResponseWithHttpOperationResponse(resourceGroupName: string, name: string, detectorName: string, options?: { startTime? : Date, endTime? : Date, timeGrain? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get Hosting Environment Detector Response + * + * Get Hosting Environment Detector Response + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name App Service Environment Name + * + * @param {string} detectorName Detector Resource Name + * + * @param {object} [options] Optional Parameters. + * + * @param {date} [options.startTime] Start Time + * + * @param {date} [options.endTime] End Time + * + * @param {string} [options.timeGrain] Time Grain + * + * @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 {DetectorResponse} - 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. + * + * {DetectorResponse} [result] - The deserialized result object if an error did not occur. + * See {@link DetectorResponse} 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. + */ + getHostingEnvironmentDetectorResponse(resourceGroupName: string, name: string, detectorName: string, options?: { startTime? : Date, endTime? : Date, timeGrain? : string, customHeaders? : { [headerName: string]: string; } }): Promise; + getHostingEnvironmentDetectorResponse(resourceGroupName: string, name: string, detectorName: string, callback: ServiceCallback): void; + getHostingEnvironmentDetectorResponse(resourceGroupName: string, name: string, detectorName: string, options: { startTime? : Date, endTime? : Date, timeGrain? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary List Site Detector Responses + * + * List Site Detector Responses + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} siteName Site Name + * + * @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. + */ + listSiteDetectorResponsesWithHttpOperationResponse(resourceGroupName: string, siteName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary List Site Detector Responses + * + * List Site Detector Responses + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} siteName Site Name + * + * @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 {DetectorResponseCollection} - 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. + * + * {DetectorResponseCollection} [result] - The deserialized result object if an error did not occur. + * See {@link DetectorResponseCollection} 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. + */ + listSiteDetectorResponses(resourceGroupName: string, siteName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listSiteDetectorResponses(resourceGroupName: string, siteName: string, callback: ServiceCallback): void; + listSiteDetectorResponses(resourceGroupName: string, siteName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Get site detector response + * + * Get site detector response + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} siteName Site Name + * + * @param {string} detectorName Detector Resource Name + * + * @param {object} [options] Optional Parameters. + * + * @param {date} [options.startTime] Start Time + * + * @param {date} [options.endTime] End Time + * + * @param {string} [options.timeGrain] Time Grain + * + * @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. + */ + getSiteDetectorResponseWithHttpOperationResponse(resourceGroupName: string, siteName: string, detectorName: string, options?: { startTime? : Date, endTime? : Date, timeGrain? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get site detector response + * + * Get site detector response + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} siteName Site Name + * + * @param {string} detectorName Detector Resource Name + * + * @param {object} [options] Optional Parameters. + * + * @param {date} [options.startTime] Start Time + * + * @param {date} [options.endTime] End Time + * + * @param {string} [options.timeGrain] Time Grain + * + * @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 {DetectorResponse} - 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. + * + * {DetectorResponse} [result] - The deserialized result object if an error did not occur. + * See {@link DetectorResponse} 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. + */ + getSiteDetectorResponse(resourceGroupName: string, siteName: string, detectorName: string, options?: { startTime? : Date, endTime? : Date, timeGrain? : string, customHeaders? : { [headerName: string]: string; } }): Promise; + getSiteDetectorResponse(resourceGroupName: string, siteName: string, detectorName: string, callback: ServiceCallback): void; + getSiteDetectorResponse(resourceGroupName: string, siteName: string, detectorName: string, options: { startTime? : Date, endTime? : Date, timeGrain? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Get Diagnostics Categories + * + * Get Diagnostics Categories + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} siteName Site Name + * + * @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. + */ + listSiteDiagnosticCategoriesWithHttpOperationResponse(resourceGroupName: string, siteName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get Diagnostics Categories + * + * Get Diagnostics Categories + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} siteName Site Name + * + * @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 {DiagnosticCategoryCollection} - 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. + * + * {DiagnosticCategoryCollection} [result] - The deserialized result object if an error did not occur. + * See {@link DiagnosticCategoryCollection} 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. + */ + listSiteDiagnosticCategories(resourceGroupName: string, siteName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listSiteDiagnosticCategories(resourceGroupName: string, siteName: string, callback: ServiceCallback): void; + listSiteDiagnosticCategories(resourceGroupName: string, siteName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Get Diagnostics Category + * + * Get Diagnostics Category + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} siteName Site Name + * + * @param {string} diagnosticCategory Diagnostic Category + * + * @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. + */ + getSiteDiagnosticCategoryWithHttpOperationResponse(resourceGroupName: string, siteName: string, diagnosticCategory: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get Diagnostics Category + * + * Get Diagnostics Category + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} siteName Site Name + * + * @param {string} diagnosticCategory Diagnostic Category + * + * @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 {DiagnosticCategory} - 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. + * + * {DiagnosticCategory} [result] - The deserialized result object if an error did not occur. + * See {@link DiagnosticCategory} 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. + */ + getSiteDiagnosticCategory(resourceGroupName: string, siteName: string, diagnosticCategory: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getSiteDiagnosticCategory(resourceGroupName: string, siteName: string, diagnosticCategory: string, callback: ServiceCallback): void; + getSiteDiagnosticCategory(resourceGroupName: string, siteName: string, diagnosticCategory: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Get Site Analyses + * + * Get Site Analyses + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} siteName Site Name + * + * @param {string} diagnosticCategory Diagnostic Category + * + * @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. + */ + listSiteAnalysesWithHttpOperationResponse(resourceGroupName: string, siteName: string, diagnosticCategory: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get Site Analyses + * + * Get Site Analyses + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} siteName Site Name + * + * @param {string} diagnosticCategory Diagnostic Category + * + * @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 {DiagnosticAnalysisCollection} - 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. + * + * {DiagnosticAnalysisCollection} [result] - The deserialized result object if an error did not occur. + * See {@link DiagnosticAnalysisCollection} 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. + */ + listSiteAnalyses(resourceGroupName: string, siteName: string, diagnosticCategory: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listSiteAnalyses(resourceGroupName: string, siteName: string, diagnosticCategory: string, callback: ServiceCallback): void; + listSiteAnalyses(resourceGroupName: string, siteName: string, diagnosticCategory: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Get Site Analysis + * + * Get Site Analysis + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} siteName Site Name + * + * @param {string} diagnosticCategory Diagnostic Category + * + * @param {string} analysisName Analysis Name + * + * @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. + */ + getSiteAnalysisWithHttpOperationResponse(resourceGroupName: string, siteName: string, diagnosticCategory: string, analysisName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get Site Analysis + * + * Get Site Analysis + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} siteName Site Name + * + * @param {string} diagnosticCategory Diagnostic Category + * + * @param {string} analysisName Analysis Name + * + * @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 {DiagnosticAnalysis} - 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. + * + * {DiagnosticAnalysis} [result] - The deserialized result object if an error did not occur. + * See {@link DiagnosticAnalysis} 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. + */ + getSiteAnalysis(resourceGroupName: string, siteName: string, diagnosticCategory: string, analysisName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getSiteAnalysis(resourceGroupName: string, siteName: string, diagnosticCategory: string, analysisName: string, callback: ServiceCallback): void; + getSiteAnalysis(resourceGroupName: string, siteName: string, diagnosticCategory: string, analysisName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Execute Analysis + * + * Execute Analysis + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} siteName Site Name + * + * @param {string} diagnosticCategory Category Name + * + * @param {string} analysisName Analysis Resource Name + * + * @param {object} [options] Optional Parameters. + * + * @param {date} [options.startTime] Start Time + * + * @param {date} [options.endTime] End Time + * + * @param {string} [options.timeGrain] Time Grain + * + * @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. + */ + executeSiteAnalysisWithHttpOperationResponse(resourceGroupName: string, siteName: string, diagnosticCategory: string, analysisName: string, options?: { startTime? : Date, endTime? : Date, timeGrain? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Execute Analysis + * + * Execute Analysis + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} siteName Site Name + * + * @param {string} diagnosticCategory Category Name + * + * @param {string} analysisName Analysis Resource Name + * + * @param {object} [options] Optional Parameters. + * + * @param {date} [options.startTime] Start Time + * + * @param {date} [options.endTime] End Time + * + * @param {string} [options.timeGrain] Time Grain + * + * @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 {DiagnosticAnalysis} - 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. + * + * {DiagnosticAnalysis} [result] - The deserialized result object if an error did not occur. + * See {@link DiagnosticAnalysis} 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. + */ + executeSiteAnalysis(resourceGroupName: string, siteName: string, diagnosticCategory: string, analysisName: string, options?: { startTime? : Date, endTime? : Date, timeGrain? : string, customHeaders? : { [headerName: string]: string; } }): Promise; + executeSiteAnalysis(resourceGroupName: string, siteName: string, diagnosticCategory: string, analysisName: string, callback: ServiceCallback): void; + executeSiteAnalysis(resourceGroupName: string, siteName: string, diagnosticCategory: string, analysisName: string, options: { startTime? : Date, endTime? : Date, timeGrain? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Get Detectors + * + * Get Detectors + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} siteName Site Name + * + * @param {string} diagnosticCategory Diagnostic Category + * + * @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. + */ + listSiteDetectorsWithHttpOperationResponse(resourceGroupName: string, siteName: string, diagnosticCategory: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get Detectors + * + * Get Detectors + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} siteName Site Name + * + * @param {string} diagnosticCategory Diagnostic Category + * + * @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 {DiagnosticDetectorCollection} - 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. + * + * {DiagnosticDetectorCollection} [result] - The deserialized result object if an error did not occur. + * See {@link DiagnosticDetectorCollection} 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. + */ + listSiteDetectors(resourceGroupName: string, siteName: string, diagnosticCategory: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listSiteDetectors(resourceGroupName: string, siteName: string, diagnosticCategory: string, callback: ServiceCallback): void; + listSiteDetectors(resourceGroupName: string, siteName: string, diagnosticCategory: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Get Detector + * + * Get Detector + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} siteName Site Name + * + * @param {string} diagnosticCategory Diagnostic Category + * + * @param {string} detectorName Detector Name + * + * @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. + */ + getSiteDetectorWithHttpOperationResponse(resourceGroupName: string, siteName: string, diagnosticCategory: string, detectorName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get Detector + * + * Get Detector + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} siteName Site Name + * + * @param {string} diagnosticCategory Diagnostic Category + * + * @param {string} detectorName Detector Name + * + * @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 {DiagnosticDetectorCollection} - 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. + * + * {DiagnosticDetectorCollection} [result] - The deserialized result object if an error did not occur. + * See {@link DiagnosticDetectorCollection} 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. + */ + getSiteDetector(resourceGroupName: string, siteName: string, diagnosticCategory: string, detectorName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getSiteDetector(resourceGroupName: string, siteName: string, diagnosticCategory: string, detectorName: string, callback: ServiceCallback): void; + getSiteDetector(resourceGroupName: string, siteName: string, diagnosticCategory: string, detectorName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Execute Detector + * + * Execute Detector + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} siteName Site Name + * + * @param {string} detectorName Detector Resource Name + * + * @param {string} diagnosticCategory Category Name + * + * @param {object} [options] Optional Parameters. + * + * @param {date} [options.startTime] Start Time + * + * @param {date} [options.endTime] End Time + * + * @param {string} [options.timeGrain] Time Grain + * + * @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. + */ + executeSiteDetectorWithHttpOperationResponse(resourceGroupName: string, siteName: string, detectorName: string, diagnosticCategory: string, options?: { startTime? : Date, endTime? : Date, timeGrain? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Execute Detector + * + * Execute Detector + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} siteName Site Name + * + * @param {string} detectorName Detector Resource Name + * + * @param {string} diagnosticCategory Category Name + * + * @param {object} [options] Optional Parameters. + * + * @param {date} [options.startTime] Start Time + * + * @param {date} [options.endTime] End Time + * + * @param {string} [options.timeGrain] Time Grain + * + * @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 {DiagnosticDetectorResponse} - 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. + * + * {DiagnosticDetectorResponse} [result] - The deserialized result object if an error did not occur. + * See {@link DiagnosticDetectorResponse} 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. + */ + executeSiteDetector(resourceGroupName: string, siteName: string, detectorName: string, diagnosticCategory: string, options?: { startTime? : Date, endTime? : Date, timeGrain? : string, customHeaders? : { [headerName: string]: string; } }): Promise; + executeSiteDetector(resourceGroupName: string, siteName: string, detectorName: string, diagnosticCategory: string, callback: ServiceCallback): void; + executeSiteDetector(resourceGroupName: string, siteName: string, detectorName: string, diagnosticCategory: string, options: { startTime? : Date, endTime? : Date, timeGrain? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary List Site Detector Responses + * + * List Site Detector Responses + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} siteName Site Name + * + * @param {string} slot Slot Name + * + * @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. + */ + listSiteDetectorResponsesSlotWithHttpOperationResponse(resourceGroupName: string, siteName: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary List Site Detector Responses + * + * List Site Detector Responses + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} siteName Site Name + * + * @param {string} slot Slot Name + * + * @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 {DetectorResponseCollection} - 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. + * + * {DetectorResponseCollection} [result] - The deserialized result object if an error did not occur. + * See {@link DetectorResponseCollection} 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. + */ + listSiteDetectorResponsesSlot(resourceGroupName: string, siteName: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listSiteDetectorResponsesSlot(resourceGroupName: string, siteName: string, slot: string, callback: ServiceCallback): void; + listSiteDetectorResponsesSlot(resourceGroupName: string, siteName: string, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Get site detector response + * + * Get site detector response + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} siteName Site Name + * + * @param {string} detectorName Detector Resource Name + * + * @param {string} slot Slot Name + * + * @param {object} [options] Optional Parameters. + * + * @param {date} [options.startTime] Start Time + * + * @param {date} [options.endTime] End Time + * + * @param {string} [options.timeGrain] Time Grain + * + * @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. + */ + getSiteDetectorResponseSlotWithHttpOperationResponse(resourceGroupName: string, siteName: string, detectorName: string, slot: string, options?: { startTime? : Date, endTime? : Date, timeGrain? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get site detector response + * + * Get site detector response + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} siteName Site Name + * + * @param {string} detectorName Detector Resource Name + * + * @param {string} slot Slot Name + * + * @param {object} [options] Optional Parameters. + * + * @param {date} [options.startTime] Start Time + * + * @param {date} [options.endTime] End Time + * + * @param {string} [options.timeGrain] Time Grain + * + * @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 {DetectorResponse} - 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. + * + * {DetectorResponse} [result] - The deserialized result object if an error did not occur. + * See {@link DetectorResponse} 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. + */ + getSiteDetectorResponseSlot(resourceGroupName: string, siteName: string, detectorName: string, slot: string, options?: { startTime? : Date, endTime? : Date, timeGrain? : string, customHeaders? : { [headerName: string]: string; } }): Promise; + getSiteDetectorResponseSlot(resourceGroupName: string, siteName: string, detectorName: string, slot: string, callback: ServiceCallback): void; + getSiteDetectorResponseSlot(resourceGroupName: string, siteName: string, detectorName: string, slot: string, options: { startTime? : Date, endTime? : Date, timeGrain? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Get Diagnostics Categories + * + * Get Diagnostics Categories + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} siteName Site Name + * + * @param {string} slot Slot Name + * + * @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. + */ + listSiteDiagnosticCategoriesSlotWithHttpOperationResponse(resourceGroupName: string, siteName: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get Diagnostics Categories + * + * Get Diagnostics Categories + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} siteName Site Name + * + * @param {string} slot Slot Name + * + * @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 {DiagnosticCategoryCollection} - 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. + * + * {DiagnosticCategoryCollection} [result] - The deserialized result object if an error did not occur. + * See {@link DiagnosticCategoryCollection} 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. + */ + listSiteDiagnosticCategoriesSlot(resourceGroupName: string, siteName: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listSiteDiagnosticCategoriesSlot(resourceGroupName: string, siteName: string, slot: string, callback: ServiceCallback): void; + listSiteDiagnosticCategoriesSlot(resourceGroupName: string, siteName: string, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Get Diagnostics Category + * + * Get Diagnostics Category + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} siteName Site Name + * + * @param {string} diagnosticCategory Diagnostic Category + * + * @param {string} slot Slot Name + * + * @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. + */ + getSiteDiagnosticCategorySlotWithHttpOperationResponse(resourceGroupName: string, siteName: string, diagnosticCategory: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get Diagnostics Category + * + * Get Diagnostics Category + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} siteName Site Name + * + * @param {string} diagnosticCategory Diagnostic Category + * + * @param {string} slot Slot Name + * + * @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 {DiagnosticCategory} - 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. + * + * {DiagnosticCategory} [result] - The deserialized result object if an error did not occur. + * See {@link DiagnosticCategory} 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. + */ + getSiteDiagnosticCategorySlot(resourceGroupName: string, siteName: string, diagnosticCategory: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getSiteDiagnosticCategorySlot(resourceGroupName: string, siteName: string, diagnosticCategory: string, slot: string, callback: ServiceCallback): void; + getSiteDiagnosticCategorySlot(resourceGroupName: string, siteName: string, diagnosticCategory: string, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Get Site Analyses + * + * Get Site Analyses + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} siteName Site Name + * + * @param {string} diagnosticCategory Diagnostic Category + * + * @param {string} slot Slot Name + * + * @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. + */ + listSiteAnalysesSlotWithHttpOperationResponse(resourceGroupName: string, siteName: string, diagnosticCategory: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get Site Analyses + * + * Get Site Analyses + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} siteName Site Name + * + * @param {string} diagnosticCategory Diagnostic Category + * + * @param {string} slot Slot Name + * + * @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 {DiagnosticAnalysisCollection} - 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. + * + * {DiagnosticAnalysisCollection} [result] - The deserialized result object if an error did not occur. + * See {@link DiagnosticAnalysisCollection} 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. + */ + listSiteAnalysesSlot(resourceGroupName: string, siteName: string, diagnosticCategory: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listSiteAnalysesSlot(resourceGroupName: string, siteName: string, diagnosticCategory: string, slot: string, callback: ServiceCallback): void; + listSiteAnalysesSlot(resourceGroupName: string, siteName: string, diagnosticCategory: string, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Get Site Analysis + * + * Get Site Analysis + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} siteName Site Name + * + * @param {string} diagnosticCategory Diagnostic Category + * + * @param {string} analysisName Analysis Name + * + * @param {string} slot Slot - optional + * + * @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. + */ + getSiteAnalysisSlotWithHttpOperationResponse(resourceGroupName: string, siteName: string, diagnosticCategory: string, analysisName: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get Site Analysis + * + * Get Site Analysis + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} siteName Site Name + * + * @param {string} diagnosticCategory Diagnostic Category + * + * @param {string} analysisName Analysis Name + * + * @param {string} slot Slot - optional + * + * @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 {DiagnosticAnalysis} - 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. + * + * {DiagnosticAnalysis} [result] - The deserialized result object if an error did not occur. + * See {@link DiagnosticAnalysis} 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. + */ + getSiteAnalysisSlot(resourceGroupName: string, siteName: string, diagnosticCategory: string, analysisName: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getSiteAnalysisSlot(resourceGroupName: string, siteName: string, diagnosticCategory: string, analysisName: string, slot: string, callback: ServiceCallback): void; + getSiteAnalysisSlot(resourceGroupName: string, siteName: string, diagnosticCategory: string, analysisName: string, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Execute Analysis + * + * Execute Analysis + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} siteName Site Name + * + * @param {string} diagnosticCategory Category Name + * + * @param {string} analysisName Analysis Resource Name + * + * @param {string} slot Slot Name + * + * @param {object} [options] Optional Parameters. + * + * @param {date} [options.startTime] Start Time + * + * @param {date} [options.endTime] End Time + * + * @param {string} [options.timeGrain] Time Grain + * + * @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. + */ + executeSiteAnalysisSlotWithHttpOperationResponse(resourceGroupName: string, siteName: string, diagnosticCategory: string, analysisName: string, slot: string, options?: { startTime? : Date, endTime? : Date, timeGrain? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Execute Analysis + * + * Execute Analysis + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} siteName Site Name + * + * @param {string} diagnosticCategory Category Name + * + * @param {string} analysisName Analysis Resource Name + * + * @param {string} slot Slot Name + * + * @param {object} [options] Optional Parameters. + * + * @param {date} [options.startTime] Start Time + * + * @param {date} [options.endTime] End Time + * + * @param {string} [options.timeGrain] Time Grain + * + * @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 {DiagnosticAnalysis} - 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. + * + * {DiagnosticAnalysis} [result] - The deserialized result object if an error did not occur. + * See {@link DiagnosticAnalysis} 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. + */ + executeSiteAnalysisSlot(resourceGroupName: string, siteName: string, diagnosticCategory: string, analysisName: string, slot: string, options?: { startTime? : Date, endTime? : Date, timeGrain? : string, customHeaders? : { [headerName: string]: string; } }): Promise; + executeSiteAnalysisSlot(resourceGroupName: string, siteName: string, diagnosticCategory: string, analysisName: string, slot: string, callback: ServiceCallback): void; + executeSiteAnalysisSlot(resourceGroupName: string, siteName: string, diagnosticCategory: string, analysisName: string, slot: string, options: { startTime? : Date, endTime? : Date, timeGrain? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Get Detectors + * + * Get Detectors + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} siteName Site Name + * + * @param {string} diagnosticCategory Diagnostic Category + * + * @param {string} slot Slot Name + * + * @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. + */ + listSiteDetectorsSlotWithHttpOperationResponse(resourceGroupName: string, siteName: string, diagnosticCategory: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get Detectors + * + * Get Detectors + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} siteName Site Name + * + * @param {string} diagnosticCategory Diagnostic Category + * + * @param {string} slot Slot Name + * + * @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 {DiagnosticDetectorCollection} - 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. + * + * {DiagnosticDetectorCollection} [result] - The deserialized result object if an error did not occur. + * See {@link DiagnosticDetectorCollection} 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. + */ + listSiteDetectorsSlot(resourceGroupName: string, siteName: string, diagnosticCategory: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listSiteDetectorsSlot(resourceGroupName: string, siteName: string, diagnosticCategory: string, slot: string, callback: ServiceCallback): void; + listSiteDetectorsSlot(resourceGroupName: string, siteName: string, diagnosticCategory: string, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Get Detector + * + * Get Detector + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} siteName Site Name + * + * @param {string} diagnosticCategory Diagnostic Category + * + * @param {string} detectorName Detector Name + * + * @param {string} slot Slot Name + * + * @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. + */ + getSiteDetectorSlotWithHttpOperationResponse(resourceGroupName: string, siteName: string, diagnosticCategory: string, detectorName: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get Detector + * + * Get Detector + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} siteName Site Name + * + * @param {string} diagnosticCategory Diagnostic Category + * + * @param {string} detectorName Detector Name + * + * @param {string} slot Slot Name + * + * @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 {DiagnosticDetectorCollection} - 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. + * + * {DiagnosticDetectorCollection} [result] - The deserialized result object if an error did not occur. + * See {@link DiagnosticDetectorCollection} 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. + */ + getSiteDetectorSlot(resourceGroupName: string, siteName: string, diagnosticCategory: string, detectorName: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getSiteDetectorSlot(resourceGroupName: string, siteName: string, diagnosticCategory: string, detectorName: string, slot: string, callback: ServiceCallback): void; + getSiteDetectorSlot(resourceGroupName: string, siteName: string, diagnosticCategory: string, detectorName: string, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Execute Detector + * + * Execute Detector + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} siteName Site Name + * + * @param {string} detectorName Detector Resource Name + * + * @param {string} diagnosticCategory Category Name + * + * @param {string} slot Slot Name + * + * @param {object} [options] Optional Parameters. + * + * @param {date} [options.startTime] Start Time + * + * @param {date} [options.endTime] End Time + * + * @param {string} [options.timeGrain] Time Grain + * + * @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. + */ + executeSiteDetectorSlotWithHttpOperationResponse(resourceGroupName: string, siteName: string, detectorName: string, diagnosticCategory: string, slot: string, options?: { startTime? : Date, endTime? : Date, timeGrain? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Execute Detector + * + * Execute Detector + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} siteName Site Name + * + * @param {string} detectorName Detector Resource Name + * + * @param {string} diagnosticCategory Category Name + * + * @param {string} slot Slot Name + * + * @param {object} [options] Optional Parameters. + * + * @param {date} [options.startTime] Start Time + * + * @param {date} [options.endTime] End Time + * + * @param {string} [options.timeGrain] Time Grain + * + * @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 {DiagnosticDetectorResponse} - 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. + * + * {DiagnosticDetectorResponse} [result] - The deserialized result object if an error did not occur. + * See {@link DiagnosticDetectorResponse} 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. + */ + executeSiteDetectorSlot(resourceGroupName: string, siteName: string, detectorName: string, diagnosticCategory: string, slot: string, options?: { startTime? : Date, endTime? : Date, timeGrain? : string, customHeaders? : { [headerName: string]: string; } }): Promise; + executeSiteDetectorSlot(resourceGroupName: string, siteName: string, detectorName: string, diagnosticCategory: string, slot: string, callback: ServiceCallback): void; + executeSiteDetectorSlot(resourceGroupName: string, siteName: string, detectorName: string, diagnosticCategory: string, slot: string, options: { startTime? : Date, endTime? : Date, timeGrain? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary List Hosting Environment Detector Responses + * + * List Hosting Environment Detector Responses + * + * @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. + */ + listHostingEnvironmentDetectorResponsesNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary List Hosting Environment Detector Responses + * + * List Hosting Environment Detector Responses + * + * @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 {DetectorResponseCollection} - 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. + * + * {DetectorResponseCollection} [result] - The deserialized result object if an error did not occur. + * See {@link DetectorResponseCollection} 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. + */ + listHostingEnvironmentDetectorResponsesNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listHostingEnvironmentDetectorResponsesNext(nextPageLink: string, callback: ServiceCallback): void; + listHostingEnvironmentDetectorResponsesNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary List Site Detector Responses + * + * List Site Detector Responses + * + * @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. + */ + listSiteDetectorResponsesNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary List Site Detector Responses + * + * List Site Detector Responses + * + * @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 {DetectorResponseCollection} - 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. + * + * {DetectorResponseCollection} [result] - The deserialized result object if an error did not occur. + * See {@link DetectorResponseCollection} 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. + */ + listSiteDetectorResponsesNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listSiteDetectorResponsesNext(nextPageLink: string, callback: ServiceCallback): void; + listSiteDetectorResponsesNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Get Diagnostics Categories + * + * Get Diagnostics Categories + * + * @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. + */ + listSiteDiagnosticCategoriesNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get Diagnostics Categories + * + * Get Diagnostics Categories + * + * @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 {DiagnosticCategoryCollection} - 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. + * + * {DiagnosticCategoryCollection} [result] - The deserialized result object if an error did not occur. + * See {@link DiagnosticCategoryCollection} 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. + */ + listSiteDiagnosticCategoriesNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listSiteDiagnosticCategoriesNext(nextPageLink: string, callback: ServiceCallback): void; + listSiteDiagnosticCategoriesNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Get Site Analyses + * + * Get Site Analyses + * + * @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. + */ + listSiteAnalysesNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get Site Analyses + * + * Get Site Analyses + * + * @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 {DiagnosticAnalysisCollection} - 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. + * + * {DiagnosticAnalysisCollection} [result] - The deserialized result object if an error did not occur. + * See {@link DiagnosticAnalysisCollection} 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. + */ + listSiteAnalysesNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listSiteAnalysesNext(nextPageLink: string, callback: ServiceCallback): void; + listSiteAnalysesNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Get Detectors + * + * Get Detectors + * + * @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. + */ + listSiteDetectorsNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get Detectors + * + * Get Detectors + * + * @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 {DiagnosticDetectorCollection} - 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. + * + * {DiagnosticDetectorCollection} [result] - The deserialized result object if an error did not occur. + * See {@link DiagnosticDetectorCollection} 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. + */ + listSiteDetectorsNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listSiteDetectorsNext(nextPageLink: string, callback: ServiceCallback): void; + listSiteDetectorsNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Get Detector + * + * Get Detector + * + * @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. + */ + getSiteDetectorNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get Detector + * + * Get Detector + * + * @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 {DiagnosticDetectorCollection} - 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. + * + * {DiagnosticDetectorCollection} [result] - The deserialized result object if an error did not occur. + * See {@link DiagnosticDetectorCollection} 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. + */ + getSiteDetectorNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getSiteDetectorNext(nextPageLink: string, callback: ServiceCallback): void; + getSiteDetectorNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary List Site Detector Responses + * + * List Site Detector Responses + * + * @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. + */ + listSiteDetectorResponsesSlotNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary List Site Detector Responses + * + * List Site Detector Responses + * + * @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 {DetectorResponseCollection} - 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. + * + * {DetectorResponseCollection} [result] - The deserialized result object if an error did not occur. + * See {@link DetectorResponseCollection} 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. + */ + listSiteDetectorResponsesSlotNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listSiteDetectorResponsesSlotNext(nextPageLink: string, callback: ServiceCallback): void; + listSiteDetectorResponsesSlotNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Get Diagnostics Categories + * + * Get Diagnostics Categories + * + * @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. + */ + listSiteDiagnosticCategoriesSlotNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get Diagnostics Categories + * + * Get Diagnostics Categories + * + * @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 {DiagnosticCategoryCollection} - 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. + * + * {DiagnosticCategoryCollection} [result] - The deserialized result object if an error did not occur. + * See {@link DiagnosticCategoryCollection} 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. + */ + listSiteDiagnosticCategoriesSlotNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listSiteDiagnosticCategoriesSlotNext(nextPageLink: string, callback: ServiceCallback): void; + listSiteDiagnosticCategoriesSlotNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Get Site Analyses + * + * Get Site Analyses + * + * @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. + */ + listSiteAnalysesSlotNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get Site Analyses + * + * Get Site Analyses + * + * @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 {DiagnosticAnalysisCollection} - 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. + * + * {DiagnosticAnalysisCollection} [result] - The deserialized result object if an error did not occur. + * See {@link DiagnosticAnalysisCollection} 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. + */ + listSiteAnalysesSlotNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listSiteAnalysesSlotNext(nextPageLink: string, callback: ServiceCallback): void; + listSiteAnalysesSlotNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Get Detectors + * + * Get Detectors + * + * @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. + */ + listSiteDetectorsSlotNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get Detectors + * + * Get Detectors + * + * @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 {DiagnosticDetectorCollection} - 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. + * + * {DiagnosticDetectorCollection} [result] - The deserialized result object if an error did not occur. + * See {@link DiagnosticDetectorCollection} 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. + */ + listSiteDetectorsSlotNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listSiteDetectorsSlotNext(nextPageLink: string, callback: ServiceCallback): void; + listSiteDetectorsSlotNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Get Detector + * + * Get Detector + * + * @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. + */ + getSiteDetectorSlotNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get Detector + * + * Get Detector + * + * @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 {DiagnosticDetectorCollection} - 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. + * + * {DiagnosticDetectorCollection} [result] - The deserialized result object if an error did not occur. + * See {@link DiagnosticDetectorCollection} 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. + */ + getSiteDetectorSlotNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getSiteDetectorSlotNext(nextPageLink: string, callback: ServiceCallback): void; + getSiteDetectorSlotNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + +/** + * @class + * Provider + * __NOTE__: An instance of this class is automatically created for an + * instance of the WebSiteManagementClient. + */ +export interface Provider { + + + /** + * @summary Get available application frameworks and their versions + * + * Get available application frameworks and their versions + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.osTypeSelected] Possible values include: 'Windows', + * 'Linux' + * + * @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. + */ + getAvailableStacksWithHttpOperationResponse(options?: { osTypeSelected? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get available application frameworks and their versions + * + * Get available application frameworks and their versions + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.osTypeSelected] Possible values include: 'Windows', + * 'Linux' + * + * @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 {ApplicationStackCollection} - 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. + * + * {ApplicationStackCollection} [result] - The deserialized result object if an error did not occur. + * See {@link ApplicationStackCollection} 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. + */ + getAvailableStacks(options?: { osTypeSelected? : string, customHeaders? : { [headerName: string]: string; } }): Promise; + getAvailableStacks(callback: ServiceCallback): void; + getAvailableStacks(options: { osTypeSelected? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Gets all available operations for the Microsoft.Web resource + * provider. Also exposes resource metric definitions + * + * Gets all available operations for the Microsoft.Web resource provider. Also + * exposes resource metric definitions + * + * @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. + */ + listOperationsWithHttpOperationResponse(options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets all available operations for the Microsoft.Web resource + * provider. Also exposes resource metric definitions + * + * Gets all available operations for the Microsoft.Web resource provider. Also + * exposes resource metric definitions + * + * @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 {CsmOperationCollection} - 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. + * + * {CsmOperationCollection} [result] - The deserialized result object if an error did not occur. + * See {@link CsmOperationCollection} 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. + */ + listOperations(options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listOperations(callback: ServiceCallback): void; + listOperations(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Get available application frameworks and their versions + * + * Get available application frameworks and their versions + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.osTypeSelected] Possible values include: 'Windows', + * 'Linux' + * + * @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. + */ + getAvailableStacksOnPremWithHttpOperationResponse(options?: { osTypeSelected? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get available application frameworks and their versions + * + * Get available application frameworks and their versions + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.osTypeSelected] Possible values include: 'Windows', + * 'Linux' + * + * @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 {ApplicationStackCollection} - 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. + * + * {ApplicationStackCollection} [result] - The deserialized result object if an error did not occur. + * See {@link ApplicationStackCollection} 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. + */ + getAvailableStacksOnPrem(options?: { osTypeSelected? : string, customHeaders? : { [headerName: string]: string; } }): Promise; + getAvailableStacksOnPrem(callback: ServiceCallback): void; + getAvailableStacksOnPrem(options: { osTypeSelected? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Get available application frameworks and their versions + * + * Get available application frameworks and their versions + * + * @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. + */ + getAvailableStacksNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get available application frameworks and their versions + * + * Get available application frameworks and their versions + * + * @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 {ApplicationStackCollection} - 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. + * + * {ApplicationStackCollection} [result] - The deserialized result object if an error did not occur. + * See {@link ApplicationStackCollection} 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. + */ + getAvailableStacksNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getAvailableStacksNext(nextPageLink: string, callback: ServiceCallback): void; + getAvailableStacksNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Gets all available operations for the Microsoft.Web resource + * provider. Also exposes resource metric definitions + * + * Gets all available operations for the Microsoft.Web resource provider. Also + * exposes resource metric definitions + * + * @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. + */ + listOperationsNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets all available operations for the Microsoft.Web resource + * provider. Also exposes resource metric definitions + * + * Gets all available operations for the Microsoft.Web resource provider. Also + * exposes resource metric definitions + * + * @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 {CsmOperationCollection} - 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. + * + * {CsmOperationCollection} [result] - The deserialized result object if an error did not occur. + * See {@link CsmOperationCollection} 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. + */ + listOperationsNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listOperationsNext(nextPageLink: string, callback: ServiceCallback): void; + listOperationsNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Get available application frameworks and their versions + * + * Get available application frameworks and their versions + * + * @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. + */ + getAvailableStacksOnPremNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get available application frameworks and their versions + * + * Get available application frameworks and their versions + * + * @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 {ApplicationStackCollection} - 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. + * + * {ApplicationStackCollection} [result] - The deserialized result object if an error did not occur. + * See {@link ApplicationStackCollection} 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. + */ + getAvailableStacksOnPremNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getAvailableStacksOnPremNext(nextPageLink: string, callback: ServiceCallback): void; + getAvailableStacksOnPremNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + +/** + * @class + * Recommendations + * __NOTE__: An instance of this class is automatically created for an + * instance of the WebSiteManagementClient. + */ +export interface Recommendations { + + + /** + * @summary List all recommendations for a subscription. + * + * List all recommendations for a subscription. + * + * @param {object} [options] Optional Parameters. + * + * @param {boolean} [options.featured] Specify true to return only + * the most critical recommendations. The default is false, which + * returns all recommendations. + * + * @param {string} [options.filter] Filter is specified by using OData syntax. + * Example: $filter=channel eq 'Api' or channel eq 'Notification' and startTime + * eq 2014-01-01T00:00:00Z and endTime eq 2014-12-31T23:59:59Z and timeGrain eq + * duration'[PT1H|PT1M|P1D] + * + * @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?: { featured? : boolean, filter? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary List all recommendations for a subscription. + * + * List all recommendations for a subscription. + * + * @param {object} [options] Optional Parameters. + * + * @param {boolean} [options.featured] Specify true to return only + * the most critical recommendations. The default is false, which + * returns all recommendations. + * + * @param {string} [options.filter] Filter is specified by using OData syntax. + * Example: $filter=channel eq 'Api' or channel eq 'Notification' and startTime + * eq 2014-01-01T00:00:00Z and endTime eq 2014-12-31T23:59:59Z and timeGrain eq + * duration'[PT1H|PT1M|P1D] + * + * @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 {RecommendationCollection} - 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. + * + * {RecommendationCollection} [result] - The deserialized result object if an error did not occur. + * See {@link RecommendationCollection} 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?: { featured? : boolean, filter? : string, customHeaders? : { [headerName: string]: string; } }): Promise; + list(callback: ServiceCallback): void; + list(options: { featured? : boolean, filter? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Reset all recommendation opt-out settings for a subscription. + * + * Reset all recommendation opt-out settings for a subscription. + * + * @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. + */ + resetAllFiltersWithHttpOperationResponse(options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Reset all recommendation opt-out settings for a subscription. + * + * Reset all recommendation opt-out settings for a subscription. + * + * @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 {null} - 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. + * + * {null} [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. + */ + resetAllFilters(options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + resetAllFilters(callback: ServiceCallback): void; + resetAllFilters(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Disables the specified rule so it will not apply to a subscription + * in the future. + * + * Disables the specified rule so it will not apply to a subscription in the + * future. + * + * @param {string} name Rule name + * + * @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. + */ + disableRecommendationForSubscriptionWithHttpOperationResponse(name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Disables the specified rule so it will not apply to a subscription + * in the future. + * + * Disables the specified rule so it will not apply to a subscription in the + * future. + * + * @param {string} name Rule name + * + * @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 {null} - 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. + * + * {null} [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. + */ + disableRecommendationForSubscription(name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + disableRecommendationForSubscription(name: string, callback: ServiceCallback): void; + disableRecommendationForSubscription(name: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Get past recommendations for an app, optionally specified by the + * time range. + * + * Get past recommendations for an app, optionally specified by the time range. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} siteName Name of the app. + * + * @param {object} [options] Optional Parameters. + * + * @param {boolean} [options.expiredOnly] Specify false to return + * all recommendations. The default is true, which returns only + * expired recommendations. + * + * @param {string} [options.filter] Filter is specified by using OData syntax. + * Example: $filter=channel eq 'Api' or channel eq 'Notification' and startTime + * eq 2014-01-01T00:00:00Z and endTime eq 2014-12-31T23:59:59Z and timeGrain eq + * duration'[PT1H|PT1M|P1D] + * + * @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. + */ + listHistoryForWebAppWithHttpOperationResponse(resourceGroupName: string, siteName: string, options?: { expiredOnly? : boolean, filter? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get past recommendations for an app, optionally specified by the + * time range. + * + * Get past recommendations for an app, optionally specified by the time range. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} siteName Name of the app. + * + * @param {object} [options] Optional Parameters. + * + * @param {boolean} [options.expiredOnly] Specify false to return + * all recommendations. The default is true, which returns only + * expired recommendations. + * + * @param {string} [options.filter] Filter is specified by using OData syntax. + * Example: $filter=channel eq 'Api' or channel eq 'Notification' and startTime + * eq 2014-01-01T00:00:00Z and endTime eq 2014-12-31T23:59:59Z and timeGrain eq + * duration'[PT1H|PT1M|P1D] + * + * @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 {RecommendationCollection} - 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. + * + * {RecommendationCollection} [result] - The deserialized result object if an error did not occur. + * See {@link RecommendationCollection} 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. + */ + listHistoryForWebApp(resourceGroupName: string, siteName: string, options?: { expiredOnly? : boolean, filter? : string, customHeaders? : { [headerName: string]: string; } }): Promise; + listHistoryForWebApp(resourceGroupName: string, siteName: string, callback: ServiceCallback): void; + listHistoryForWebApp(resourceGroupName: string, siteName: string, options: { expiredOnly? : boolean, filter? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Get all recommendations for an app. + * + * Get all recommendations for an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} siteName Name of the app. + * + * @param {object} [options] Optional Parameters. + * + * @param {boolean} [options.featured] Specify true to return only + * the most critical recommendations. The default is false, which + * returns all recommendations. + * + * @param {string} [options.filter] Return only channels specified in the + * filter. Filter is specified by using OData syntax. Example: $filter=channel + * eq 'Api' or channel eq 'Notification' + * + * @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. + */ + listRecommendedRulesForWebAppWithHttpOperationResponse(resourceGroupName: string, siteName: string, options?: { featured? : boolean, filter? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get all recommendations for an app. + * + * Get all recommendations for an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} siteName Name of the app. + * + * @param {object} [options] Optional Parameters. + * + * @param {boolean} [options.featured] Specify true to return only + * the most critical recommendations. The default is false, which + * returns all recommendations. + * + * @param {string} [options.filter] Return only channels specified in the + * filter. Filter is specified by using OData syntax. Example: $filter=channel + * eq 'Api' or channel eq 'Notification' + * + * @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 {RecommendationCollection} - 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. + * + * {RecommendationCollection} [result] - The deserialized result object if an error did not occur. + * See {@link RecommendationCollection} 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. + */ + listRecommendedRulesForWebApp(resourceGroupName: string, siteName: string, options?: { featured? : boolean, filter? : string, customHeaders? : { [headerName: string]: string; } }): Promise; + listRecommendedRulesForWebApp(resourceGroupName: string, siteName: string, callback: ServiceCallback): void; + listRecommendedRulesForWebApp(resourceGroupName: string, siteName: string, options: { featured? : boolean, filter? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Disable all recommendations for an app. + * + * Disable all recommendations for an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} siteName Name of the app. + * + * @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. + */ + disableAllForWebAppWithHttpOperationResponse(resourceGroupName: string, siteName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Disable all recommendations for an app. + * + * Disable all recommendations for an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} siteName Name of the app. + * + * @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 {null} - 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. + * + * {null} [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. + */ + disableAllForWebApp(resourceGroupName: string, siteName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + disableAllForWebApp(resourceGroupName: string, siteName: string, callback: ServiceCallback): void; + disableAllForWebApp(resourceGroupName: string, siteName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Reset all recommendation opt-out settings for an app. + * + * Reset all recommendation opt-out settings for an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} siteName Name of the app. + * + * @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. + */ + resetAllFiltersForWebAppWithHttpOperationResponse(resourceGroupName: string, siteName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Reset all recommendation opt-out settings for an app. + * + * Reset all recommendation opt-out settings for an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} siteName Name of the app. + * + * @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 {null} - 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. + * + * {null} [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. + */ + resetAllFiltersForWebApp(resourceGroupName: string, siteName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + resetAllFiltersForWebApp(resourceGroupName: string, siteName: string, callback: ServiceCallback): void; + resetAllFiltersForWebApp(resourceGroupName: string, siteName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Get a recommendation rule for an app. + * + * Get a recommendation rule for an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} siteName Name of the app. + * + * @param {string} name Name of the recommendation. + * + * @param {object} [options] Optional Parameters. + * + * @param {boolean} [options.updateSeen] Specify true to update + * the last-seen timestamp of the recommendation object. + * + * @param {string} [options.recommendationId] The GUID of the recommedation + * object if you query an expired one. You don't need to specify it to query an + * active entry. + * + * @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. + */ + getRuleDetailsByWebAppWithHttpOperationResponse(resourceGroupName: string, siteName: string, name: string, options?: { updateSeen? : boolean, recommendationId? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get a recommendation rule for an app. + * + * Get a recommendation rule for an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} siteName Name of the app. + * + * @param {string} name Name of the recommendation. + * + * @param {object} [options] Optional Parameters. + * + * @param {boolean} [options.updateSeen] Specify true to update + * the last-seen timestamp of the recommendation object. + * + * @param {string} [options.recommendationId] The GUID of the recommedation + * object if you query an expired one. You don't need to specify it to query an + * active entry. + * + * @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 {RecommendationRule} - 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. + * + * {RecommendationRule} [result] - The deserialized result object if an error did not occur. + * See {@link RecommendationRule} 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. + */ + getRuleDetailsByWebApp(resourceGroupName: string, siteName: string, name: string, options?: { updateSeen? : boolean, recommendationId? : string, customHeaders? : { [headerName: string]: string; } }): Promise; + getRuleDetailsByWebApp(resourceGroupName: string, siteName: string, name: string, callback: ServiceCallback): void; + getRuleDetailsByWebApp(resourceGroupName: string, siteName: string, name: string, options: { updateSeen? : boolean, recommendationId? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Disables the specific rule for a web site permanently. + * + * Disables the specific rule for a web site permanently. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} siteName Site name + * + * @param {string} name Rule name + * + * @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. + */ + disableRecommendationForSiteWithHttpOperationResponse(resourceGroupName: string, siteName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Disables the specific rule for a web site permanently. + * + * Disables the specific rule for a web site permanently. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} siteName Site name + * + * @param {string} name Rule name + * + * @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 {null} - 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. + * + * {null} [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. + */ + disableRecommendationForSite(resourceGroupName: string, siteName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + disableRecommendationForSite(resourceGroupName: string, siteName: string, name: string, callback: ServiceCallback): void; + disableRecommendationForSite(resourceGroupName: string, siteName: string, name: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary List all recommendations for a subscription. + * + * List all recommendations for a subscription. + * + * @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 List all recommendations for a subscription. + * + * List all recommendations for a subscription. + * + * @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 {RecommendationCollection} - 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. + * + * {RecommendationCollection} [result] - The deserialized result object if an error did not occur. + * See {@link RecommendationCollection} 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; + + + /** + * @summary Get past recommendations for an app, optionally specified by the + * time range. + * + * Get past recommendations for an app, optionally specified by the time range. + * + * @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. + */ + listHistoryForWebAppNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get past recommendations for an app, optionally specified by the + * time range. + * + * Get past recommendations for an app, optionally specified by the time range. + * + * @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 {RecommendationCollection} - 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. + * + * {RecommendationCollection} [result] - The deserialized result object if an error did not occur. + * See {@link RecommendationCollection} 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. + */ + listHistoryForWebAppNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listHistoryForWebAppNext(nextPageLink: string, callback: ServiceCallback): void; + listHistoryForWebAppNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Get all recommendations for an app. + * + * Get all recommendations for an app. + * + * @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. + */ + listRecommendedRulesForWebAppNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get all recommendations for an app. + * + * Get all recommendations for an app. + * + * @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 {RecommendationCollection} - 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. + * + * {RecommendationCollection} [result] - The deserialized result object if an error did not occur. + * See {@link RecommendationCollection} 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. + */ + listRecommendedRulesForWebAppNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listRecommendedRulesForWebAppNext(nextPageLink: string, callback: ServiceCallback): void; + listRecommendedRulesForWebAppNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + +/** + * @class + * WebApps + * __NOTE__: An instance of this class is automatically created for an + * instance of the WebSiteManagementClient. + */ +export interface WebApps { + + + /** + * @summary Get all apps for a subscription. + * + * Get all apps for a subscription. + * + * @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. + */ + listWithHttpOperationResponse(options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get all apps for a subscription. + * + * Get all apps for a subscription. + * + * @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 {WebAppCollection} - 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. + * + * {WebAppCollection} [result] - The deserialized result object if an error did not occur. + * See {@link WebAppCollection} 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?: { customHeaders? : { [headerName: string]: string; } }): Promise; + list(callback: ServiceCallback): void; + list(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Gets all web, mobile, and API apps in the specified resource group. + * + * Gets all web, mobile, and API apps in the specified resource group. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {object} [options] Optional Parameters. + * + * @param {boolean} [options.includeSlots] Specify true to + * include deployment slots in results. The default is false, which only gives + * you the production slot of all apps. + * + * @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. + */ + listByResourceGroupWithHttpOperationResponse(resourceGroupName: string, options?: { includeSlots? : boolean, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets all web, mobile, and API apps in the specified resource group. + * + * Gets all web, mobile, and API apps in the specified resource group. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {object} [options] Optional Parameters. + * + * @param {boolean} [options.includeSlots] Specify true to + * include deployment slots in results. The default is false, which only gives + * you the production slot of all apps. + * + * @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 {WebAppCollection} - 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. + * + * {WebAppCollection} [result] - The deserialized result object if an error did not occur. + * See {@link WebAppCollection} 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. + */ + listByResourceGroup(resourceGroupName: string, options?: { includeSlots? : boolean, customHeaders? : { [headerName: string]: string; } }): Promise; + listByResourceGroup(resourceGroupName: string, callback: ServiceCallback): void; + listByResourceGroup(resourceGroupName: string, options: { includeSlots? : boolean, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Gets the details of a web, mobile, or API app. + * + * Gets the details of a web, mobile, or API app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @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. + */ + getWithHttpOperationResponse(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets the details of a web, mobile, or API app. + * + * Gets the details of a web, mobile, or API app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @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 {Site} - 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. + * + * {Site} [result] - The deserialized result object if an error did not occur. + * See {@link Site} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + get(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(resourceGroupName: string, name: string, callback: ServiceCallback): void; + get(resourceGroupName: string, name: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Creates a new web, mobile, or API app in an existing resource + * group, or updates an existing app. + * + * Creates a new web, mobile, or API app in an existing resource group, or + * updates an existing app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Unique name of the app to create or update. To create + * or update a deployment slot, use the {slot} parameter. + * + * @param {object} siteEnvelope A JSON representation of the app properties. + * See example. + * + * @param {boolean} [siteEnvelope.enabled] true if the app is + * enabled; otherwise, false. Setting this value to false disables + * the app (takes the app offline). + * + * @param {array} [siteEnvelope.hostNameSslStates] Hostname SSL states are used + * to manage the SSL bindings for app's hostnames. + * + * @param {string} [siteEnvelope.serverFarmId] Resource ID of the associated + * App Service plan, formatted as: + * "/subscriptions/{subscriptionID}/resourceGroups/{groupName}/providers/Microsoft.Web/serverfarms/{appServicePlanName}". + * + * @param {boolean} [siteEnvelope.reserved] true if reserved; + * otherwise, false. + * + * @param {boolean} [siteEnvelope.isXenon] Obsolete: Hyper-V sandbox. + * + * @param {boolean} [siteEnvelope.hyperV] Hyper-V sandbox. + * + * @param {object} [siteEnvelope.siteConfig] Configuration of the app. + * + * @param {number} [siteEnvelope.siteConfig.numberOfWorkers] Number of workers. + * + * @param {array} [siteEnvelope.siteConfig.defaultDocuments] Default documents. + * + * @param {string} [siteEnvelope.siteConfig.netFrameworkVersion] .NET Framework + * version. + * + * @param {string} [siteEnvelope.siteConfig.phpVersion] Version of PHP. + * + * @param {string} [siteEnvelope.siteConfig.pythonVersion] Version of Python. + * + * @param {string} [siteEnvelope.siteConfig.nodeVersion] Version of Node.js. + * + * @param {string} [siteEnvelope.siteConfig.linuxFxVersion] Linux App Framework + * and version + * + * @param {string} [siteEnvelope.siteConfig.windowsFxVersion] Xenon App + * Framework and version + * + * @param {boolean} [siteEnvelope.siteConfig.requestTracingEnabled] + * true if request tracing is enabled; otherwise, + * false. + * + * @param {date} [siteEnvelope.siteConfig.requestTracingExpirationTime] Request + * tracing expiration time. + * + * @param {boolean} [siteEnvelope.siteConfig.remoteDebuggingEnabled] + * true if remote debugging is enabled; otherwise, + * false. + * + * @param {string} [siteEnvelope.siteConfig.remoteDebuggingVersion] Remote + * debugging version. + * + * @param {boolean} [siteEnvelope.siteConfig.httpLoggingEnabled] + * true if HTTP logging is enabled; otherwise, false. + * + * @param {number} [siteEnvelope.siteConfig.logsDirectorySizeLimit] HTTP logs + * directory size limit. + * + * @param {boolean} [siteEnvelope.siteConfig.detailedErrorLoggingEnabled] + * true if detailed error logging is enabled; otherwise, + * false. + * + * @param {string} [siteEnvelope.siteConfig.publishingUsername] Publishing user + * name. + * + * @param {array} [siteEnvelope.siteConfig.appSettings] Application settings. + * + * @param {object} [siteEnvelope.siteConfig.azureStorageAccounts] User-provided + * Azure storage accounts. + * + * @param {array} [siteEnvelope.siteConfig.connectionStrings] Connection + * strings. + * + * @param {array} [siteEnvelope.siteConfig.handlerMappings] Handler mappings. + * + * @param {string} [siteEnvelope.siteConfig.documentRoot] Document root. + * + * @param {string} [siteEnvelope.siteConfig.scmType] SCM type. Possible values + * include: 'None', 'Dropbox', 'Tfs', 'LocalGit', 'GitHub', 'CodePlexGit', + * 'CodePlexHg', 'BitbucketGit', 'BitbucketHg', 'ExternalGit', 'ExternalHg', + * 'OneDrive', 'VSO' + * + * @param {boolean} [siteEnvelope.siteConfig.use32BitWorkerProcess] + * true to use 32-bit worker process; otherwise, + * false. + * + * @param {boolean} [siteEnvelope.siteConfig.webSocketsEnabled] + * true if WebSocket is enabled; otherwise, false. + * + * @param {boolean} [siteEnvelope.siteConfig.alwaysOn] true if + * Always On is enabled; otherwise, false. + * + * @param {string} [siteEnvelope.siteConfig.javaVersion] Java version. + * + * @param {string} [siteEnvelope.siteConfig.javaContainer] Java container. + * + * @param {string} [siteEnvelope.siteConfig.javaContainerVersion] Java + * container version. + * + * @param {string} [siteEnvelope.siteConfig.appCommandLine] App command line to + * launch. + * + * @param {string} [siteEnvelope.siteConfig.managedPipelineMode] Managed + * pipeline mode. Possible values include: 'Integrated', 'Classic' + * + * @param {array} [siteEnvelope.siteConfig.virtualApplications] Virtual + * applications. + * + * @param {string} [siteEnvelope.siteConfig.loadBalancing] Site load balancing. + * Possible values include: 'WeightedRoundRobin', 'LeastRequests', + * 'LeastResponseTime', 'WeightedTotalTraffic', 'RequestHash' + * + * @param {object} [siteEnvelope.siteConfig.experiments] This is work around + * for polymophic types. + * + * @param {array} [siteEnvelope.siteConfig.experiments.rampUpRules] List of + * ramp-up rules. + * + * @param {object} [siteEnvelope.siteConfig.limits] Site limits. + * + * @param {number} [siteEnvelope.siteConfig.limits.maxPercentageCpu] Maximum + * allowed CPU usage percentage. + * + * @param {number} [siteEnvelope.siteConfig.limits.maxMemoryInMb] Maximum + * allowed memory usage in MB. + * + * @param {number} [siteEnvelope.siteConfig.limits.maxDiskSizeInMb] Maximum + * allowed disk size usage in MB. + * + * @param {boolean} [siteEnvelope.siteConfig.autoHealEnabled] true + * if Auto Heal is enabled; otherwise, false. + * + * @param {object} [siteEnvelope.siteConfig.autoHealRules] Auto Heal rules. + * + * @param {object} [siteEnvelope.siteConfig.autoHealRules.triggers] Conditions + * that describe when to execute the auto-heal actions. + * + * @param {object} [siteEnvelope.siteConfig.autoHealRules.triggers.requests] A + * rule based on total requests. + * + * @param {number} + * [siteEnvelope.siteConfig.autoHealRules.triggers.requests.count] Request + * Count. + * + * @param {string} + * [siteEnvelope.siteConfig.autoHealRules.triggers.requests.timeInterval] Time + * interval. + * + * @param {number} + * [siteEnvelope.siteConfig.autoHealRules.triggers.privateBytesInKB] A rule + * based on private bytes. + * + * @param {array} [siteEnvelope.siteConfig.autoHealRules.triggers.statusCodes] + * A rule based on status codes. + * + * @param {object} + * [siteEnvelope.siteConfig.autoHealRules.triggers.slowRequests] A rule based + * on request execution time. + * + * @param {string} + * [siteEnvelope.siteConfig.autoHealRules.triggers.slowRequests.timeTaken] Time + * taken. + * + * @param {number} + * [siteEnvelope.siteConfig.autoHealRules.triggers.slowRequests.count] Request + * Count. + * + * @param {string} + * [siteEnvelope.siteConfig.autoHealRules.triggers.slowRequests.timeInterval] + * Time interval. + * + * @param {object} [siteEnvelope.siteConfig.autoHealRules.actions] Actions to + * be executed when a rule is triggered. + * + * @param {string} [siteEnvelope.siteConfig.autoHealRules.actions.actionType] + * Predefined action to be taken. Possible values include: 'Recycle', + * 'LogEvent', 'CustomAction' + * + * @param {object} [siteEnvelope.siteConfig.autoHealRules.actions.customAction] + * Custom action to be taken. + * + * @param {string} + * [siteEnvelope.siteConfig.autoHealRules.actions.customAction.exe] Executable + * to be run. + * + * @param {string} + * [siteEnvelope.siteConfig.autoHealRules.actions.customAction.parameters] + * Parameters for the executable. + * + * @param {string} + * [siteEnvelope.siteConfig.autoHealRules.actions.minProcessExecutionTime] + * Minimum time the process must execute + * before taking the action + * + * @param {string} [siteEnvelope.siteConfig.tracingOptions] Tracing options. + * + * @param {string} [siteEnvelope.siteConfig.vnetName] Virtual Network name. + * + * @param {object} [siteEnvelope.siteConfig.cors] Cross-Origin Resource Sharing + * (CORS) settings. + * + * @param {array} [siteEnvelope.siteConfig.cors.allowedOrigins] Gets or sets + * the list of origins that should be allowed to make cross-origin + * calls (for example: http://example.com:12345). Use "*" to allow all. + * + * @param {object} [siteEnvelope.siteConfig.push] Push endpoint settings. + * + * @param {boolean} siteEnvelope.siteConfig.push.isPushEnabled Gets or sets a + * flag indicating whether the Push endpoint is enabled. + * + * @param {string} [siteEnvelope.siteConfig.push.tagWhitelistJson] Gets or sets + * a JSON string containing a list of tags that are whitelisted for use by the + * push registration endpoint. + * + * @param {string} [siteEnvelope.siteConfig.push.tagsRequiringAuth] Gets or + * sets a JSON string containing a list of tags that require user + * authentication to be used in the push registration endpoint. + * Tags can consist of alphanumeric characters and the following: + * '_', '@', '#', '.', ':', '-'. + * Validation should be performed at the PushRequestHandler. + * + * @param {string} [siteEnvelope.siteConfig.push.dynamicTagsJson] Gets or sets + * a JSON string containing a list of dynamic tags that will be evaluated from + * user claims in the push registration endpoint. + * + * @param {string} [siteEnvelope.siteConfig.push.kind] Kind of resource. + * + * @param {object} [siteEnvelope.siteConfig.apiDefinition] Information about + * the formal API definition for the app. + * + * @param {string} [siteEnvelope.siteConfig.apiDefinition.url] The URL of the + * API definition. + * + * @param {string} [siteEnvelope.siteConfig.autoSwapSlotName] Auto-swap slot + * name. + * + * @param {boolean} [siteEnvelope.siteConfig.localMySqlEnabled] + * true to enable local MySQL; otherwise, false. + * + * @param {number} [siteEnvelope.siteConfig.managedServiceIdentityId] Managed + * Service Identity Id + * + * @param {number} [siteEnvelope.siteConfig.xManagedServiceIdentityId] Explicit + * Managed Service Identity Id + * + * @param {array} [siteEnvelope.siteConfig.ipSecurityRestrictions] IP security + * restrictions. + * + * @param {boolean} [siteEnvelope.siteConfig.http20Enabled] Http20Enabled: + * configures a web site to allow clients to connect over http2.0 + * + * @param {string} [siteEnvelope.siteConfig.minTlsVersion] MinTlsVersion: + * configures the minimum version of TLS required for SSL requests. Possible + * values include: '1.0', '1.1', '1.2' + * + * @param {string} [siteEnvelope.siteConfig.ftpsState] State of FTP / FTPS + * service. Possible values include: 'AllAllowed', 'FtpsOnly', 'Disabled' + * + * @param {number} [siteEnvelope.siteConfig.reservedInstanceCount] Number of + * reserved instances. + * This setting only applies to the Consumption Plan + * + * @param {boolean} [siteEnvelope.scmSiteAlsoStopped] true to stop + * SCM (KUDU) site when the app is stopped; otherwise, false. The + * default is false. + * + * @param {object} [siteEnvelope.hostingEnvironmentProfile] App Service + * Environment to use for the app. + * + * @param {string} [siteEnvelope.hostingEnvironmentProfile.id] Resource ID of + * the App Service Environment. + * + * @param {boolean} [siteEnvelope.clientAffinityEnabled] true to + * enable client affinity; false to stop sending session affinity + * cookies, which route client requests in the same session to the same + * instance. Default is true. + * + * @param {boolean} [siteEnvelope.clientCertEnabled] true to + * enable client certificate authentication (TLS mutual authentication); + * otherwise, false. Default is false. + * + * @param {boolean} [siteEnvelope.hostNamesDisabled] true to + * disable the public hostnames of the app; otherwise, false. + * If true, the app is only accessible via API management process. + * + * @param {number} [siteEnvelope.containerSize] Size of the function container. + * + * @param {number} [siteEnvelope.dailyMemoryTimeQuota] Maximum allowed daily + * memory-time quota (applicable on dynamic apps only). + * + * @param {object} [siteEnvelope.cloningInfo] If specified during app creation, + * the app is cloned from a source app. + * + * @param {uuid} [siteEnvelope.cloningInfo.correlationId] Correlation ID of + * cloning operation. This ID ties multiple cloning operations + * together to use the same snapshot. + * + * @param {boolean} [siteEnvelope.cloningInfo.overwrite] true to + * overwrite destination app; otherwise, false. + * + * @param {boolean} [siteEnvelope.cloningInfo.cloneCustomHostNames] + * true to clone custom hostnames from source app; otherwise, + * false. + * + * @param {boolean} [siteEnvelope.cloningInfo.cloneSourceControl] + * true to clone source control from source app; otherwise, + * false. + * + * @param {string} siteEnvelope.cloningInfo.sourceWebAppId ARM resource ID of + * the source app. App resource ID is of the form + * /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName} + * for production slots and + * /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/slots/{slotName} + * for other slots. + * + * @param {string} [siteEnvelope.cloningInfo.hostingEnvironment] App Service + * Environment. + * + * @param {object} [siteEnvelope.cloningInfo.appSettingsOverrides] Application + * setting overrides for cloned app. If specified, these settings override the + * settings cloned + * from source app. Otherwise, application settings from source app are + * retained. + * + * @param {boolean} [siteEnvelope.cloningInfo.configureLoadBalancing] + * true to configure load balancing for source and destination + * app. + * + * @param {string} [siteEnvelope.cloningInfo.trafficManagerProfileId] ARM + * resource ID of the Traffic Manager profile to use, if it exists. Traffic + * Manager resource ID is of the form + * /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/trafficManagerProfiles/{profileName}. + * + * @param {string} [siteEnvelope.cloningInfo.trafficManagerProfileName] Name of + * Traffic Manager profile to create. This is only needed if Traffic Manager + * profile does not already exist. + * + * @param {boolean} [siteEnvelope.httpsOnly] HttpsOnly: configures a web site + * to accept only https requests. Issues redirect for + * http requests + * + * @param {object} [siteEnvelope.identity] + * + * @param {string} [siteEnvelope.identity.type] Type of managed service + * identity. Possible values include: 'SystemAssigned', 'UserAssigned' + * + * @param {array} [siteEnvelope.identity.identityIds] Array of UserAssigned + * managed service identities. + * + * @param {string} [siteEnvelope.kind] Kind of resource. + * + * @param {string} siteEnvelope.location Resource Location. + * + * @param {object} [siteEnvelope.tags] Resource tags. + * + * @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. + */ + 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 + * group, or updates an existing app. + * + * Creates a new web, mobile, or API app in an existing resource group, or + * updates an existing app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Unique name of the app to create or update. To create + * or update a deployment slot, use the {slot} parameter. + * + * @param {object} siteEnvelope A JSON representation of the app properties. + * See example. + * + * @param {boolean} [siteEnvelope.enabled] true if the app is + * enabled; otherwise, false. Setting this value to false disables + * the app (takes the app offline). + * + * @param {array} [siteEnvelope.hostNameSslStates] Hostname SSL states are used + * to manage the SSL bindings for app's hostnames. + * + * @param {string} [siteEnvelope.serverFarmId] Resource ID of the associated + * App Service plan, formatted as: + * "/subscriptions/{subscriptionID}/resourceGroups/{groupName}/providers/Microsoft.Web/serverfarms/{appServicePlanName}". + * + * @param {boolean} [siteEnvelope.reserved] true if reserved; + * otherwise, false. + * + * @param {boolean} [siteEnvelope.isXenon] Obsolete: Hyper-V sandbox. + * + * @param {boolean} [siteEnvelope.hyperV] Hyper-V sandbox. + * + * @param {object} [siteEnvelope.siteConfig] Configuration of the app. + * + * @param {number} [siteEnvelope.siteConfig.numberOfWorkers] Number of workers. + * + * @param {array} [siteEnvelope.siteConfig.defaultDocuments] Default documents. + * + * @param {string} [siteEnvelope.siteConfig.netFrameworkVersion] .NET Framework + * version. + * + * @param {string} [siteEnvelope.siteConfig.phpVersion] Version of PHP. + * + * @param {string} [siteEnvelope.siteConfig.pythonVersion] Version of Python. + * + * @param {string} [siteEnvelope.siteConfig.nodeVersion] Version of Node.js. + * + * @param {string} [siteEnvelope.siteConfig.linuxFxVersion] Linux App Framework + * and version + * + * @param {string} [siteEnvelope.siteConfig.windowsFxVersion] Xenon App + * Framework and version + * + * @param {boolean} [siteEnvelope.siteConfig.requestTracingEnabled] + * true if request tracing is enabled; otherwise, + * false. + * + * @param {date} [siteEnvelope.siteConfig.requestTracingExpirationTime] Request + * tracing expiration time. + * + * @param {boolean} [siteEnvelope.siteConfig.remoteDebuggingEnabled] + * true if remote debugging is enabled; otherwise, + * false. + * + * @param {string} [siteEnvelope.siteConfig.remoteDebuggingVersion] Remote + * debugging version. + * + * @param {boolean} [siteEnvelope.siteConfig.httpLoggingEnabled] + * true if HTTP logging is enabled; otherwise, false. + * + * @param {number} [siteEnvelope.siteConfig.logsDirectorySizeLimit] HTTP logs + * directory size limit. + * + * @param {boolean} [siteEnvelope.siteConfig.detailedErrorLoggingEnabled] + * true if detailed error logging is enabled; otherwise, + * false. + * + * @param {string} [siteEnvelope.siteConfig.publishingUsername] Publishing user + * name. + * + * @param {array} [siteEnvelope.siteConfig.appSettings] Application settings. + * + * @param {object} [siteEnvelope.siteConfig.azureStorageAccounts] User-provided + * Azure storage accounts. + * + * @param {array} [siteEnvelope.siteConfig.connectionStrings] Connection + * strings. + * + * @param {array} [siteEnvelope.siteConfig.handlerMappings] Handler mappings. + * + * @param {string} [siteEnvelope.siteConfig.documentRoot] Document root. + * + * @param {string} [siteEnvelope.siteConfig.scmType] SCM type. Possible values + * include: 'None', 'Dropbox', 'Tfs', 'LocalGit', 'GitHub', 'CodePlexGit', + * 'CodePlexHg', 'BitbucketGit', 'BitbucketHg', 'ExternalGit', 'ExternalHg', + * 'OneDrive', 'VSO' + * + * @param {boolean} [siteEnvelope.siteConfig.use32BitWorkerProcess] + * true to use 32-bit worker process; otherwise, + * false. + * + * @param {boolean} [siteEnvelope.siteConfig.webSocketsEnabled] + * true if WebSocket is enabled; otherwise, false. + * + * @param {boolean} [siteEnvelope.siteConfig.alwaysOn] true if + * Always On is enabled; otherwise, false. + * + * @param {string} [siteEnvelope.siteConfig.javaVersion] Java version. + * + * @param {string} [siteEnvelope.siteConfig.javaContainer] Java container. + * + * @param {string} [siteEnvelope.siteConfig.javaContainerVersion] Java + * container version. + * + * @param {string} [siteEnvelope.siteConfig.appCommandLine] App command line to + * launch. + * + * @param {string} [siteEnvelope.siteConfig.managedPipelineMode] Managed + * pipeline mode. Possible values include: 'Integrated', 'Classic' + * + * @param {array} [siteEnvelope.siteConfig.virtualApplications] Virtual + * applications. + * + * @param {string} [siteEnvelope.siteConfig.loadBalancing] Site load balancing. + * Possible values include: 'WeightedRoundRobin', 'LeastRequests', + * 'LeastResponseTime', 'WeightedTotalTraffic', 'RequestHash' + * + * @param {object} [siteEnvelope.siteConfig.experiments] This is work around + * for polymophic types. + * + * @param {array} [siteEnvelope.siteConfig.experiments.rampUpRules] List of + * ramp-up rules. + * + * @param {object} [siteEnvelope.siteConfig.limits] Site limits. + * + * @param {number} [siteEnvelope.siteConfig.limits.maxPercentageCpu] Maximum + * allowed CPU usage percentage. + * + * @param {number} [siteEnvelope.siteConfig.limits.maxMemoryInMb] Maximum + * allowed memory usage in MB. + * + * @param {number} [siteEnvelope.siteConfig.limits.maxDiskSizeInMb] Maximum + * allowed disk size usage in MB. + * + * @param {boolean} [siteEnvelope.siteConfig.autoHealEnabled] true + * if Auto Heal is enabled; otherwise, false. + * + * @param {object} [siteEnvelope.siteConfig.autoHealRules] Auto Heal rules. + * + * @param {object} [siteEnvelope.siteConfig.autoHealRules.triggers] Conditions + * that describe when to execute the auto-heal actions. + * + * @param {object} [siteEnvelope.siteConfig.autoHealRules.triggers.requests] A + * rule based on total requests. + * + * @param {number} + * [siteEnvelope.siteConfig.autoHealRules.triggers.requests.count] Request + * Count. + * + * @param {string} + * [siteEnvelope.siteConfig.autoHealRules.triggers.requests.timeInterval] Time + * interval. + * + * @param {number} + * [siteEnvelope.siteConfig.autoHealRules.triggers.privateBytesInKB] A rule + * based on private bytes. + * + * @param {array} [siteEnvelope.siteConfig.autoHealRules.triggers.statusCodes] + * A rule based on status codes. + * + * @param {object} + * [siteEnvelope.siteConfig.autoHealRules.triggers.slowRequests] A rule based + * on request execution time. + * + * @param {string} + * [siteEnvelope.siteConfig.autoHealRules.triggers.slowRequests.timeTaken] Time + * taken. + * + * @param {number} + * [siteEnvelope.siteConfig.autoHealRules.triggers.slowRequests.count] Request + * Count. + * + * @param {string} + * [siteEnvelope.siteConfig.autoHealRules.triggers.slowRequests.timeInterval] + * Time interval. + * + * @param {object} [siteEnvelope.siteConfig.autoHealRules.actions] Actions to + * be executed when a rule is triggered. + * + * @param {string} [siteEnvelope.siteConfig.autoHealRules.actions.actionType] + * Predefined action to be taken. Possible values include: 'Recycle', + * 'LogEvent', 'CustomAction' + * + * @param {object} [siteEnvelope.siteConfig.autoHealRules.actions.customAction] + * Custom action to be taken. + * + * @param {string} + * [siteEnvelope.siteConfig.autoHealRules.actions.customAction.exe] Executable + * to be run. + * + * @param {string} + * [siteEnvelope.siteConfig.autoHealRules.actions.customAction.parameters] + * Parameters for the executable. + * + * @param {string} + * [siteEnvelope.siteConfig.autoHealRules.actions.minProcessExecutionTime] + * Minimum time the process must execute + * before taking the action + * + * @param {string} [siteEnvelope.siteConfig.tracingOptions] Tracing options. + * + * @param {string} [siteEnvelope.siteConfig.vnetName] Virtual Network name. + * + * @param {object} [siteEnvelope.siteConfig.cors] Cross-Origin Resource Sharing + * (CORS) settings. + * + * @param {array} [siteEnvelope.siteConfig.cors.allowedOrigins] Gets or sets + * the list of origins that should be allowed to make cross-origin + * calls (for example: http://example.com:12345). Use "*" to allow all. + * + * @param {object} [siteEnvelope.siteConfig.push] Push endpoint settings. + * + * @param {boolean} siteEnvelope.siteConfig.push.isPushEnabled Gets or sets a + * flag indicating whether the Push endpoint is enabled. + * + * @param {string} [siteEnvelope.siteConfig.push.tagWhitelistJson] Gets or sets + * a JSON string containing a list of tags that are whitelisted for use by the + * push registration endpoint. + * + * @param {string} [siteEnvelope.siteConfig.push.tagsRequiringAuth] Gets or + * sets a JSON string containing a list of tags that require user + * authentication to be used in the push registration endpoint. + * Tags can consist of alphanumeric characters and the following: + * '_', '@', '#', '.', ':', '-'. + * Validation should be performed at the PushRequestHandler. + * + * @param {string} [siteEnvelope.siteConfig.push.dynamicTagsJson] Gets or sets + * a JSON string containing a list of dynamic tags that will be evaluated from + * user claims in the push registration endpoint. + * + * @param {string} [siteEnvelope.siteConfig.push.kind] Kind of resource. + * + * @param {object} [siteEnvelope.siteConfig.apiDefinition] Information about + * the formal API definition for the app. + * + * @param {string} [siteEnvelope.siteConfig.apiDefinition.url] The URL of the + * API definition. + * + * @param {string} [siteEnvelope.siteConfig.autoSwapSlotName] Auto-swap slot + * name. + * + * @param {boolean} [siteEnvelope.siteConfig.localMySqlEnabled] + * true to enable local MySQL; otherwise, false. + * + * @param {number} [siteEnvelope.siteConfig.managedServiceIdentityId] Managed + * Service Identity Id + * + * @param {number} [siteEnvelope.siteConfig.xManagedServiceIdentityId] Explicit + * Managed Service Identity Id + * + * @param {array} [siteEnvelope.siteConfig.ipSecurityRestrictions] IP security + * restrictions. + * + * @param {boolean} [siteEnvelope.siteConfig.http20Enabled] Http20Enabled: + * configures a web site to allow clients to connect over http2.0 + * + * @param {string} [siteEnvelope.siteConfig.minTlsVersion] MinTlsVersion: + * configures the minimum version of TLS required for SSL requests. Possible + * values include: '1.0', '1.1', '1.2' + * + * @param {string} [siteEnvelope.siteConfig.ftpsState] State of FTP / FTPS + * service. Possible values include: 'AllAllowed', 'FtpsOnly', 'Disabled' + * + * @param {number} [siteEnvelope.siteConfig.reservedInstanceCount] Number of + * reserved instances. + * This setting only applies to the Consumption Plan + * + * @param {boolean} [siteEnvelope.scmSiteAlsoStopped] true to stop + * SCM (KUDU) site when the app is stopped; otherwise, false. The + * default is false. + * + * @param {object} [siteEnvelope.hostingEnvironmentProfile] App Service + * Environment to use for the app. + * + * @param {string} [siteEnvelope.hostingEnvironmentProfile.id] Resource ID of + * the App Service Environment. + * + * @param {boolean} [siteEnvelope.clientAffinityEnabled] true to + * enable client affinity; false to stop sending session affinity + * cookies, which route client requests in the same session to the same + * instance. Default is true. + * + * @param {boolean} [siteEnvelope.clientCertEnabled] true to + * enable client certificate authentication (TLS mutual authentication); + * otherwise, false. Default is false. + * + * @param {boolean} [siteEnvelope.hostNamesDisabled] true to + * disable the public hostnames of the app; otherwise, false. + * If true, the app is only accessible via API management process. + * + * @param {number} [siteEnvelope.containerSize] Size of the function container. + * + * @param {number} [siteEnvelope.dailyMemoryTimeQuota] Maximum allowed daily + * memory-time quota (applicable on dynamic apps only). + * + * @param {object} [siteEnvelope.cloningInfo] If specified during app creation, + * the app is cloned from a source app. + * + * @param {uuid} [siteEnvelope.cloningInfo.correlationId] Correlation ID of + * cloning operation. This ID ties multiple cloning operations + * together to use the same snapshot. + * + * @param {boolean} [siteEnvelope.cloningInfo.overwrite] true to + * overwrite destination app; otherwise, false. + * + * @param {boolean} [siteEnvelope.cloningInfo.cloneCustomHostNames] + * true to clone custom hostnames from source app; otherwise, + * false. + * + * @param {boolean} [siteEnvelope.cloningInfo.cloneSourceControl] + * true to clone source control from source app; otherwise, + * false. + * + * @param {string} siteEnvelope.cloningInfo.sourceWebAppId ARM resource ID of + * the source app. App resource ID is of the form + * /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName} + * for production slots and + * /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/slots/{slotName} + * for other slots. + * + * @param {string} [siteEnvelope.cloningInfo.hostingEnvironment] App Service + * Environment. + * + * @param {object} [siteEnvelope.cloningInfo.appSettingsOverrides] Application + * setting overrides for cloned app. If specified, these settings override the + * settings cloned + * from source app. Otherwise, application settings from source app are + * retained. + * + * @param {boolean} [siteEnvelope.cloningInfo.configureLoadBalancing] + * true to configure load balancing for source and destination + * app. + * + * @param {string} [siteEnvelope.cloningInfo.trafficManagerProfileId] ARM + * resource ID of the Traffic Manager profile to use, if it exists. Traffic + * Manager resource ID is of the form + * /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/trafficManagerProfiles/{profileName}. + * + * @param {string} [siteEnvelope.cloningInfo.trafficManagerProfileName] Name of + * Traffic Manager profile to create. This is only needed if Traffic Manager + * profile does not already exist. + * + * @param {boolean} [siteEnvelope.httpsOnly] HttpsOnly: configures a web site + * to accept only https requests. Issues redirect for + * http requests + * + * @param {object} [siteEnvelope.identity] + * + * @param {string} [siteEnvelope.identity.type] Type of managed service + * identity. Possible values include: 'SystemAssigned', 'UserAssigned' + * + * @param {array} [siteEnvelope.identity.identityIds] Array of UserAssigned + * managed service identities. + * + * @param {string} [siteEnvelope.kind] Kind of resource. + * + * @param {string} siteEnvelope.location Resource Location. + * + * @param {object} [siteEnvelope.tags] Resource tags. + * + * @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 {Site} - 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. + * + * {Site} [result] - The deserialized result object if an error did not occur. + * See {@link Site} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + createOrUpdate(resourceGroupName: string, 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: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Deletes a web, mobile, or API app, or one of the deployment slots. + * + * Deletes a web, mobile, or API app, or one of the deployment slots. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app to delete. + * + * @param {object} [options] Optional Parameters. + * + * @param {boolean} [options.deleteMetrics] If true, web app metrics are also + * deleted. + * + * @param {boolean} [options.deleteEmptyServerFarm] Specify true if the App + * Service plan will be empty after app deletion and you want to delete the + * empty App Service plan. By default, the empty App Service plan is not + * deleted. + * + * @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. + */ + 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. + * + * Deletes a web, mobile, or API app, or one of the deployment slots. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app to delete. + * + * @param {object} [options] Optional Parameters. + * + * @param {boolean} [options.deleteMetrics] If true, web app metrics are also + * deleted. + * + * @param {boolean} [options.deleteEmptyServerFarm] Specify true if the App + * Service plan will be empty after app deletion and you want to delete the + * empty App Service plan. By default, the empty App Service plan is not + * deleted. + * + * @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 {null} - 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. + * + * {null} [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. + */ + 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, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Creates a new web, mobile, or API app in an existing resource + * group, or updates an existing app. + * + * Creates a new web, mobile, or API app in an existing resource group, or + * updates an existing app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Unique name of the app to create or update. To create + * or update a deployment slot, use the {slot} parameter. + * + * @param {object} siteEnvelope A JSON representation of the app properties. + * See example. + * + * @param {boolean} [siteEnvelope.enabled] true if the app is + * enabled; otherwise, false. Setting this value to false disables + * the app (takes the app offline). + * + * @param {array} [siteEnvelope.hostNameSslStates] Hostname SSL states are used + * to manage the SSL bindings for app's hostnames. + * + * @param {string} [siteEnvelope.serverFarmId] Resource ID of the associated + * App Service plan, formatted as: + * "/subscriptions/{subscriptionID}/resourceGroups/{groupName}/providers/Microsoft.Web/serverfarms/{appServicePlanName}". + * + * @param {boolean} [siteEnvelope.reserved] true if reserved; + * otherwise, false. + * + * @param {boolean} [siteEnvelope.isXenon] Obsolete: Hyper-V sandbox. + * + * @param {boolean} [siteEnvelope.hyperV] Hyper-V sandbox. + * + * @param {object} [siteEnvelope.siteConfig] Configuration of the app. + * + * @param {number} [siteEnvelope.siteConfig.numberOfWorkers] Number of workers. + * + * @param {array} [siteEnvelope.siteConfig.defaultDocuments] Default documents. + * + * @param {string} [siteEnvelope.siteConfig.netFrameworkVersion] .NET Framework + * version. + * + * @param {string} [siteEnvelope.siteConfig.phpVersion] Version of PHP. + * + * @param {string} [siteEnvelope.siteConfig.pythonVersion] Version of Python. + * + * @param {string} [siteEnvelope.siteConfig.nodeVersion] Version of Node.js. + * + * @param {string} [siteEnvelope.siteConfig.linuxFxVersion] Linux App Framework + * and version + * + * @param {string} [siteEnvelope.siteConfig.windowsFxVersion] Xenon App + * Framework and version + * + * @param {boolean} [siteEnvelope.siteConfig.requestTracingEnabled] + * true if request tracing is enabled; otherwise, + * false. + * + * @param {date} [siteEnvelope.siteConfig.requestTracingExpirationTime] Request + * tracing expiration time. + * + * @param {boolean} [siteEnvelope.siteConfig.remoteDebuggingEnabled] + * true if remote debugging is enabled; otherwise, + * false. + * + * @param {string} [siteEnvelope.siteConfig.remoteDebuggingVersion] Remote + * debugging version. + * + * @param {boolean} [siteEnvelope.siteConfig.httpLoggingEnabled] + * true if HTTP logging is enabled; otherwise, false. + * + * @param {number} [siteEnvelope.siteConfig.logsDirectorySizeLimit] HTTP logs + * directory size limit. + * + * @param {boolean} [siteEnvelope.siteConfig.detailedErrorLoggingEnabled] + * true if detailed error logging is enabled; otherwise, + * false. + * + * @param {string} [siteEnvelope.siteConfig.publishingUsername] Publishing user + * name. + * + * @param {array} [siteEnvelope.siteConfig.appSettings] Application settings. + * + * @param {object} [siteEnvelope.siteConfig.azureStorageAccounts] User-provided + * Azure storage accounts. + * + * @param {array} [siteEnvelope.siteConfig.connectionStrings] Connection + * strings. + * + * @param {array} [siteEnvelope.siteConfig.handlerMappings] Handler mappings. + * + * @param {string} [siteEnvelope.siteConfig.documentRoot] Document root. + * + * @param {string} [siteEnvelope.siteConfig.scmType] SCM type. Possible values + * include: 'None', 'Dropbox', 'Tfs', 'LocalGit', 'GitHub', 'CodePlexGit', + * 'CodePlexHg', 'BitbucketGit', 'BitbucketHg', 'ExternalGit', 'ExternalHg', + * 'OneDrive', 'VSO' + * + * @param {boolean} [siteEnvelope.siteConfig.use32BitWorkerProcess] + * true to use 32-bit worker process; otherwise, + * false. + * + * @param {boolean} [siteEnvelope.siteConfig.webSocketsEnabled] + * true if WebSocket is enabled; otherwise, false. + * + * @param {boolean} [siteEnvelope.siteConfig.alwaysOn] true if + * Always On is enabled; otherwise, false. + * + * @param {string} [siteEnvelope.siteConfig.javaVersion] Java version. + * + * @param {string} [siteEnvelope.siteConfig.javaContainer] Java container. + * + * @param {string} [siteEnvelope.siteConfig.javaContainerVersion] Java + * container version. + * + * @param {string} [siteEnvelope.siteConfig.appCommandLine] App command line to + * launch. + * + * @param {string} [siteEnvelope.siteConfig.managedPipelineMode] Managed + * pipeline mode. Possible values include: 'Integrated', 'Classic' + * + * @param {array} [siteEnvelope.siteConfig.virtualApplications] Virtual + * applications. + * + * @param {string} [siteEnvelope.siteConfig.loadBalancing] Site load balancing. + * Possible values include: 'WeightedRoundRobin', 'LeastRequests', + * 'LeastResponseTime', 'WeightedTotalTraffic', 'RequestHash' + * + * @param {object} [siteEnvelope.siteConfig.experiments] This is work around + * for polymophic types. + * + * @param {array} [siteEnvelope.siteConfig.experiments.rampUpRules] List of + * ramp-up rules. + * + * @param {object} [siteEnvelope.siteConfig.limits] Site limits. + * + * @param {number} [siteEnvelope.siteConfig.limits.maxPercentageCpu] Maximum + * allowed CPU usage percentage. + * + * @param {number} [siteEnvelope.siteConfig.limits.maxMemoryInMb] Maximum + * allowed memory usage in MB. + * + * @param {number} [siteEnvelope.siteConfig.limits.maxDiskSizeInMb] Maximum + * allowed disk size usage in MB. + * + * @param {boolean} [siteEnvelope.siteConfig.autoHealEnabled] true + * if Auto Heal is enabled; otherwise, false. + * + * @param {object} [siteEnvelope.siteConfig.autoHealRules] Auto Heal rules. + * + * @param {object} [siteEnvelope.siteConfig.autoHealRules.triggers] Conditions + * that describe when to execute the auto-heal actions. + * + * @param {object} [siteEnvelope.siteConfig.autoHealRules.triggers.requests] A + * rule based on total requests. + * + * @param {number} + * [siteEnvelope.siteConfig.autoHealRules.triggers.requests.count] Request + * Count. + * + * @param {string} + * [siteEnvelope.siteConfig.autoHealRules.triggers.requests.timeInterval] Time + * interval. + * + * @param {number} + * [siteEnvelope.siteConfig.autoHealRules.triggers.privateBytesInKB] A rule + * based on private bytes. + * + * @param {array} [siteEnvelope.siteConfig.autoHealRules.triggers.statusCodes] + * A rule based on status codes. + * + * @param {object} + * [siteEnvelope.siteConfig.autoHealRules.triggers.slowRequests] A rule based + * on request execution time. + * + * @param {string} + * [siteEnvelope.siteConfig.autoHealRules.triggers.slowRequests.timeTaken] Time + * taken. + * + * @param {number} + * [siteEnvelope.siteConfig.autoHealRules.triggers.slowRequests.count] Request + * Count. + * + * @param {string} + * [siteEnvelope.siteConfig.autoHealRules.triggers.slowRequests.timeInterval] + * Time interval. + * + * @param {object} [siteEnvelope.siteConfig.autoHealRules.actions] Actions to + * be executed when a rule is triggered. + * + * @param {string} [siteEnvelope.siteConfig.autoHealRules.actions.actionType] + * Predefined action to be taken. Possible values include: 'Recycle', + * 'LogEvent', 'CustomAction' + * + * @param {object} [siteEnvelope.siteConfig.autoHealRules.actions.customAction] + * Custom action to be taken. + * + * @param {string} + * [siteEnvelope.siteConfig.autoHealRules.actions.customAction.exe] Executable + * to be run. + * + * @param {string} + * [siteEnvelope.siteConfig.autoHealRules.actions.customAction.parameters] + * Parameters for the executable. + * + * @param {string} + * [siteEnvelope.siteConfig.autoHealRules.actions.minProcessExecutionTime] + * Minimum time the process must execute + * before taking the action + * + * @param {string} [siteEnvelope.siteConfig.tracingOptions] Tracing options. + * + * @param {string} [siteEnvelope.siteConfig.vnetName] Virtual Network name. + * + * @param {object} [siteEnvelope.siteConfig.cors] Cross-Origin Resource Sharing + * (CORS) settings. + * + * @param {array} [siteEnvelope.siteConfig.cors.allowedOrigins] Gets or sets + * the list of origins that should be allowed to make cross-origin + * calls (for example: http://example.com:12345). Use "*" to allow all. + * + * @param {object} [siteEnvelope.siteConfig.push] Push endpoint settings. + * + * @param {boolean} siteEnvelope.siteConfig.push.isPushEnabled Gets or sets a + * flag indicating whether the Push endpoint is enabled. + * + * @param {string} [siteEnvelope.siteConfig.push.tagWhitelistJson] Gets or sets + * a JSON string containing a list of tags that are whitelisted for use by the + * push registration endpoint. + * + * @param {string} [siteEnvelope.siteConfig.push.tagsRequiringAuth] Gets or + * sets a JSON string containing a list of tags that require user + * authentication to be used in the push registration endpoint. + * Tags can consist of alphanumeric characters and the following: + * '_', '@', '#', '.', ':', '-'. + * Validation should be performed at the PushRequestHandler. + * + * @param {string} [siteEnvelope.siteConfig.push.dynamicTagsJson] Gets or sets + * a JSON string containing a list of dynamic tags that will be evaluated from + * user claims in the push registration endpoint. + * + * @param {string} [siteEnvelope.siteConfig.push.kind] Kind of resource. + * + * @param {object} [siteEnvelope.siteConfig.apiDefinition] Information about + * the formal API definition for the app. + * + * @param {string} [siteEnvelope.siteConfig.apiDefinition.url] The URL of the + * API definition. + * + * @param {string} [siteEnvelope.siteConfig.autoSwapSlotName] Auto-swap slot + * name. + * + * @param {boolean} [siteEnvelope.siteConfig.localMySqlEnabled] + * true to enable local MySQL; otherwise, false. + * + * @param {number} [siteEnvelope.siteConfig.managedServiceIdentityId] Managed + * Service Identity Id + * + * @param {number} [siteEnvelope.siteConfig.xManagedServiceIdentityId] Explicit + * Managed Service Identity Id + * + * @param {array} [siteEnvelope.siteConfig.ipSecurityRestrictions] IP security + * restrictions. + * + * @param {boolean} [siteEnvelope.siteConfig.http20Enabled] Http20Enabled: + * configures a web site to allow clients to connect over http2.0 + * + * @param {string} [siteEnvelope.siteConfig.minTlsVersion] MinTlsVersion: + * configures the minimum version of TLS required for SSL requests. Possible + * values include: '1.0', '1.1', '1.2' + * + * @param {string} [siteEnvelope.siteConfig.ftpsState] State of FTP / FTPS + * service. Possible values include: 'AllAllowed', 'FtpsOnly', 'Disabled' + * + * @param {number} [siteEnvelope.siteConfig.reservedInstanceCount] Number of + * reserved instances. + * This setting only applies to the Consumption Plan + * + * @param {boolean} [siteEnvelope.scmSiteAlsoStopped] true to stop + * SCM (KUDU) site when the app is stopped; otherwise, false. The + * default is false. + * + * @param {object} [siteEnvelope.hostingEnvironmentProfile] App Service + * Environment to use for the app. + * + * @param {string} [siteEnvelope.hostingEnvironmentProfile.id] Resource ID of + * the App Service Environment. + * + * @param {boolean} [siteEnvelope.clientAffinityEnabled] true to + * enable client affinity; false to stop sending session affinity + * cookies, which route client requests in the same session to the same + * instance. Default is true. + * + * @param {boolean} [siteEnvelope.clientCertEnabled] true to + * enable client certificate authentication (TLS mutual authentication); + * otherwise, false. Default is false. + * + * @param {boolean} [siteEnvelope.hostNamesDisabled] true to + * disable the public hostnames of the app; otherwise, false. + * If true, the app is only accessible via API management process. + * + * @param {number} [siteEnvelope.containerSize] Size of the function container. + * + * @param {number} [siteEnvelope.dailyMemoryTimeQuota] Maximum allowed daily + * memory-time quota (applicable on dynamic apps only). + * + * @param {object} [siteEnvelope.cloningInfo] If specified during app creation, + * the app is cloned from a source app. + * + * @param {uuid} [siteEnvelope.cloningInfo.correlationId] Correlation ID of + * cloning operation. This ID ties multiple cloning operations + * together to use the same snapshot. + * + * @param {boolean} [siteEnvelope.cloningInfo.overwrite] true to + * overwrite destination app; otherwise, false. + * + * @param {boolean} [siteEnvelope.cloningInfo.cloneCustomHostNames] + * true to clone custom hostnames from source app; otherwise, + * false. + * + * @param {boolean} [siteEnvelope.cloningInfo.cloneSourceControl] + * true to clone source control from source app; otherwise, + * false. + * + * @param {string} siteEnvelope.cloningInfo.sourceWebAppId ARM resource ID of + * the source app. App resource ID is of the form + * /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName} + * for production slots and + * /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/slots/{slotName} + * for other slots. + * + * @param {string} [siteEnvelope.cloningInfo.hostingEnvironment] App Service + * Environment. + * + * @param {object} [siteEnvelope.cloningInfo.appSettingsOverrides] Application + * setting overrides for cloned app. If specified, these settings override the + * settings cloned + * from source app. Otherwise, application settings from source app are + * retained. + * + * @param {boolean} [siteEnvelope.cloningInfo.configureLoadBalancing] + * true to configure load balancing for source and destination + * app. + * + * @param {string} [siteEnvelope.cloningInfo.trafficManagerProfileId] ARM + * resource ID of the Traffic Manager profile to use, if it exists. Traffic + * Manager resource ID is of the form + * /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/trafficManagerProfiles/{profileName}. + * + * @param {string} [siteEnvelope.cloningInfo.trafficManagerProfileName] Name of + * Traffic Manager profile to create. This is only needed if Traffic Manager + * profile does not already exist. + * + * @param {boolean} [siteEnvelope.httpsOnly] HttpsOnly: configures a web site + * to accept only https requests. Issues redirect for + * http requests + * + * @param {string} [siteEnvelope.kind] Kind of resource. + * + * @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. + */ + 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 + * group, or updates an existing app. + * + * Creates a new web, mobile, or API app in an existing resource group, or + * updates an existing app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Unique name of the app to create or update. To create + * or update a deployment slot, use the {slot} parameter. + * + * @param {object} siteEnvelope A JSON representation of the app properties. + * See example. + * + * @param {boolean} [siteEnvelope.enabled] true if the app is + * enabled; otherwise, false. Setting this value to false disables + * the app (takes the app offline). + * + * @param {array} [siteEnvelope.hostNameSslStates] Hostname SSL states are used + * to manage the SSL bindings for app's hostnames. + * + * @param {string} [siteEnvelope.serverFarmId] Resource ID of the associated + * App Service plan, formatted as: + * "/subscriptions/{subscriptionID}/resourceGroups/{groupName}/providers/Microsoft.Web/serverfarms/{appServicePlanName}". + * + * @param {boolean} [siteEnvelope.reserved] true if reserved; + * otherwise, false. + * + * @param {boolean} [siteEnvelope.isXenon] Obsolete: Hyper-V sandbox. + * + * @param {boolean} [siteEnvelope.hyperV] Hyper-V sandbox. + * + * @param {object} [siteEnvelope.siteConfig] Configuration of the app. + * + * @param {number} [siteEnvelope.siteConfig.numberOfWorkers] Number of workers. + * + * @param {array} [siteEnvelope.siteConfig.defaultDocuments] Default documents. + * + * @param {string} [siteEnvelope.siteConfig.netFrameworkVersion] .NET Framework + * version. + * + * @param {string} [siteEnvelope.siteConfig.phpVersion] Version of PHP. + * + * @param {string} [siteEnvelope.siteConfig.pythonVersion] Version of Python. + * + * @param {string} [siteEnvelope.siteConfig.nodeVersion] Version of Node.js. + * + * @param {string} [siteEnvelope.siteConfig.linuxFxVersion] Linux App Framework + * and version + * + * @param {string} [siteEnvelope.siteConfig.windowsFxVersion] Xenon App + * Framework and version + * + * @param {boolean} [siteEnvelope.siteConfig.requestTracingEnabled] + * true if request tracing is enabled; otherwise, + * false. + * + * @param {date} [siteEnvelope.siteConfig.requestTracingExpirationTime] Request + * tracing expiration time. + * + * @param {boolean} [siteEnvelope.siteConfig.remoteDebuggingEnabled] + * true if remote debugging is enabled; otherwise, + * false. + * + * @param {string} [siteEnvelope.siteConfig.remoteDebuggingVersion] Remote + * debugging version. + * + * @param {boolean} [siteEnvelope.siteConfig.httpLoggingEnabled] + * true if HTTP logging is enabled; otherwise, false. + * + * @param {number} [siteEnvelope.siteConfig.logsDirectorySizeLimit] HTTP logs + * directory size limit. + * + * @param {boolean} [siteEnvelope.siteConfig.detailedErrorLoggingEnabled] + * true if detailed error logging is enabled; otherwise, + * false. + * + * @param {string} [siteEnvelope.siteConfig.publishingUsername] Publishing user + * name. + * + * @param {array} [siteEnvelope.siteConfig.appSettings] Application settings. + * + * @param {object} [siteEnvelope.siteConfig.azureStorageAccounts] User-provided + * Azure storage accounts. + * + * @param {array} [siteEnvelope.siteConfig.connectionStrings] Connection + * strings. + * + * @param {array} [siteEnvelope.siteConfig.handlerMappings] Handler mappings. + * + * @param {string} [siteEnvelope.siteConfig.documentRoot] Document root. + * + * @param {string} [siteEnvelope.siteConfig.scmType] SCM type. Possible values + * include: 'None', 'Dropbox', 'Tfs', 'LocalGit', 'GitHub', 'CodePlexGit', + * 'CodePlexHg', 'BitbucketGit', 'BitbucketHg', 'ExternalGit', 'ExternalHg', + * 'OneDrive', 'VSO' + * + * @param {boolean} [siteEnvelope.siteConfig.use32BitWorkerProcess] + * true to use 32-bit worker process; otherwise, + * false. + * + * @param {boolean} [siteEnvelope.siteConfig.webSocketsEnabled] + * true if WebSocket is enabled; otherwise, false. + * + * @param {boolean} [siteEnvelope.siteConfig.alwaysOn] true if + * Always On is enabled; otherwise, false. + * + * @param {string} [siteEnvelope.siteConfig.javaVersion] Java version. + * + * @param {string} [siteEnvelope.siteConfig.javaContainer] Java container. + * + * @param {string} [siteEnvelope.siteConfig.javaContainerVersion] Java + * container version. + * + * @param {string} [siteEnvelope.siteConfig.appCommandLine] App command line to + * launch. + * + * @param {string} [siteEnvelope.siteConfig.managedPipelineMode] Managed + * pipeline mode. Possible values include: 'Integrated', 'Classic' + * + * @param {array} [siteEnvelope.siteConfig.virtualApplications] Virtual + * applications. + * + * @param {string} [siteEnvelope.siteConfig.loadBalancing] Site load balancing. + * Possible values include: 'WeightedRoundRobin', 'LeastRequests', + * 'LeastResponseTime', 'WeightedTotalTraffic', 'RequestHash' + * + * @param {object} [siteEnvelope.siteConfig.experiments] This is work around + * for polymophic types. + * + * @param {array} [siteEnvelope.siteConfig.experiments.rampUpRules] List of + * ramp-up rules. + * + * @param {object} [siteEnvelope.siteConfig.limits] Site limits. + * + * @param {number} [siteEnvelope.siteConfig.limits.maxPercentageCpu] Maximum + * allowed CPU usage percentage. + * + * @param {number} [siteEnvelope.siteConfig.limits.maxMemoryInMb] Maximum + * allowed memory usage in MB. + * + * @param {number} [siteEnvelope.siteConfig.limits.maxDiskSizeInMb] Maximum + * allowed disk size usage in MB. + * + * @param {boolean} [siteEnvelope.siteConfig.autoHealEnabled] true + * if Auto Heal is enabled; otherwise, false. + * + * @param {object} [siteEnvelope.siteConfig.autoHealRules] Auto Heal rules. + * + * @param {object} [siteEnvelope.siteConfig.autoHealRules.triggers] Conditions + * that describe when to execute the auto-heal actions. + * + * @param {object} [siteEnvelope.siteConfig.autoHealRules.triggers.requests] A + * rule based on total requests. + * + * @param {number} + * [siteEnvelope.siteConfig.autoHealRules.triggers.requests.count] Request + * Count. + * + * @param {string} + * [siteEnvelope.siteConfig.autoHealRules.triggers.requests.timeInterval] Time + * interval. + * + * @param {number} + * [siteEnvelope.siteConfig.autoHealRules.triggers.privateBytesInKB] A rule + * based on private bytes. + * + * @param {array} [siteEnvelope.siteConfig.autoHealRules.triggers.statusCodes] + * A rule based on status codes. + * + * @param {object} + * [siteEnvelope.siteConfig.autoHealRules.triggers.slowRequests] A rule based + * on request execution time. + * + * @param {string} + * [siteEnvelope.siteConfig.autoHealRules.triggers.slowRequests.timeTaken] Time + * taken. + * + * @param {number} + * [siteEnvelope.siteConfig.autoHealRules.triggers.slowRequests.count] Request + * Count. + * + * @param {string} + * [siteEnvelope.siteConfig.autoHealRules.triggers.slowRequests.timeInterval] + * Time interval. + * + * @param {object} [siteEnvelope.siteConfig.autoHealRules.actions] Actions to + * be executed when a rule is triggered. + * + * @param {string} [siteEnvelope.siteConfig.autoHealRules.actions.actionType] + * Predefined action to be taken. Possible values include: 'Recycle', + * 'LogEvent', 'CustomAction' + * + * @param {object} [siteEnvelope.siteConfig.autoHealRules.actions.customAction] + * Custom action to be taken. + * + * @param {string} + * [siteEnvelope.siteConfig.autoHealRules.actions.customAction.exe] Executable + * to be run. + * + * @param {string} + * [siteEnvelope.siteConfig.autoHealRules.actions.customAction.parameters] + * Parameters for the executable. + * + * @param {string} + * [siteEnvelope.siteConfig.autoHealRules.actions.minProcessExecutionTime] + * Minimum time the process must execute + * before taking the action + * + * @param {string} [siteEnvelope.siteConfig.tracingOptions] Tracing options. + * + * @param {string} [siteEnvelope.siteConfig.vnetName] Virtual Network name. + * + * @param {object} [siteEnvelope.siteConfig.cors] Cross-Origin Resource Sharing + * (CORS) settings. + * + * @param {array} [siteEnvelope.siteConfig.cors.allowedOrigins] Gets or sets + * the list of origins that should be allowed to make cross-origin + * calls (for example: http://example.com:12345). Use "*" to allow all. + * + * @param {object} [siteEnvelope.siteConfig.push] Push endpoint settings. + * + * @param {boolean} siteEnvelope.siteConfig.push.isPushEnabled Gets or sets a + * flag indicating whether the Push endpoint is enabled. + * + * @param {string} [siteEnvelope.siteConfig.push.tagWhitelistJson] Gets or sets + * a JSON string containing a list of tags that are whitelisted for use by the + * push registration endpoint. + * + * @param {string} [siteEnvelope.siteConfig.push.tagsRequiringAuth] Gets or + * sets a JSON string containing a list of tags that require user + * authentication to be used in the push registration endpoint. + * Tags can consist of alphanumeric characters and the following: + * '_', '@', '#', '.', ':', '-'. + * Validation should be performed at the PushRequestHandler. + * + * @param {string} [siteEnvelope.siteConfig.push.dynamicTagsJson] Gets or sets + * a JSON string containing a list of dynamic tags that will be evaluated from + * user claims in the push registration endpoint. + * + * @param {string} [siteEnvelope.siteConfig.push.kind] Kind of resource. + * + * @param {object} [siteEnvelope.siteConfig.apiDefinition] Information about + * the formal API definition for the app. + * + * @param {string} [siteEnvelope.siteConfig.apiDefinition.url] The URL of the + * API definition. + * + * @param {string} [siteEnvelope.siteConfig.autoSwapSlotName] Auto-swap slot + * name. + * + * @param {boolean} [siteEnvelope.siteConfig.localMySqlEnabled] + * true to enable local MySQL; otherwise, false. + * + * @param {number} [siteEnvelope.siteConfig.managedServiceIdentityId] Managed + * Service Identity Id + * + * @param {number} [siteEnvelope.siteConfig.xManagedServiceIdentityId] Explicit + * Managed Service Identity Id + * + * @param {array} [siteEnvelope.siteConfig.ipSecurityRestrictions] IP security + * restrictions. + * + * @param {boolean} [siteEnvelope.siteConfig.http20Enabled] Http20Enabled: + * configures a web site to allow clients to connect over http2.0 + * + * @param {string} [siteEnvelope.siteConfig.minTlsVersion] MinTlsVersion: + * configures the minimum version of TLS required for SSL requests. Possible + * values include: '1.0', '1.1', '1.2' + * + * @param {string} [siteEnvelope.siteConfig.ftpsState] State of FTP / FTPS + * service. Possible values include: 'AllAllowed', 'FtpsOnly', 'Disabled' + * + * @param {number} [siteEnvelope.siteConfig.reservedInstanceCount] Number of + * reserved instances. + * This setting only applies to the Consumption Plan + * + * @param {boolean} [siteEnvelope.scmSiteAlsoStopped] true to stop + * SCM (KUDU) site when the app is stopped; otherwise, false. The + * default is false. + * + * @param {object} [siteEnvelope.hostingEnvironmentProfile] App Service + * Environment to use for the app. + * + * @param {string} [siteEnvelope.hostingEnvironmentProfile.id] Resource ID of + * the App Service Environment. + * + * @param {boolean} [siteEnvelope.clientAffinityEnabled] true to + * enable client affinity; false to stop sending session affinity + * cookies, which route client requests in the same session to the same + * instance. Default is true. + * + * @param {boolean} [siteEnvelope.clientCertEnabled] true to + * enable client certificate authentication (TLS mutual authentication); + * otherwise, false. Default is false. + * + * @param {boolean} [siteEnvelope.hostNamesDisabled] true to + * disable the public hostnames of the app; otherwise, false. + * If true, the app is only accessible via API management process. + * + * @param {number} [siteEnvelope.containerSize] Size of the function container. + * + * @param {number} [siteEnvelope.dailyMemoryTimeQuota] Maximum allowed daily + * memory-time quota (applicable on dynamic apps only). + * + * @param {object} [siteEnvelope.cloningInfo] If specified during app creation, + * the app is cloned from a source app. + * + * @param {uuid} [siteEnvelope.cloningInfo.correlationId] Correlation ID of + * cloning operation. This ID ties multiple cloning operations + * together to use the same snapshot. + * + * @param {boolean} [siteEnvelope.cloningInfo.overwrite] true to + * overwrite destination app; otherwise, false. + * + * @param {boolean} [siteEnvelope.cloningInfo.cloneCustomHostNames] + * true to clone custom hostnames from source app; otherwise, + * false. + * + * @param {boolean} [siteEnvelope.cloningInfo.cloneSourceControl] + * true to clone source control from source app; otherwise, + * false. + * + * @param {string} siteEnvelope.cloningInfo.sourceWebAppId ARM resource ID of + * the source app. App resource ID is of the form + * /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName} + * for production slots and + * /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/slots/{slotName} + * for other slots. + * + * @param {string} [siteEnvelope.cloningInfo.hostingEnvironment] App Service + * Environment. + * + * @param {object} [siteEnvelope.cloningInfo.appSettingsOverrides] Application + * setting overrides for cloned app. If specified, these settings override the + * settings cloned + * from source app. Otherwise, application settings from source app are + * retained. + * + * @param {boolean} [siteEnvelope.cloningInfo.configureLoadBalancing] + * true to configure load balancing for source and destination + * app. + * + * @param {string} [siteEnvelope.cloningInfo.trafficManagerProfileId] ARM + * resource ID of the Traffic Manager profile to use, if it exists. Traffic + * Manager resource ID is of the form + * /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/trafficManagerProfiles/{profileName}. + * + * @param {string} [siteEnvelope.cloningInfo.trafficManagerProfileName] Name of + * Traffic Manager profile to create. This is only needed if Traffic Manager + * profile does not already exist. + * + * @param {boolean} [siteEnvelope.httpsOnly] HttpsOnly: configures a web site + * to accept only https requests. Issues redirect for + * http requests + * + * @param {string} [siteEnvelope.kind] Kind of resource. + * + * @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 {Site} - 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. + * + * {Site} [result] - The deserialized result object if an error did not occur. + * See {@link Site} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + update(resourceGroupName: string, 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: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Analyze a custom hostname. + * + * Analyze a custom hostname. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.hostName] Custom hostname. + * + * @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. + */ + analyzeCustomHostnameWithHttpOperationResponse(resourceGroupName: string, name: string, options?: { hostName? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Analyze a custom hostname. + * + * Analyze a custom hostname. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.hostName] Custom hostname. + * + * @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 {CustomHostnameAnalysisResult} - 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. + * + * {CustomHostnameAnalysisResult} [result] - The deserialized result object if an error did not occur. + * See {@link CustomHostnameAnalysisResult} 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. + */ + analyzeCustomHostname(resourceGroupName: string, name: string, options?: { hostName? : string, customHeaders? : { [headerName: string]: string; } }): Promise; + analyzeCustomHostname(resourceGroupName: string, name: string, callback: ServiceCallback): void; + analyzeCustomHostname(resourceGroupName: string, name: string, options: { hostName? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Applies the configuration settings from the target slot onto the + * current slot. + * + * Applies the configuration settings from the target slot onto the current + * slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} slotSwapEntity JSON object that contains the target slot + * name. See example. + * + * @param {string} slotSwapEntity.targetSlot Destination deployment slot during + * swap operation. + * + * @param {boolean} slotSwapEntity.preserveVnet true to preserve + * Virtual Network to the slot during swap; otherwise, false. + * + * @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. + */ + applySlotConfigToProductionWithHttpOperationResponse(resourceGroupName: string, name: string, slotSwapEntity: models.CsmSlotEntity, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Applies the configuration settings from the target slot onto the + * current slot. + * + * Applies the configuration settings from the target slot onto the current + * slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} slotSwapEntity JSON object that contains the target slot + * name. See example. + * + * @param {string} slotSwapEntity.targetSlot Destination deployment slot during + * swap operation. + * + * @param {boolean} slotSwapEntity.preserveVnet true to preserve + * Virtual Network to the slot during swap; otherwise, false. + * + * @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 {null} - 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. + * + * {null} [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. + */ + applySlotConfigToProduction(resourceGroupName: string, name: string, slotSwapEntity: models.CsmSlotEntity, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + applySlotConfigToProduction(resourceGroupName: string, name: string, slotSwapEntity: models.CsmSlotEntity, callback: ServiceCallback): void; + applySlotConfigToProduction(resourceGroupName: string, name: string, slotSwapEntity: models.CsmSlotEntity, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Creates a backup of an app. + * + * Creates a backup of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} request Backup configuration. You can use the JSON response + * from the POST action as input here. + * + * @param {string} [request.backupName] Name of the backup. + * + * @param {boolean} [request.enabled] True if the backup schedule is enabled + * (must be included in that case), false if the backup schedule should be + * disabled. + * + * @param {string} request.storageAccountUrl SAS URL to the container. + * + * @param {object} [request.backupSchedule] Schedule for the backup if it is + * executed periodically. + * + * @param {number} request.backupSchedule.frequencyInterval How often the + * backup should be executed (e.g. for weekly backup, this should be set to 7 + * and FrequencyUnit should be set to Day) + * + * @param {string} request.backupSchedule.frequencyUnit The unit of time for + * how often the backup should be executed (e.g. for weekly backup, this should + * be set to Day and FrequencyInterval should be set to 7). Possible values + * include: 'Day', 'Hour' + * + * @param {boolean} request.backupSchedule.keepAtLeastOneBackup True if the + * retention policy should always keep at least one backup in the storage + * account, regardless how old it is; false otherwise. + * + * @param {number} request.backupSchedule.retentionPeriodInDays After how many + * days backups should be deleted. + * + * @param {date} [request.backupSchedule.startTime] When the schedule should + * start working. + * + * @param {array} [request.databases] Databases included in the backup. + * + * @param {string} [request.kind] Kind of resource. + * + * @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. + */ + backupWithHttpOperationResponse(resourceGroupName: string, name: string, request: models.BackupRequest, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Creates a backup of an app. + * + * Creates a backup of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} request Backup configuration. You can use the JSON response + * from the POST action as input here. + * + * @param {string} [request.backupName] Name of the backup. + * + * @param {boolean} [request.enabled] True if the backup schedule is enabled + * (must be included in that case), false if the backup schedule should be + * disabled. + * + * @param {string} request.storageAccountUrl SAS URL to the container. + * + * @param {object} [request.backupSchedule] Schedule for the backup if it is + * executed periodically. + * + * @param {number} request.backupSchedule.frequencyInterval How often the + * backup should be executed (e.g. for weekly backup, this should be set to 7 + * and FrequencyUnit should be set to Day) + * + * @param {string} request.backupSchedule.frequencyUnit The unit of time for + * how often the backup should be executed (e.g. for weekly backup, this should + * be set to Day and FrequencyInterval should be set to 7). Possible values + * include: 'Day', 'Hour' + * + * @param {boolean} request.backupSchedule.keepAtLeastOneBackup True if the + * retention policy should always keep at least one backup in the storage + * account, regardless how old it is; false otherwise. + * + * @param {number} request.backupSchedule.retentionPeriodInDays After how many + * days backups should be deleted. + * + * @param {date} [request.backupSchedule.startTime] When the schedule should + * start working. + * + * @param {array} [request.databases] Databases included in the backup. + * + * @param {string} [request.kind] Kind of resource. + * + * @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 {BackupItem} - 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. + * + * {BackupItem} [result] - The deserialized result object if an error did not occur. + * See {@link BackupItem} 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. + */ + backup(resourceGroupName: string, name: string, request: models.BackupRequest, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + backup(resourceGroupName: string, name: string, request: models.BackupRequest, callback: ServiceCallback): void; + backup(resourceGroupName: string, name: string, request: models.BackupRequest, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Gets existing backups of an app. + * + * Gets existing backups of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @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. + */ + listBackupsWithHttpOperationResponse(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets existing backups of an app. + * + * Gets existing backups of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @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 {BackupItemCollection} - 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. + * + * {BackupItemCollection} [result] - The deserialized result object if an error did not occur. + * See {@link BackupItemCollection} 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. + */ + listBackups(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listBackups(resourceGroupName: string, name: string, callback: ServiceCallback): void; + listBackups(resourceGroupName: string, name: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Gets a backup of an app by its ID. + * + * Gets a backup of an app by its ID. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} backupId ID of the backup. + * + * @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. + */ + getBackupStatusWithHttpOperationResponse(resourceGroupName: string, name: string, backupId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets a backup of an app by its ID. + * + * Gets a backup of an app by its ID. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} backupId ID of the backup. + * + * @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 {BackupItem} - 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. + * + * {BackupItem} [result] - The deserialized result object if an error did not occur. + * See {@link BackupItem} 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. + */ + getBackupStatus(resourceGroupName: string, name: string, backupId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getBackupStatus(resourceGroupName: string, name: string, backupId: string, callback: ServiceCallback): void; + getBackupStatus(resourceGroupName: string, name: string, backupId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Deletes a backup of an app by its ID. + * + * Deletes a backup of an app by its ID. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} backupId ID of the backup. + * + * @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. + */ + deleteBackupWithHttpOperationResponse(resourceGroupName: string, name: string, backupId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Deletes a backup of an app by its ID. + * + * Deletes a backup of an app by its ID. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} backupId ID of the backup. + * + * @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 {null} - 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. + * + * {null} [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. + */ + deleteBackup(resourceGroupName: string, name: string, backupId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteBackup(resourceGroupName: string, name: string, backupId: string, callback: ServiceCallback): void; + deleteBackup(resourceGroupName: string, name: string, backupId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Gets status of a web app backup that may be in progress, including + * secrets associated with the backup, such as the Azure Storage SAS URL. Also + * can be used to update the SAS URL for the backup if a new URL is passed in + * the request body. + * + * Gets status of a web app backup that may be in progress, including secrets + * associated with the backup, such as the Azure Storage SAS URL. Also can be + * used to update the SAS URL for the backup if a new URL is passed in the + * request body. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {string} backupId ID of backup. + * + * @param {object} request Information on backup request. + * + * @param {string} [request.backupName] Name of the backup. + * + * @param {boolean} [request.enabled] True if the backup schedule is enabled + * (must be included in that case), false if the backup schedule should be + * disabled. + * + * @param {string} request.storageAccountUrl SAS URL to the container. + * + * @param {object} [request.backupSchedule] Schedule for the backup if it is + * executed periodically. + * + * @param {number} request.backupSchedule.frequencyInterval How often the + * backup should be executed (e.g. for weekly backup, this should be set to 7 + * and FrequencyUnit should be set to Day) + * + * @param {string} request.backupSchedule.frequencyUnit The unit of time for + * how often the backup should be executed (e.g. for weekly backup, this should + * be set to Day and FrequencyInterval should be set to 7). Possible values + * include: 'Day', 'Hour' + * + * @param {boolean} request.backupSchedule.keepAtLeastOneBackup True if the + * retention policy should always keep at least one backup in the storage + * account, regardless how old it is; false otherwise. + * + * @param {number} request.backupSchedule.retentionPeriodInDays After how many + * days backups should be deleted. + * + * @param {date} [request.backupSchedule.startTime] When the schedule should + * start working. + * + * @param {array} [request.databases] Databases included in the backup. + * + * @param {string} [request.kind] Kind of resource. + * + * @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. + */ + listBackupStatusSecretsWithHttpOperationResponse(resourceGroupName: string, name: string, backupId: string, request: models.BackupRequest, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets status of a web app backup that may be in progress, including + * secrets associated with the backup, such as the Azure Storage SAS URL. Also + * can be used to update the SAS URL for the backup if a new URL is passed in + * the request body. + * + * Gets status of a web app backup that may be in progress, including secrets + * associated with the backup, such as the Azure Storage SAS URL. Also can be + * used to update the SAS URL for the backup if a new URL is passed in the + * request body. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {string} backupId ID of backup. + * + * @param {object} request Information on backup request. + * + * @param {string} [request.backupName] Name of the backup. + * + * @param {boolean} [request.enabled] True if the backup schedule is enabled + * (must be included in that case), false if the backup schedule should be + * disabled. + * + * @param {string} request.storageAccountUrl SAS URL to the container. + * + * @param {object} [request.backupSchedule] Schedule for the backup if it is + * executed periodically. + * + * @param {number} request.backupSchedule.frequencyInterval How often the + * backup should be executed (e.g. for weekly backup, this should be set to 7 + * and FrequencyUnit should be set to Day) + * + * @param {string} request.backupSchedule.frequencyUnit The unit of time for + * how often the backup should be executed (e.g. for weekly backup, this should + * be set to Day and FrequencyInterval should be set to 7). Possible values + * include: 'Day', 'Hour' + * + * @param {boolean} request.backupSchedule.keepAtLeastOneBackup True if the + * retention policy should always keep at least one backup in the storage + * account, regardless how old it is; false otherwise. + * + * @param {number} request.backupSchedule.retentionPeriodInDays After how many + * days backups should be deleted. + * + * @param {date} [request.backupSchedule.startTime] When the schedule should + * start working. + * + * @param {array} [request.databases] Databases included in the backup. + * + * @param {string} [request.kind] Kind of resource. + * + * @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 {BackupItem} - 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. + * + * {BackupItem} [result] - The deserialized result object if an error did not occur. + * See {@link BackupItem} 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. + */ + listBackupStatusSecrets(resourceGroupName: string, name: string, backupId: string, request: models.BackupRequest, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listBackupStatusSecrets(resourceGroupName: string, name: string, backupId: string, request: models.BackupRequest, callback: ServiceCallback): void; + listBackupStatusSecrets(resourceGroupName: string, name: string, backupId: string, request: models.BackupRequest, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Restores a specific backup to another app (or deployment slot, if + * specified). + * + * Restores a specific backup to another app (or deployment slot, if + * specified). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} backupId ID of the backup. + * + * @param {object} request Information on restore request . + * + * @param {string} request.storageAccountUrl SAS URL to the container. + * + * @param {string} [request.blobName] Name of a blob which contains the backup. + * + * @param {boolean} request.overwrite true if the restore + * operation can overwrite target app; otherwise, false. + * true is needed if trying to restore over an existing app. + * + * @param {string} [request.siteName] Name of an app. + * + * @param {array} [request.databases] Collection of databases which should be + * restored. This list has to match the list of databases included in the + * backup. + * + * @param {boolean} [request.ignoreConflictingHostNames] Changes a logic when + * restoring an app with custom domains. true to remove custom + * domains automatically. If false, custom domains are added to + * the app's object when it is being restored, but that might fail due to + * conflicts during the operation. + * + * @param {boolean} [request.ignoreDatabases] Ignore the databases and only + * restore the site content + * + * @param {string} [request.appServicePlan] Specify app service plan that will + * own restored site. + * + * @param {string} [request.operationType] Operation type. Possible values + * include: 'Default', 'Clone', 'Relocation', 'Snapshot', 'CloudFS' + * + * @param {boolean} [request.adjustConnectionStrings] true if + * SiteConfig.ConnectionStrings should be set in new app; otherwise, + * false. + * + * @param {string} [request.hostingEnvironment] App Service Environment name, + * if needed (only when restoring an app to an App Service Environment). + * + * @param {string} [request.kind] Kind of resource. + * + * @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. + */ + restoreWithHttpOperationResponse(resourceGroupName: string, name: string, backupId: string, request: models.RestoreRequest, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Restores a specific backup to another app (or deployment slot, if + * specified). + * + * Restores a specific backup to another app (or deployment slot, if + * specified). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} backupId ID of the backup. + * + * @param {object} request Information on restore request . + * + * @param {string} request.storageAccountUrl SAS URL to the container. + * + * @param {string} [request.blobName] Name of a blob which contains the backup. + * + * @param {boolean} request.overwrite true if the restore + * operation can overwrite target app; otherwise, false. + * true is needed if trying to restore over an existing app. + * + * @param {string} [request.siteName] Name of an app. + * + * @param {array} [request.databases] Collection of databases which should be + * restored. This list has to match the list of databases included in the + * backup. + * + * @param {boolean} [request.ignoreConflictingHostNames] Changes a logic when + * restoring an app with custom domains. true to remove custom + * domains automatically. If false, custom domains are added to + * the app's object when it is being restored, but that might fail due to + * conflicts during the operation. + * + * @param {boolean} [request.ignoreDatabases] Ignore the databases and only + * restore the site content + * + * @param {string} [request.appServicePlan] Specify app service plan that will + * own restored site. + * + * @param {string} [request.operationType] Operation type. Possible values + * include: 'Default', 'Clone', 'Relocation', 'Snapshot', 'CloudFS' + * + * @param {boolean} [request.adjustConnectionStrings] true if + * SiteConfig.ConnectionStrings should be set in new app; otherwise, + * false. + * + * @param {string} [request.hostingEnvironment] App Service Environment name, + * if needed (only when restoring an app to an App Service Environment). + * + * @param {string} [request.kind] Kind of resource. + * + * @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 {null} - 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. + * + * {null} [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. + */ + restore(resourceGroupName: string, name: string, backupId: string, request: models.RestoreRequest, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + restore(resourceGroupName: string, name: string, backupId: string, request: models.RestoreRequest, callback: ServiceCallback): void; + restore(resourceGroupName: string, name: string, backupId: string, request: models.RestoreRequest, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary List the configurations of an app + * + * List the configurations of an app + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @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. + */ + listConfigurationsWithHttpOperationResponse(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary List the configurations of an app + * + * List the configurations of an app + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @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 {SiteConfigResourceCollection} - 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. + * + * {SiteConfigResourceCollection} [result] - The deserialized result object if an error did not occur. + * See {@link SiteConfigResourceCollection} 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. + */ + listConfigurations(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listConfigurations(resourceGroupName: string, name: string, callback: ServiceCallback): void; + listConfigurations(resourceGroupName: string, name: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Replaces the application settings of an app. + * + * Replaces the application settings of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} appSettings Application settings of the app. + * + * @param {object} [appSettings.properties] Settings. + * + * @param {string} [appSettings.kind] Kind of resource. + * + * @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. + */ + updateApplicationSettingsWithHttpOperationResponse(resourceGroupName: string, name: string, appSettings: models.StringDictionary, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Replaces the application settings of an app. + * + * Replaces the application settings of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} appSettings Application settings of the app. + * + * @param {object} [appSettings.properties] Settings. + * + * @param {string} [appSettings.kind] Kind of resource. + * + * @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 {StringDictionary} - 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. + * + * {StringDictionary} [result] - The deserialized result object if an error did not occur. + * See {@link StringDictionary} 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. + */ + updateApplicationSettings(resourceGroupName: string, name: string, appSettings: models.StringDictionary, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + updateApplicationSettings(resourceGroupName: string, name: string, appSettings: models.StringDictionary, callback: ServiceCallback): void; + updateApplicationSettings(resourceGroupName: string, name: string, appSettings: models.StringDictionary, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Gets the application settings of an app. + * + * Gets the application settings of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @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. + */ + listApplicationSettingsWithHttpOperationResponse(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets the application settings of an app. + * + * Gets the application settings of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @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 {StringDictionary} - 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. + * + * {StringDictionary} [result] - The deserialized result object if an error did not occur. + * See {@link StringDictionary} 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. + */ + listApplicationSettings(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listApplicationSettings(resourceGroupName: string, name: string, callback: ServiceCallback): void; + listApplicationSettings(resourceGroupName: string, name: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Updates the Authentication / Authorization settings associated with + * web app. + * + * Updates the Authentication / Authorization settings associated with web app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {object} siteAuthSettings Auth settings associated with web app. + * + * @param {boolean} [siteAuthSettings.enabled] true if the + * Authentication / Authorization feature is enabled for the current app; + * otherwise, false. + * + * @param {string} [siteAuthSettings.runtimeVersion] The RuntimeVersion of the + * Authentication / Authorization feature in use for the current app. + * The setting in this value can control the behavior of certain features in + * the Authentication / Authorization module. + * + * @param {string} [siteAuthSettings.unauthenticatedClientAction] The action to + * take when an unauthenticated client attempts to access the app. Possible + * values include: 'RedirectToLoginPage', 'AllowAnonymous' + * + * @param {boolean} [siteAuthSettings.tokenStoreEnabled] true to + * durably store platform-specific security tokens that are obtained during + * login flows; otherwise, false. + * The default is false. + * + * @param {array} [siteAuthSettings.allowedExternalRedirectUrls] External URLs + * that can be redirected to as part of logging in or logging out of the app. + * Note that the query string part of the URL is ignored. + * This is an advanced setting typically only needed by Windows Store + * application backends. + * Note that URLs within the current domain are always implicitly allowed. + * + * @param {string} [siteAuthSettings.defaultProvider] The default + * authentication provider to use when multiple providers are configured. + * This setting is only needed if multiple providers are configured and the + * unauthenticated client + * action is set to "RedirectToLoginPage". Possible values include: + * 'AzureActiveDirectory', 'Facebook', 'Google', 'MicrosoftAccount', 'Twitter' + * + * @param {number} [siteAuthSettings.tokenRefreshExtensionHours] The number of + * hours after session token expiration that a session token can be used to + * call the token refresh API. The default is 72 hours. + * + * @param {string} [siteAuthSettings.clientId] The Client ID of this relying + * party application, known as the client_id. + * This setting is required for enabling OpenID Connection authentication with + * Azure Active Directory or + * other 3rd party OpenID Connect providers. + * More information on OpenID Connect: + * http://openid.net/specs/openid-connect-core-1_0.html + * + * @param {string} [siteAuthSettings.clientSecret] The Client Secret of this + * relying party application (in Azure Active Directory, this is also referred + * to as the Key). + * This setting is optional. If no client secret is configured, the OpenID + * Connect implicit auth flow is used to authenticate end users. + * Otherwise, the OpenID Connect Authorization Code Flow is used to + * authenticate end users. + * More information on OpenID Connect: + * http://openid.net/specs/openid-connect-core-1_0.html + * + * @param {string} [siteAuthSettings.issuer] The OpenID Connect Issuer URI that + * represents the entity which issues access tokens for this application. + * When using Azure Active Directory, this value is the URI of the directory + * tenant, e.g. https://sts.windows.net/{tenant-guid}/. + * This URI is a case-sensitive identifier for the token issuer. + * More information on OpenID Connect Discovery: + * http://openid.net/specs/openid-connect-discovery-1_0.html + * + * @param {boolean} [siteAuthSettings.validateIssuer] Gets a value indicating + * whether the issuer should be a valid HTTPS url and be validated as such. + * + * @param {array} [siteAuthSettings.allowedAudiences] Allowed audience values + * to consider when validating JWTs issued by + * Azure Active Directory. Note that the ClientID value is always + * considered an + * allowed audience, regardless of this setting. + * + * @param {array} [siteAuthSettings.additionalLoginParams] Login parameters to + * send to the OpenID Connect authorization endpoint when + * a user logs in. Each parameter must be in the form "key=value". + * + * @param {string} [siteAuthSettings.googleClientId] The OpenID Connect Client + * ID for the Google web application. + * This setting is required for enabling Google Sign-In. + * Google Sign-In documentation: + * https://developers.google.com/identity/sign-in/web/ + * + * @param {string} [siteAuthSettings.googleClientSecret] The client secret + * associated with the Google web application. + * This setting is required for enabling Google Sign-In. + * Google Sign-In documentation: + * https://developers.google.com/identity/sign-in/web/ + * + * @param {array} [siteAuthSettings.googleOAuthScopes] The OAuth 2.0 scopes + * that will be requested as part of Google Sign-In authentication. + * This setting is optional. If not specified, "openid", "profile", and "email" + * are used as default scopes. + * Google Sign-In documentation: + * https://developers.google.com/identity/sign-in/web/ + * + * @param {string} [siteAuthSettings.facebookAppId] The App ID of the Facebook + * app used for login. + * This setting is required for enabling Facebook Login. + * Facebook Login documentation: + * https://developers.facebook.com/docs/facebook-login + * + * @param {string} [siteAuthSettings.facebookAppSecret] The App Secret of the + * Facebook app used for Facebook Login. + * This setting is required for enabling Facebook Login. + * Facebook Login documentation: + * https://developers.facebook.com/docs/facebook-login + * + * @param {array} [siteAuthSettings.facebookOAuthScopes] The OAuth 2.0 scopes + * that will be requested as part of Facebook Login authentication. + * This setting is optional. + * Facebook Login documentation: + * https://developers.facebook.com/docs/facebook-login + * + * @param {string} [siteAuthSettings.twitterConsumerKey] The OAuth 1.0a + * consumer key of the Twitter application used for sign-in. + * This setting is required for enabling Twitter Sign-In. + * Twitter Sign-In documentation: https://dev.twitter.com/web/sign-in + * + * @param {string} [siteAuthSettings.twitterConsumerSecret] The OAuth 1.0a + * consumer secret of the Twitter application used for sign-in. + * This setting is required for enabling Twitter Sign-In. + * Twitter Sign-In documentation: https://dev.twitter.com/web/sign-in + * + * @param {string} [siteAuthSettings.microsoftAccountClientId] The OAuth 2.0 + * client ID that was created for the app used for authentication. + * This setting is required for enabling Microsoft Account authentication. + * Microsoft Account OAuth documentation: + * https://dev.onedrive.com/auth/msa_oauth.htm + * + * @param {string} [siteAuthSettings.microsoftAccountClientSecret] The OAuth + * 2.0 client secret that was created for the app used for authentication. + * This setting is required for enabling Microsoft Account authentication. + * Microsoft Account OAuth documentation: + * https://dev.onedrive.com/auth/msa_oauth.htm + * + * @param {array} [siteAuthSettings.microsoftAccountOAuthScopes] The OAuth 2.0 + * scopes that will be requested as part of Microsoft Account authentication. + * This setting is optional. If not specified, "wl.basic" is used as the + * default scope. + * Microsoft Account Scopes and permissions documentation: + * https://msdn.microsoft.com/en-us/library/dn631845.aspx + * + * @param {string} [siteAuthSettings.kind] Kind of resource. + * + * @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. + */ + updateAuthSettingsWithHttpOperationResponse(resourceGroupName: string, name: string, siteAuthSettings: models.SiteAuthSettings, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Updates the Authentication / Authorization settings associated with + * web app. + * + * Updates the Authentication / Authorization settings associated with web app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {object} siteAuthSettings Auth settings associated with web app. + * + * @param {boolean} [siteAuthSettings.enabled] true if the + * Authentication / Authorization feature is enabled for the current app; + * otherwise, false. + * + * @param {string} [siteAuthSettings.runtimeVersion] The RuntimeVersion of the + * Authentication / Authorization feature in use for the current app. + * The setting in this value can control the behavior of certain features in + * the Authentication / Authorization module. + * + * @param {string} [siteAuthSettings.unauthenticatedClientAction] The action to + * take when an unauthenticated client attempts to access the app. Possible + * values include: 'RedirectToLoginPage', 'AllowAnonymous' + * + * @param {boolean} [siteAuthSettings.tokenStoreEnabled] true to + * durably store platform-specific security tokens that are obtained during + * login flows; otherwise, false. + * The default is false. + * + * @param {array} [siteAuthSettings.allowedExternalRedirectUrls] External URLs + * that can be redirected to as part of logging in or logging out of the app. + * Note that the query string part of the URL is ignored. + * This is an advanced setting typically only needed by Windows Store + * application backends. + * Note that URLs within the current domain are always implicitly allowed. + * + * @param {string} [siteAuthSettings.defaultProvider] The default + * authentication provider to use when multiple providers are configured. + * This setting is only needed if multiple providers are configured and the + * unauthenticated client + * action is set to "RedirectToLoginPage". Possible values include: + * 'AzureActiveDirectory', 'Facebook', 'Google', 'MicrosoftAccount', 'Twitter' + * + * @param {number} [siteAuthSettings.tokenRefreshExtensionHours] The number of + * hours after session token expiration that a session token can be used to + * call the token refresh API. The default is 72 hours. + * + * @param {string} [siteAuthSettings.clientId] The Client ID of this relying + * party application, known as the client_id. + * This setting is required for enabling OpenID Connection authentication with + * Azure Active Directory or + * other 3rd party OpenID Connect providers. + * More information on OpenID Connect: + * http://openid.net/specs/openid-connect-core-1_0.html + * + * @param {string} [siteAuthSettings.clientSecret] The Client Secret of this + * relying party application (in Azure Active Directory, this is also referred + * to as the Key). + * This setting is optional. If no client secret is configured, the OpenID + * Connect implicit auth flow is used to authenticate end users. + * Otherwise, the OpenID Connect Authorization Code Flow is used to + * authenticate end users. + * More information on OpenID Connect: + * http://openid.net/specs/openid-connect-core-1_0.html + * + * @param {string} [siteAuthSettings.issuer] The OpenID Connect Issuer URI that + * represents the entity which issues access tokens for this application. + * When using Azure Active Directory, this value is the URI of the directory + * tenant, e.g. https://sts.windows.net/{tenant-guid}/. + * This URI is a case-sensitive identifier for the token issuer. + * More information on OpenID Connect Discovery: + * http://openid.net/specs/openid-connect-discovery-1_0.html + * + * @param {boolean} [siteAuthSettings.validateIssuer] Gets a value indicating + * whether the issuer should be a valid HTTPS url and be validated as such. + * + * @param {array} [siteAuthSettings.allowedAudiences] Allowed audience values + * to consider when validating JWTs issued by + * Azure Active Directory. Note that the ClientID value is always + * considered an + * allowed audience, regardless of this setting. + * + * @param {array} [siteAuthSettings.additionalLoginParams] Login parameters to + * send to the OpenID Connect authorization endpoint when + * a user logs in. Each parameter must be in the form "key=value". + * + * @param {string} [siteAuthSettings.googleClientId] The OpenID Connect Client + * ID for the Google web application. + * This setting is required for enabling Google Sign-In. + * Google Sign-In documentation: + * https://developers.google.com/identity/sign-in/web/ + * + * @param {string} [siteAuthSettings.googleClientSecret] The client secret + * associated with the Google web application. + * This setting is required for enabling Google Sign-In. + * Google Sign-In documentation: + * https://developers.google.com/identity/sign-in/web/ + * + * @param {array} [siteAuthSettings.googleOAuthScopes] The OAuth 2.0 scopes + * that will be requested as part of Google Sign-In authentication. + * This setting is optional. If not specified, "openid", "profile", and "email" + * are used as default scopes. + * Google Sign-In documentation: + * https://developers.google.com/identity/sign-in/web/ + * + * @param {string} [siteAuthSettings.facebookAppId] The App ID of the Facebook + * app used for login. + * This setting is required for enabling Facebook Login. + * Facebook Login documentation: + * https://developers.facebook.com/docs/facebook-login + * + * @param {string} [siteAuthSettings.facebookAppSecret] The App Secret of the + * Facebook app used for Facebook Login. + * This setting is required for enabling Facebook Login. + * Facebook Login documentation: + * https://developers.facebook.com/docs/facebook-login + * + * @param {array} [siteAuthSettings.facebookOAuthScopes] The OAuth 2.0 scopes + * that will be requested as part of Facebook Login authentication. + * This setting is optional. + * Facebook Login documentation: + * https://developers.facebook.com/docs/facebook-login + * + * @param {string} [siteAuthSettings.twitterConsumerKey] The OAuth 1.0a + * consumer key of the Twitter application used for sign-in. + * This setting is required for enabling Twitter Sign-In. + * Twitter Sign-In documentation: https://dev.twitter.com/web/sign-in + * + * @param {string} [siteAuthSettings.twitterConsumerSecret] The OAuth 1.0a + * consumer secret of the Twitter application used for sign-in. + * This setting is required for enabling Twitter Sign-In. + * Twitter Sign-In documentation: https://dev.twitter.com/web/sign-in + * + * @param {string} [siteAuthSettings.microsoftAccountClientId] The OAuth 2.0 + * client ID that was created for the app used for authentication. + * This setting is required for enabling Microsoft Account authentication. + * Microsoft Account OAuth documentation: + * https://dev.onedrive.com/auth/msa_oauth.htm + * + * @param {string} [siteAuthSettings.microsoftAccountClientSecret] The OAuth + * 2.0 client secret that was created for the app used for authentication. + * This setting is required for enabling Microsoft Account authentication. + * Microsoft Account OAuth documentation: + * https://dev.onedrive.com/auth/msa_oauth.htm + * + * @param {array} [siteAuthSettings.microsoftAccountOAuthScopes] The OAuth 2.0 + * scopes that will be requested as part of Microsoft Account authentication. + * This setting is optional. If not specified, "wl.basic" is used as the + * default scope. + * Microsoft Account Scopes and permissions documentation: + * https://msdn.microsoft.com/en-us/library/dn631845.aspx + * + * @param {string} [siteAuthSettings.kind] Kind of resource. + * + * @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 {SiteAuthSettings} - 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. + * + * {SiteAuthSettings} [result] - The deserialized result object if an error did not occur. + * See {@link SiteAuthSettings} 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. + */ + updateAuthSettings(resourceGroupName: string, name: string, siteAuthSettings: models.SiteAuthSettings, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + updateAuthSettings(resourceGroupName: string, name: string, siteAuthSettings: models.SiteAuthSettings, callback: ServiceCallback): void; + updateAuthSettings(resourceGroupName: string, name: string, siteAuthSettings: models.SiteAuthSettings, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Gets the Authentication/Authorization settings of an app. + * + * Gets the Authentication/Authorization settings of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @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. + */ + getAuthSettingsWithHttpOperationResponse(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets the Authentication/Authorization settings of an app. + * + * Gets the Authentication/Authorization settings of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @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 {SiteAuthSettings} - 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. + * + * {SiteAuthSettings} [result] - The deserialized result object if an error did not occur. + * See {@link SiteAuthSettings} 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. + */ + getAuthSettings(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getAuthSettings(resourceGroupName: string, name: string, callback: ServiceCallback): void; + getAuthSettings(resourceGroupName: string, name: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Updates the Azure storage account configurations of an app. + * + * Updates the Azure storage account configurations of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} azureStorageAccounts Azure storage accounts of the app. + * + * @param {object} [azureStorageAccounts.properties] Azure storage accounts. + * + * @param {string} [azureStorageAccounts.kind] Kind of resource. + * + * @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. + */ + updateAzureStorageAccountsWithHttpOperationResponse(resourceGroupName: string, name: string, azureStorageAccounts: models.AzureStoragePropertyDictionaryResource, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Updates the Azure storage account configurations of an app. + * + * Updates the Azure storage account configurations of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} azureStorageAccounts Azure storage accounts of the app. + * + * @param {object} [azureStorageAccounts.properties] Azure storage accounts. + * + * @param {string} [azureStorageAccounts.kind] Kind of resource. + * + * @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 {AzureStoragePropertyDictionaryResource} - 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. + * + * {AzureStoragePropertyDictionaryResource} [result] - The deserialized result object if an error did not occur. + * See {@link AzureStoragePropertyDictionaryResource} 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. + */ + updateAzureStorageAccounts(resourceGroupName: string, name: string, azureStorageAccounts: models.AzureStoragePropertyDictionaryResource, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + updateAzureStorageAccounts(resourceGroupName: string, name: string, azureStorageAccounts: models.AzureStoragePropertyDictionaryResource, callback: ServiceCallback): void; + updateAzureStorageAccounts(resourceGroupName: string, name: string, azureStorageAccounts: models.AzureStoragePropertyDictionaryResource, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Gets the Azure storage account configurations of an app. + * + * Gets the Azure storage account configurations of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @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. + */ + listAzureStorageAccountsWithHttpOperationResponse(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets the Azure storage account configurations of an app. + * + * Gets the Azure storage account configurations of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @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 {AzureStoragePropertyDictionaryResource} - 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. + * + * {AzureStoragePropertyDictionaryResource} [result] - The deserialized result object if an error did not occur. + * See {@link AzureStoragePropertyDictionaryResource} 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. + */ + listAzureStorageAccounts(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listAzureStorageAccounts(resourceGroupName: string, name: string, callback: ServiceCallback): void; + listAzureStorageAccounts(resourceGroupName: string, name: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Updates the backup configuration of an app. + * + * Updates the backup configuration of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} request Edited backup configuration. + * + * @param {string} [request.backupName] Name of the backup. + * + * @param {boolean} [request.enabled] True if the backup schedule is enabled + * (must be included in that case), false if the backup schedule should be + * disabled. + * + * @param {string} request.storageAccountUrl SAS URL to the container. + * + * @param {object} [request.backupSchedule] Schedule for the backup if it is + * executed periodically. + * + * @param {number} request.backupSchedule.frequencyInterval How often the + * backup should be executed (e.g. for weekly backup, this should be set to 7 + * and FrequencyUnit should be set to Day) + * + * @param {string} request.backupSchedule.frequencyUnit The unit of time for + * how often the backup should be executed (e.g. for weekly backup, this should + * be set to Day and FrequencyInterval should be set to 7). Possible values + * include: 'Day', 'Hour' + * + * @param {boolean} request.backupSchedule.keepAtLeastOneBackup True if the + * retention policy should always keep at least one backup in the storage + * account, regardless how old it is; false otherwise. + * + * @param {number} request.backupSchedule.retentionPeriodInDays After how many + * days backups should be deleted. + * + * @param {date} [request.backupSchedule.startTime] When the schedule should + * start working. + * + * @param {array} [request.databases] Databases included in the backup. + * + * @param {string} [request.kind] Kind of resource. + * + * @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. + */ + updateBackupConfigurationWithHttpOperationResponse(resourceGroupName: string, name: string, request: models.BackupRequest, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Updates the backup configuration of an app. + * + * Updates the backup configuration of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} request Edited backup configuration. + * + * @param {string} [request.backupName] Name of the backup. + * + * @param {boolean} [request.enabled] True if the backup schedule is enabled + * (must be included in that case), false if the backup schedule should be + * disabled. + * + * @param {string} request.storageAccountUrl SAS URL to the container. + * + * @param {object} [request.backupSchedule] Schedule for the backup if it is + * executed periodically. + * + * @param {number} request.backupSchedule.frequencyInterval How often the + * backup should be executed (e.g. for weekly backup, this should be set to 7 + * and FrequencyUnit should be set to Day) + * + * @param {string} request.backupSchedule.frequencyUnit The unit of time for + * how often the backup should be executed (e.g. for weekly backup, this should + * be set to Day and FrequencyInterval should be set to 7). Possible values + * include: 'Day', 'Hour' + * + * @param {boolean} request.backupSchedule.keepAtLeastOneBackup True if the + * retention policy should always keep at least one backup in the storage + * account, regardless how old it is; false otherwise. + * + * @param {number} request.backupSchedule.retentionPeriodInDays After how many + * days backups should be deleted. + * + * @param {date} [request.backupSchedule.startTime] When the schedule should + * start working. + * + * @param {array} [request.databases] Databases included in the backup. + * + * @param {string} [request.kind] Kind of resource. + * + * @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 {BackupRequest} - 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. + * + * {BackupRequest} [result] - The deserialized result object if an error did not occur. + * See {@link BackupRequest} 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. + */ + updateBackupConfiguration(resourceGroupName: string, name: string, request: models.BackupRequest, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + updateBackupConfiguration(resourceGroupName: string, name: string, request: models.BackupRequest, callback: ServiceCallback): void; + updateBackupConfiguration(resourceGroupName: string, name: string, request: models.BackupRequest, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Deletes the backup configuration of an app. + * + * Deletes the backup configuration of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @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. + */ + deleteBackupConfigurationWithHttpOperationResponse(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Deletes the backup configuration of an app. + * + * Deletes the backup configuration of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @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 {null} - 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. + * + * {null} [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. + */ + deleteBackupConfiguration(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteBackupConfiguration(resourceGroupName: string, name: string, callback: ServiceCallback): void; + deleteBackupConfiguration(resourceGroupName: string, name: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Gets the backup configuration of an app. + * + * Gets the backup configuration of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @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. + */ + getBackupConfigurationWithHttpOperationResponse(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets the backup configuration of an app. + * + * Gets the backup configuration of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @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 {BackupRequest} - 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. + * + * {BackupRequest} [result] - The deserialized result object if an error did not occur. + * See {@link BackupRequest} 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. + */ + getBackupConfiguration(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getBackupConfiguration(resourceGroupName: string, name: string, callback: ServiceCallback): void; + getBackupConfiguration(resourceGroupName: string, name: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Replaces the connection strings of an app. + * + * Replaces the connection strings of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} connectionStrings Connection strings of the app or + * deployment slot. See example. + * + * @param {object} [connectionStrings.properties] Connection strings. + * + * @param {string} [connectionStrings.kind] Kind of resource. + * + * @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. + */ + updateConnectionStringsWithHttpOperationResponse(resourceGroupName: string, name: string, connectionStrings: models.ConnectionStringDictionary, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Replaces the connection strings of an app. + * + * Replaces the connection strings of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} connectionStrings Connection strings of the app or + * deployment slot. See example. + * + * @param {object} [connectionStrings.properties] Connection strings. + * + * @param {string} [connectionStrings.kind] Kind of resource. + * + * @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 {ConnectionStringDictionary} - 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. + * + * {ConnectionStringDictionary} [result] - The deserialized result object if an error did not occur. + * See {@link ConnectionStringDictionary} 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. + */ + updateConnectionStrings(resourceGroupName: string, name: string, connectionStrings: models.ConnectionStringDictionary, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + updateConnectionStrings(resourceGroupName: string, name: string, connectionStrings: models.ConnectionStringDictionary, callback: ServiceCallback): void; + updateConnectionStrings(resourceGroupName: string, name: string, connectionStrings: models.ConnectionStringDictionary, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Gets the connection strings of an app. + * + * Gets the connection strings of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @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. + */ + listConnectionStringsWithHttpOperationResponse(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets the connection strings of an app. + * + * Gets the connection strings of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @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 {ConnectionStringDictionary} - 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. + * + * {ConnectionStringDictionary} [result] - The deserialized result object if an error did not occur. + * See {@link ConnectionStringDictionary} 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. + */ + listConnectionStrings(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listConnectionStrings(resourceGroupName: string, name: string, callback: ServiceCallback): void; + listConnectionStrings(resourceGroupName: string, name: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Gets the logging configuration of an app. + * + * Gets the logging configuration of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @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. + */ + getDiagnosticLogsConfigurationWithHttpOperationResponse(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets the logging configuration of an app. + * + * Gets the logging configuration of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @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 {SiteLogsConfig} - 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. + * + * {SiteLogsConfig} [result] - The deserialized result object if an error did not occur. + * See {@link SiteLogsConfig} 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. + */ + getDiagnosticLogsConfiguration(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getDiagnosticLogsConfiguration(resourceGroupName: string, name: string, callback: ServiceCallback): void; + getDiagnosticLogsConfiguration(resourceGroupName: string, name: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Updates the logging configuration of an app. + * + * Updates the logging configuration of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} siteLogsConfig A SiteLogsConfig JSON object that contains + * the logging configuration to change in the "properties" property. + * + * @param {object} [siteLogsConfig.applicationLogs] Application logs + * configuration. + * + * @param {object} [siteLogsConfig.applicationLogs.fileSystem] Application logs + * to file system configuration. + * + * @param {string} [siteLogsConfig.applicationLogs.fileSystem.level] Log level. + * Possible values include: 'Off', 'Verbose', 'Information', 'Warning', 'Error' + * + * @param {object} [siteLogsConfig.applicationLogs.azureTableStorage] + * Application logs to azure table storage configuration. + * + * @param {string} [siteLogsConfig.applicationLogs.azureTableStorage.level] Log + * level. Possible values include: 'Off', 'Verbose', 'Information', 'Warning', + * 'Error' + * + * @param {string} siteLogsConfig.applicationLogs.azureTableStorage.sasUrl SAS + * URL to an Azure table with add/query/delete permissions. + * + * @param {object} [siteLogsConfig.applicationLogs.azureBlobStorage] + * Application logs to blob storage configuration. + * + * @param {string} [siteLogsConfig.applicationLogs.azureBlobStorage.level] Log + * level. Possible values include: 'Off', 'Verbose', 'Information', 'Warning', + * 'Error' + * + * @param {string} [siteLogsConfig.applicationLogs.azureBlobStorage.sasUrl] SAS + * url to a azure blob container with read/write/list/delete permissions. + * + * @param {number} + * [siteLogsConfig.applicationLogs.azureBlobStorage.retentionInDays] Retention + * in days. + * Remove blobs older than X days. + * 0 or lower means no retention. + * + * @param {object} [siteLogsConfig.httpLogs] HTTP logs configuration. + * + * @param {object} [siteLogsConfig.httpLogs.fileSystem] Http logs to file + * system configuration. + * + * @param {number} [siteLogsConfig.httpLogs.fileSystem.retentionInMb] Maximum + * size in megabytes that http log files can use. + * When reached old log files will be removed to make space for new ones. + * Value can range between 25 and 100. + * + * @param {number} [siteLogsConfig.httpLogs.fileSystem.retentionInDays] + * Retention in days. + * Remove files older than X days. + * 0 or lower means no retention. + * + * @param {boolean} [siteLogsConfig.httpLogs.fileSystem.enabled] True if + * configuration is enabled, false if it is disabled and null if configuration + * is not set. + * + * @param {object} [siteLogsConfig.httpLogs.azureBlobStorage] Http logs to + * azure blob storage configuration. + * + * @param {string} [siteLogsConfig.httpLogs.azureBlobStorage.sasUrl] SAS url to + * a azure blob container with read/write/list/delete permissions. + * + * @param {number} [siteLogsConfig.httpLogs.azureBlobStorage.retentionInDays] + * Retention in days. + * Remove blobs older than X days. + * 0 or lower means no retention. + * + * @param {boolean} [siteLogsConfig.httpLogs.azureBlobStorage.enabled] True if + * configuration is enabled, false if it is disabled and null if configuration + * is not set. + * + * @param {object} [siteLogsConfig.failedRequestsTracing] Failed requests + * tracing configuration. + * + * @param {object} [siteLogsConfig.detailedErrorMessages] Detailed error + * messages configuration. + * + * @param {boolean} [siteLogsConfig.detailedErrorMessages.enabled] True if + * configuration is enabled, false if it is disabled and null if configuration + * is not set. + * + * @param {string} [siteLogsConfig.kind] Kind of resource. + * + * @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. + */ + updateDiagnosticLogsConfigWithHttpOperationResponse(resourceGroupName: string, name: string, siteLogsConfig: models.SiteLogsConfig, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Updates the logging configuration of an app. + * + * Updates the logging configuration of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} siteLogsConfig A SiteLogsConfig JSON object that contains + * the logging configuration to change in the "properties" property. + * + * @param {object} [siteLogsConfig.applicationLogs] Application logs + * configuration. + * + * @param {object} [siteLogsConfig.applicationLogs.fileSystem] Application logs + * to file system configuration. + * + * @param {string} [siteLogsConfig.applicationLogs.fileSystem.level] Log level. + * Possible values include: 'Off', 'Verbose', 'Information', 'Warning', 'Error' + * + * @param {object} [siteLogsConfig.applicationLogs.azureTableStorage] + * Application logs to azure table storage configuration. + * + * @param {string} [siteLogsConfig.applicationLogs.azureTableStorage.level] Log + * level. Possible values include: 'Off', 'Verbose', 'Information', 'Warning', + * 'Error' + * + * @param {string} siteLogsConfig.applicationLogs.azureTableStorage.sasUrl SAS + * URL to an Azure table with add/query/delete permissions. + * + * @param {object} [siteLogsConfig.applicationLogs.azureBlobStorage] + * Application logs to blob storage configuration. + * + * @param {string} [siteLogsConfig.applicationLogs.azureBlobStorage.level] Log + * level. Possible values include: 'Off', 'Verbose', 'Information', 'Warning', + * 'Error' + * + * @param {string} [siteLogsConfig.applicationLogs.azureBlobStorage.sasUrl] SAS + * url to a azure blob container with read/write/list/delete permissions. + * + * @param {number} + * [siteLogsConfig.applicationLogs.azureBlobStorage.retentionInDays] Retention + * in days. + * Remove blobs older than X days. + * 0 or lower means no retention. + * + * @param {object} [siteLogsConfig.httpLogs] HTTP logs configuration. + * + * @param {object} [siteLogsConfig.httpLogs.fileSystem] Http logs to file + * system configuration. + * + * @param {number} [siteLogsConfig.httpLogs.fileSystem.retentionInMb] Maximum + * size in megabytes that http log files can use. + * When reached old log files will be removed to make space for new ones. + * Value can range between 25 and 100. + * + * @param {number} [siteLogsConfig.httpLogs.fileSystem.retentionInDays] + * Retention in days. + * Remove files older than X days. + * 0 or lower means no retention. + * + * @param {boolean} [siteLogsConfig.httpLogs.fileSystem.enabled] True if + * configuration is enabled, false if it is disabled and null if configuration + * is not set. + * + * @param {object} [siteLogsConfig.httpLogs.azureBlobStorage] Http logs to + * azure blob storage configuration. + * + * @param {string} [siteLogsConfig.httpLogs.azureBlobStorage.sasUrl] SAS url to + * a azure blob container with read/write/list/delete permissions. + * + * @param {number} [siteLogsConfig.httpLogs.azureBlobStorage.retentionInDays] + * Retention in days. + * Remove blobs older than X days. + * 0 or lower means no retention. + * + * @param {boolean} [siteLogsConfig.httpLogs.azureBlobStorage.enabled] True if + * configuration is enabled, false if it is disabled and null if configuration + * is not set. + * + * @param {object} [siteLogsConfig.failedRequestsTracing] Failed requests + * tracing configuration. + * + * @param {object} [siteLogsConfig.detailedErrorMessages] Detailed error + * messages configuration. + * + * @param {boolean} [siteLogsConfig.detailedErrorMessages.enabled] True if + * configuration is enabled, false if it is disabled and null if configuration + * is not set. + * + * @param {string} [siteLogsConfig.kind] Kind of resource. + * + * @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 {SiteLogsConfig} - 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. + * + * {SiteLogsConfig} [result] - The deserialized result object if an error did not occur. + * See {@link SiteLogsConfig} 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. + */ + updateDiagnosticLogsConfig(resourceGroupName: string, name: string, siteLogsConfig: models.SiteLogsConfig, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + updateDiagnosticLogsConfig(resourceGroupName: string, name: string, siteLogsConfig: models.SiteLogsConfig, callback: ServiceCallback): void; + updateDiagnosticLogsConfig(resourceGroupName: string, name: string, siteLogsConfig: models.SiteLogsConfig, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Replaces the metadata of an app. + * + * Replaces the metadata of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} metadata Edited metadata of the app or deployment slot. See + * example. + * + * @param {object} [metadata.properties] Settings. + * + * @param {string} [metadata.kind] Kind of resource. + * + * @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. + */ + updateMetadataWithHttpOperationResponse(resourceGroupName: string, name: string, metadata: models.StringDictionary, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Replaces the metadata of an app. + * + * Replaces the metadata of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} metadata Edited metadata of the app or deployment slot. See + * example. + * + * @param {object} [metadata.properties] Settings. + * + * @param {string} [metadata.kind] Kind of resource. + * + * @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 {StringDictionary} - 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. + * + * {StringDictionary} [result] - The deserialized result object if an error did not occur. + * See {@link StringDictionary} 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. + */ + updateMetadata(resourceGroupName: string, name: string, metadata: models.StringDictionary, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + updateMetadata(resourceGroupName: string, name: string, metadata: models.StringDictionary, callback: ServiceCallback): void; + updateMetadata(resourceGroupName: string, name: string, metadata: models.StringDictionary, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Gets the metadata of an app. + * + * Gets the metadata of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @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. + */ + listMetadataWithHttpOperationResponse(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets the metadata of an app. + * + * Gets the metadata of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @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 {StringDictionary} - 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. + * + * {StringDictionary} [result] - The deserialized result object if an error did not occur. + * See {@link StringDictionary} 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. + */ + listMetadata(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listMetadata(resourceGroupName: string, name: string, callback: ServiceCallback): void; + listMetadata(resourceGroupName: string, name: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Gets the Git/FTP publishing credentials of an app. + * + * Gets the Git/FTP publishing credentials of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @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. + */ + listPublishingCredentialsWithHttpOperationResponse(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets the Git/FTP publishing credentials of an app. + * + * Gets the Git/FTP publishing credentials of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @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 {User} - 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. + * + * {User} [result] - The deserialized result object if an error did not occur. + * See {@link User} 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. + */ + listPublishingCredentials(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listPublishingCredentials(resourceGroupName: string, name: string, callback: ServiceCallback): void; + listPublishingCredentials(resourceGroupName: string, name: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Updates the Push settings associated with web app. + * + * Updates the Push settings associated with web app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {object} pushSettings Push settings associated with web app. + * + * @param {boolean} pushSettings.isPushEnabled Gets or sets a flag indicating + * whether the Push endpoint is enabled. + * + * @param {string} [pushSettings.tagWhitelistJson] Gets or sets a JSON string + * containing a list of tags that are whitelisted for use by the push + * registration endpoint. + * + * @param {string} [pushSettings.tagsRequiringAuth] Gets or sets a JSON string + * containing a list of tags that require user authentication to be used in the + * push registration endpoint. + * Tags can consist of alphanumeric characters and the following: + * '_', '@', '#', '.', ':', '-'. + * Validation should be performed at the PushRequestHandler. + * + * @param {string} [pushSettings.dynamicTagsJson] Gets or sets a JSON string + * containing a list of dynamic tags that will be evaluated from user claims in + * the push registration endpoint. + * + * @param {string} [pushSettings.kind] Kind of resource. + * + * @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. + */ + updateSitePushSettingsWithHttpOperationResponse(resourceGroupName: string, name: string, pushSettings: models.PushSettings, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Updates the Push settings associated with web app. + * + * Updates the Push settings associated with web app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {object} pushSettings Push settings associated with web app. + * + * @param {boolean} pushSettings.isPushEnabled Gets or sets a flag indicating + * whether the Push endpoint is enabled. + * + * @param {string} [pushSettings.tagWhitelistJson] Gets or sets a JSON string + * containing a list of tags that are whitelisted for use by the push + * registration endpoint. + * + * @param {string} [pushSettings.tagsRequiringAuth] Gets or sets a JSON string + * containing a list of tags that require user authentication to be used in the + * push registration endpoint. + * Tags can consist of alphanumeric characters and the following: + * '_', '@', '#', '.', ':', '-'. + * Validation should be performed at the PushRequestHandler. + * + * @param {string} [pushSettings.dynamicTagsJson] Gets or sets a JSON string + * containing a list of dynamic tags that will be evaluated from user claims in + * the push registration endpoint. + * + * @param {string} [pushSettings.kind] Kind of resource. + * + * @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 {PushSettings} - 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. + * + * {PushSettings} [result] - The deserialized result object if an error did not occur. + * See {@link PushSettings} 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. + */ + updateSitePushSettings(resourceGroupName: string, name: string, pushSettings: models.PushSettings, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + updateSitePushSettings(resourceGroupName: string, name: string, pushSettings: models.PushSettings, callback: ServiceCallback): void; + updateSitePushSettings(resourceGroupName: string, name: string, pushSettings: models.PushSettings, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Gets the Push settings associated with web app. + * + * Gets the Push settings associated with web app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @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. + */ + listSitePushSettingsWithHttpOperationResponse(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets the Push settings associated with web app. + * + * Gets the Push settings associated with web app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @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 {PushSettings} - 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. + * + * {PushSettings} [result] - The deserialized result object if an error did not occur. + * See {@link PushSettings} 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. + */ + listSitePushSettings(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listSitePushSettings(resourceGroupName: string, name: string, callback: ServiceCallback): void; + listSitePushSettings(resourceGroupName: string, name: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Gets the names of app settings and connection strings that stick to + * the slot (not swapped). + * + * Gets the names of app settings and connection strings that stick to the slot + * (not swapped). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @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. + */ + listSlotConfigurationNamesWithHttpOperationResponse(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets the names of app settings and connection strings that stick to + * the slot (not swapped). + * + * Gets the names of app settings and connection strings that stick to the slot + * (not swapped). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @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 {SlotConfigNamesResource} - 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. + * + * {SlotConfigNamesResource} [result] - The deserialized result object if an error did not occur. + * See {@link SlotConfigNamesResource} 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. + */ + listSlotConfigurationNames(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listSlotConfigurationNames(resourceGroupName: string, name: string, callback: ServiceCallback): void; + listSlotConfigurationNames(resourceGroupName: string, name: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Updates the names of application settings and connection string + * that remain with the slot during swap operation. + * + * Updates the names of application settings and connection string that remain + * with the slot during swap operation. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} slotConfigNames Names of application settings and connection + * strings. See example. + * + * @param {array} [slotConfigNames.connectionStringNames] List of connection + * string names. + * + * @param {array} [slotConfigNames.appSettingNames] List of application + * settings names. + * + * @param {array} [slotConfigNames.azureStorageConfigNames] List of external + * Azure storage account identifiers. + * + * @param {string} [slotConfigNames.kind] Kind of resource. + * + * @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. + */ + updateSlotConfigurationNamesWithHttpOperationResponse(resourceGroupName: string, name: string, slotConfigNames: models.SlotConfigNamesResource, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Updates the names of application settings and connection string + * that remain with the slot during swap operation. + * + * Updates the names of application settings and connection string that remain + * with the slot during swap operation. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} slotConfigNames Names of application settings and connection + * strings. See example. + * + * @param {array} [slotConfigNames.connectionStringNames] List of connection + * string names. + * + * @param {array} [slotConfigNames.appSettingNames] List of application + * settings names. + * + * @param {array} [slotConfigNames.azureStorageConfigNames] List of external + * Azure storage account identifiers. + * + * @param {string} [slotConfigNames.kind] Kind of resource. + * + * @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 {SlotConfigNamesResource} - 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. + * + * {SlotConfigNamesResource} [result] - The deserialized result object if an error did not occur. + * See {@link SlotConfigNamesResource} 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. + */ + updateSlotConfigurationNames(resourceGroupName: string, name: string, slotConfigNames: models.SlotConfigNamesResource, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + updateSlotConfigurationNames(resourceGroupName: string, name: string, slotConfigNames: models.SlotConfigNamesResource, callback: ServiceCallback): void; + updateSlotConfigurationNames(resourceGroupName: string, name: string, slotConfigNames: models.SlotConfigNamesResource, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Gets a Swift Virtual Network connection. + * + * Gets a Swift Virtual Network connection. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @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. + */ + getSwiftVirtualNetworkConnectionWithHttpOperationResponse(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets a Swift Virtual Network connection. + * + * Gets a Swift Virtual Network connection. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @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 {SwiftVirtualNetwork} - 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. + * + * {SwiftVirtualNetwork} [result] - The deserialized result object if an error did not occur. + * See {@link SwiftVirtualNetwork} 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. + */ + getSwiftVirtualNetworkConnection(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getSwiftVirtualNetworkConnection(resourceGroupName: string, name: string, callback: ServiceCallback): void; + getSwiftVirtualNetworkConnection(resourceGroupName: string, name: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Integrates this Web App with a Virtual Network. This requires that + * 1) "swiftSupported" is true when doing a GET against this resource, and 2) + * that the target Subnet has already been delegated, and is not + * in use by another App Service Plan other than the one this App is in. + * + * Integrates this Web App with a Virtual Network. This requires that 1) + * "swiftSupported" is true when doing a GET against this resource, and 2) that + * the target Subnet has already been delegated, and is not + * in use by another App Service Plan other than the one this App is in. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} connectionEnvelope Properties of the Virtual Network + * connection. See example. + * + * @param {string} [connectionEnvelope.subnetResourceId] The Virtual Network + * subnet's resource ID. This is the subnet that this Web App will join. This + * subnet must have a delegation to Microsoft.Web/serverFarms defined first. + * + * @param {boolean} [connectionEnvelope.swiftSupported] A flag that specifies + * if the scale unit this Web App is on supports Swift integration. + * + * @param {string} [connectionEnvelope.kind] Kind of resource. + * + * @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. + */ + createOrUpdateSwiftVirtualNetworkConnectionWithHttpOperationResponse(resourceGroupName: string, name: string, connectionEnvelope: models.SwiftVirtualNetwork, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Integrates this Web App with a Virtual Network. This requires that + * 1) "swiftSupported" is true when doing a GET against this resource, and 2) + * that the target Subnet has already been delegated, and is not + * in use by another App Service Plan other than the one this App is in. + * + * Integrates this Web App with a Virtual Network. This requires that 1) + * "swiftSupported" is true when doing a GET against this resource, and 2) that + * the target Subnet has already been delegated, and is not + * in use by another App Service Plan other than the one this App is in. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} connectionEnvelope Properties of the Virtual Network + * connection. See example. + * + * @param {string} [connectionEnvelope.subnetResourceId] The Virtual Network + * subnet's resource ID. This is the subnet that this Web App will join. This + * subnet must have a delegation to Microsoft.Web/serverFarms defined first. + * + * @param {boolean} [connectionEnvelope.swiftSupported] A flag that specifies + * if the scale unit this Web App is on supports Swift integration. + * + * @param {string} [connectionEnvelope.kind] Kind of resource. + * + * @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 {SwiftVirtualNetwork} - 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. + * + * {SwiftVirtualNetwork} [result] - The deserialized result object if an error did not occur. + * See {@link SwiftVirtualNetwork} 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. + */ + createOrUpdateSwiftVirtualNetworkConnection(resourceGroupName: string, name: string, connectionEnvelope: models.SwiftVirtualNetwork, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdateSwiftVirtualNetworkConnection(resourceGroupName: string, name: string, connectionEnvelope: models.SwiftVirtualNetwork, callback: ServiceCallback): void; + createOrUpdateSwiftVirtualNetworkConnection(resourceGroupName: string, name: string, connectionEnvelope: models.SwiftVirtualNetwork, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Deletes a Swift Virtual Network connection from an app (or + * deployment slot). + * + * Deletes a Swift Virtual Network connection from an app (or deployment slot). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @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. + */ + deleteSwiftVirtualNetworkWithHttpOperationResponse(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Deletes a Swift Virtual Network connection from an app (or + * deployment slot). + * + * Deletes a Swift Virtual Network connection from an app (or deployment slot). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @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 {null} - 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. + * + * {null} [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. + */ + deleteSwiftVirtualNetwork(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteSwiftVirtualNetwork(resourceGroupName: string, name: string, callback: ServiceCallback): void; + deleteSwiftVirtualNetwork(resourceGroupName: string, name: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Integrates this Web App with a Virtual Network. This requires that + * 1) "swiftSupported" is true when doing a GET against this resource, and 2) + * that the target Subnet has already been delegated, and is not + * in use by another App Service Plan other than the one this App is in. + * + * Integrates this Web App with a Virtual Network. This requires that 1) + * "swiftSupported" is true when doing a GET against this resource, and 2) that + * the target Subnet has already been delegated, and is not + * in use by another App Service Plan other than the one this App is in. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} connectionEnvelope Properties of the Virtual Network + * connection. See example. + * + * @param {string} [connectionEnvelope.subnetResourceId] The Virtual Network + * subnet's resource ID. This is the subnet that this Web App will join. This + * subnet must have a delegation to Microsoft.Web/serverFarms defined first. + * + * @param {boolean} [connectionEnvelope.swiftSupported] A flag that specifies + * if the scale unit this Web App is on supports Swift integration. + * + * @param {string} [connectionEnvelope.kind] Kind of resource. + * + * @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. + */ + updateSwiftVirtualNetworkConnectionWithHttpOperationResponse(resourceGroupName: string, name: string, connectionEnvelope: models.SwiftVirtualNetwork, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Integrates this Web App with a Virtual Network. This requires that + * 1) "swiftSupported" is true when doing a GET against this resource, and 2) + * that the target Subnet has already been delegated, and is not + * in use by another App Service Plan other than the one this App is in. + * + * Integrates this Web App with a Virtual Network. This requires that 1) + * "swiftSupported" is true when doing a GET against this resource, and 2) that + * the target Subnet has already been delegated, and is not + * in use by another App Service Plan other than the one this App is in. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} connectionEnvelope Properties of the Virtual Network + * connection. See example. + * + * @param {string} [connectionEnvelope.subnetResourceId] The Virtual Network + * subnet's resource ID. This is the subnet that this Web App will join. This + * subnet must have a delegation to Microsoft.Web/serverFarms defined first. + * + * @param {boolean} [connectionEnvelope.swiftSupported] A flag that specifies + * if the scale unit this Web App is on supports Swift integration. + * + * @param {string} [connectionEnvelope.kind] Kind of resource. + * + * @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 {SwiftVirtualNetwork} - 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. + * + * {SwiftVirtualNetwork} [result] - The deserialized result object if an error did not occur. + * See {@link SwiftVirtualNetwork} 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. + */ + updateSwiftVirtualNetworkConnection(resourceGroupName: string, name: string, connectionEnvelope: models.SwiftVirtualNetwork, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + updateSwiftVirtualNetworkConnection(resourceGroupName: string, name: string, connectionEnvelope: models.SwiftVirtualNetwork, callback: ServiceCallback): void; + updateSwiftVirtualNetworkConnection(resourceGroupName: string, name: string, connectionEnvelope: models.SwiftVirtualNetwork, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Gets the configuration of an app, such as platform version and + * bitness, default documents, virtual applications, Always On, etc. + * + * Gets the configuration of an app, such as platform version and bitness, + * default documents, virtual applications, Always On, etc. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @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. + */ + getConfigurationWithHttpOperationResponse(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets the configuration of an app, such as platform version and + * bitness, default documents, virtual applications, Always On, etc. + * + * Gets the configuration of an app, such as platform version and bitness, + * default documents, virtual applications, Always On, etc. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @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 {SiteConfigResource} - 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. + * + * {SiteConfigResource} [result] - The deserialized result object if an error did not occur. + * See {@link SiteConfigResource} 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. + */ + getConfiguration(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getConfiguration(resourceGroupName: string, name: string, callback: ServiceCallback): void; + getConfiguration(resourceGroupName: string, name: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Updates the configuration of an app. + * + * Updates the configuration of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} siteConfig JSON representation of a SiteConfig object. See + * example. + * + * @param {number} [siteConfig.numberOfWorkers] Number of workers. + * + * @param {array} [siteConfig.defaultDocuments] Default documents. + * + * @param {string} [siteConfig.netFrameworkVersion] .NET Framework version. + * + * @param {string} [siteConfig.phpVersion] Version of PHP. + * + * @param {string} [siteConfig.pythonVersion] Version of Python. + * + * @param {string} [siteConfig.nodeVersion] Version of Node.js. + * + * @param {string} [siteConfig.linuxFxVersion] Linux App Framework and version + * + * @param {string} [siteConfig.windowsFxVersion] Xenon App Framework and + * version + * + * @param {boolean} [siteConfig.requestTracingEnabled] true if + * request tracing is enabled; otherwise, false. + * + * @param {date} [siteConfig.requestTracingExpirationTime] Request tracing + * expiration time. + * + * @param {boolean} [siteConfig.remoteDebuggingEnabled] true if + * remote debugging is enabled; otherwise, false. + * + * @param {string} [siteConfig.remoteDebuggingVersion] Remote debugging + * version. + * + * @param {boolean} [siteConfig.httpLoggingEnabled] true if HTTP + * logging is enabled; otherwise, false. + * + * @param {number} [siteConfig.logsDirectorySizeLimit] HTTP logs directory size + * limit. + * + * @param {boolean} [siteConfig.detailedErrorLoggingEnabled] true + * if detailed error logging is enabled; otherwise, false. + * + * @param {string} [siteConfig.publishingUsername] Publishing user name. + * + * @param {array} [siteConfig.appSettings] Application settings. + * + * @param {object} [siteConfig.azureStorageAccounts] User-provided Azure + * storage accounts. + * + * @param {array} [siteConfig.connectionStrings] Connection strings. + * + * @param {array} [siteConfig.handlerMappings] Handler mappings. + * + * @param {string} [siteConfig.documentRoot] Document root. + * + * @param {string} [siteConfig.scmType] SCM type. Possible values include: + * 'None', 'Dropbox', 'Tfs', 'LocalGit', 'GitHub', 'CodePlexGit', 'CodePlexHg', + * 'BitbucketGit', 'BitbucketHg', 'ExternalGit', 'ExternalHg', 'OneDrive', + * 'VSO' + * + * @param {boolean} [siteConfig.use32BitWorkerProcess] true to use + * 32-bit worker process; otherwise, false. + * + * @param {boolean} [siteConfig.webSocketsEnabled] true if + * WebSocket is enabled; otherwise, false. + * + * @param {boolean} [siteConfig.alwaysOn] true if Always On is + * enabled; otherwise, false. + * + * @param {string} [siteConfig.javaVersion] Java version. + * + * @param {string} [siteConfig.javaContainer] Java container. + * + * @param {string} [siteConfig.javaContainerVersion] Java container version. + * + * @param {string} [siteConfig.appCommandLine] App command line to launch. + * + * @param {string} [siteConfig.managedPipelineMode] Managed pipeline mode. + * Possible values include: 'Integrated', 'Classic' + * + * @param {array} [siteConfig.virtualApplications] Virtual applications. + * + * @param {string} [siteConfig.loadBalancing] Site load balancing. Possible + * values include: 'WeightedRoundRobin', 'LeastRequests', 'LeastResponseTime', + * 'WeightedTotalTraffic', 'RequestHash' + * + * @param {object} [siteConfig.experiments] This is work around for polymophic + * types. + * + * @param {array} [siteConfig.experiments.rampUpRules] List of ramp-up rules. + * + * @param {object} [siteConfig.limits] Site limits. + * + * @param {number} [siteConfig.limits.maxPercentageCpu] Maximum allowed CPU + * usage percentage. + * + * @param {number} [siteConfig.limits.maxMemoryInMb] Maximum allowed memory + * usage in MB. + * + * @param {number} [siteConfig.limits.maxDiskSizeInMb] Maximum allowed disk + * size usage in MB. + * + * @param {boolean} [siteConfig.autoHealEnabled] true if Auto Heal + * is enabled; otherwise, false. + * + * @param {object} [siteConfig.autoHealRules] Auto Heal rules. + * + * @param {object} [siteConfig.autoHealRules.triggers] Conditions that describe + * when to execute the auto-heal actions. + * + * @param {object} [siteConfig.autoHealRules.triggers.requests] A rule based on + * total requests. + * + * @param {number} [siteConfig.autoHealRules.triggers.requests.count] Request + * Count. + * + * @param {string} [siteConfig.autoHealRules.triggers.requests.timeInterval] + * Time interval. + * + * @param {number} [siteConfig.autoHealRules.triggers.privateBytesInKB] A rule + * based on private bytes. + * + * @param {array} [siteConfig.autoHealRules.triggers.statusCodes] A rule based + * on status codes. + * + * @param {object} [siteConfig.autoHealRules.triggers.slowRequests] A rule + * based on request execution time. + * + * @param {string} [siteConfig.autoHealRules.triggers.slowRequests.timeTaken] + * Time taken. + * + * @param {number} [siteConfig.autoHealRules.triggers.slowRequests.count] + * Request Count. + * + * @param {string} + * [siteConfig.autoHealRules.triggers.slowRequests.timeInterval] Time interval. + * + * @param {object} [siteConfig.autoHealRules.actions] Actions to be executed + * when a rule is triggered. + * + * @param {string} [siteConfig.autoHealRules.actions.actionType] Predefined + * action to be taken. Possible values include: 'Recycle', 'LogEvent', + * 'CustomAction' + * + * @param {object} [siteConfig.autoHealRules.actions.customAction] Custom + * action to be taken. + * + * @param {string} [siteConfig.autoHealRules.actions.customAction.exe] + * Executable to be run. + * + * @param {string} [siteConfig.autoHealRules.actions.customAction.parameters] + * Parameters for the executable. + * + * @param {string} [siteConfig.autoHealRules.actions.minProcessExecutionTime] + * Minimum time the process must execute + * before taking the action + * + * @param {string} [siteConfig.tracingOptions] Tracing options. + * + * @param {string} [siteConfig.vnetName] Virtual Network name. + * + * @param {object} [siteConfig.cors] Cross-Origin Resource Sharing (CORS) + * settings. + * + * @param {array} [siteConfig.cors.allowedOrigins] Gets or sets the list of + * origins that should be allowed to make cross-origin + * calls (for example: http://example.com:12345). Use "*" to allow all. + * + * @param {object} [siteConfig.push] Push endpoint settings. + * + * @param {boolean} siteConfig.push.isPushEnabled Gets or sets a flag + * indicating whether the Push endpoint is enabled. + * + * @param {string} [siteConfig.push.tagWhitelistJson] Gets or sets a JSON + * string containing a list of tags that are whitelisted for use by the push + * registration endpoint. + * + * @param {string} [siteConfig.push.tagsRequiringAuth] Gets or sets a JSON + * string containing a list of tags that require user authentication to be used + * in the push registration endpoint. + * Tags can consist of alphanumeric characters and the following: + * '_', '@', '#', '.', ':', '-'. + * Validation should be performed at the PushRequestHandler. + * + * @param {string} [siteConfig.push.dynamicTagsJson] Gets or sets a JSON string + * containing a list of dynamic tags that will be evaluated from user claims in + * the push registration endpoint. + * + * @param {string} [siteConfig.push.kind] Kind of resource. + * + * @param {object} [siteConfig.apiDefinition] Information about the formal API + * definition for the app. + * + * @param {string} [siteConfig.apiDefinition.url] The URL of the API + * definition. + * + * @param {string} [siteConfig.autoSwapSlotName] Auto-swap slot name. + * + * @param {boolean} [siteConfig.localMySqlEnabled] true to enable + * local MySQL; otherwise, false. + * + * @param {number} [siteConfig.managedServiceIdentityId] Managed Service + * Identity Id + * + * @param {number} [siteConfig.xManagedServiceIdentityId] Explicit Managed + * Service Identity Id + * + * @param {array} [siteConfig.ipSecurityRestrictions] IP security restrictions. + * + * @param {boolean} [siteConfig.http20Enabled] Http20Enabled: configures a web + * site to allow clients to connect over http2.0 + * + * @param {string} [siteConfig.minTlsVersion] MinTlsVersion: configures the + * minimum version of TLS required for SSL requests. Possible values include: + * '1.0', '1.1', '1.2' + * + * @param {string} [siteConfig.ftpsState] State of FTP / FTPS service. Possible + * values include: 'AllAllowed', 'FtpsOnly', 'Disabled' + * + * @param {number} [siteConfig.reservedInstanceCount] Number of reserved + * instances. + * This setting only applies to the Consumption Plan + * + * @param {string} [siteConfig.kind] Kind of resource. + * + * @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. + */ + createOrUpdateConfigurationWithHttpOperationResponse(resourceGroupName: string, name: string, siteConfig: models.SiteConfigResource, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Updates the configuration of an app. + * + * Updates the configuration of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} siteConfig JSON representation of a SiteConfig object. See + * example. + * + * @param {number} [siteConfig.numberOfWorkers] Number of workers. + * + * @param {array} [siteConfig.defaultDocuments] Default documents. + * + * @param {string} [siteConfig.netFrameworkVersion] .NET Framework version. + * + * @param {string} [siteConfig.phpVersion] Version of PHP. + * + * @param {string} [siteConfig.pythonVersion] Version of Python. + * + * @param {string} [siteConfig.nodeVersion] Version of Node.js. + * + * @param {string} [siteConfig.linuxFxVersion] Linux App Framework and version + * + * @param {string} [siteConfig.windowsFxVersion] Xenon App Framework and + * version + * + * @param {boolean} [siteConfig.requestTracingEnabled] true if + * request tracing is enabled; otherwise, false. + * + * @param {date} [siteConfig.requestTracingExpirationTime] Request tracing + * expiration time. + * + * @param {boolean} [siteConfig.remoteDebuggingEnabled] true if + * remote debugging is enabled; otherwise, false. + * + * @param {string} [siteConfig.remoteDebuggingVersion] Remote debugging + * version. + * + * @param {boolean} [siteConfig.httpLoggingEnabled] true if HTTP + * logging is enabled; otherwise, false. + * + * @param {number} [siteConfig.logsDirectorySizeLimit] HTTP logs directory size + * limit. + * + * @param {boolean} [siteConfig.detailedErrorLoggingEnabled] true + * if detailed error logging is enabled; otherwise, false. + * + * @param {string} [siteConfig.publishingUsername] Publishing user name. + * + * @param {array} [siteConfig.appSettings] Application settings. + * + * @param {object} [siteConfig.azureStorageAccounts] User-provided Azure + * storage accounts. + * + * @param {array} [siteConfig.connectionStrings] Connection strings. + * + * @param {array} [siteConfig.handlerMappings] Handler mappings. + * + * @param {string} [siteConfig.documentRoot] Document root. + * + * @param {string} [siteConfig.scmType] SCM type. Possible values include: + * 'None', 'Dropbox', 'Tfs', 'LocalGit', 'GitHub', 'CodePlexGit', 'CodePlexHg', + * 'BitbucketGit', 'BitbucketHg', 'ExternalGit', 'ExternalHg', 'OneDrive', + * 'VSO' + * + * @param {boolean} [siteConfig.use32BitWorkerProcess] true to use + * 32-bit worker process; otherwise, false. + * + * @param {boolean} [siteConfig.webSocketsEnabled] true if + * WebSocket is enabled; otherwise, false. + * + * @param {boolean} [siteConfig.alwaysOn] true if Always On is + * enabled; otherwise, false. + * + * @param {string} [siteConfig.javaVersion] Java version. + * + * @param {string} [siteConfig.javaContainer] Java container. + * + * @param {string} [siteConfig.javaContainerVersion] Java container version. + * + * @param {string} [siteConfig.appCommandLine] App command line to launch. + * + * @param {string} [siteConfig.managedPipelineMode] Managed pipeline mode. + * Possible values include: 'Integrated', 'Classic' + * + * @param {array} [siteConfig.virtualApplications] Virtual applications. + * + * @param {string} [siteConfig.loadBalancing] Site load balancing. Possible + * values include: 'WeightedRoundRobin', 'LeastRequests', 'LeastResponseTime', + * 'WeightedTotalTraffic', 'RequestHash' + * + * @param {object} [siteConfig.experiments] This is work around for polymophic + * types. + * + * @param {array} [siteConfig.experiments.rampUpRules] List of ramp-up rules. + * + * @param {object} [siteConfig.limits] Site limits. + * + * @param {number} [siteConfig.limits.maxPercentageCpu] Maximum allowed CPU + * usage percentage. + * + * @param {number} [siteConfig.limits.maxMemoryInMb] Maximum allowed memory + * usage in MB. + * + * @param {number} [siteConfig.limits.maxDiskSizeInMb] Maximum allowed disk + * size usage in MB. + * + * @param {boolean} [siteConfig.autoHealEnabled] true if Auto Heal + * is enabled; otherwise, false. + * + * @param {object} [siteConfig.autoHealRules] Auto Heal rules. + * + * @param {object} [siteConfig.autoHealRules.triggers] Conditions that describe + * when to execute the auto-heal actions. + * + * @param {object} [siteConfig.autoHealRules.triggers.requests] A rule based on + * total requests. + * + * @param {number} [siteConfig.autoHealRules.triggers.requests.count] Request + * Count. + * + * @param {string} [siteConfig.autoHealRules.triggers.requests.timeInterval] + * Time interval. + * + * @param {number} [siteConfig.autoHealRules.triggers.privateBytesInKB] A rule + * based on private bytes. + * + * @param {array} [siteConfig.autoHealRules.triggers.statusCodes] A rule based + * on status codes. + * + * @param {object} [siteConfig.autoHealRules.triggers.slowRequests] A rule + * based on request execution time. + * + * @param {string} [siteConfig.autoHealRules.triggers.slowRequests.timeTaken] + * Time taken. + * + * @param {number} [siteConfig.autoHealRules.triggers.slowRequests.count] + * Request Count. + * + * @param {string} + * [siteConfig.autoHealRules.triggers.slowRequests.timeInterval] Time interval. + * + * @param {object} [siteConfig.autoHealRules.actions] Actions to be executed + * when a rule is triggered. + * + * @param {string} [siteConfig.autoHealRules.actions.actionType] Predefined + * action to be taken. Possible values include: 'Recycle', 'LogEvent', + * 'CustomAction' + * + * @param {object} [siteConfig.autoHealRules.actions.customAction] Custom + * action to be taken. + * + * @param {string} [siteConfig.autoHealRules.actions.customAction.exe] + * Executable to be run. + * + * @param {string} [siteConfig.autoHealRules.actions.customAction.parameters] + * Parameters for the executable. + * + * @param {string} [siteConfig.autoHealRules.actions.minProcessExecutionTime] + * Minimum time the process must execute + * before taking the action + * + * @param {string} [siteConfig.tracingOptions] Tracing options. + * + * @param {string} [siteConfig.vnetName] Virtual Network name. + * + * @param {object} [siteConfig.cors] Cross-Origin Resource Sharing (CORS) + * settings. + * + * @param {array} [siteConfig.cors.allowedOrigins] Gets or sets the list of + * origins that should be allowed to make cross-origin + * calls (for example: http://example.com:12345). Use "*" to allow all. + * + * @param {object} [siteConfig.push] Push endpoint settings. + * + * @param {boolean} siteConfig.push.isPushEnabled Gets or sets a flag + * indicating whether the Push endpoint is enabled. + * + * @param {string} [siteConfig.push.tagWhitelistJson] Gets or sets a JSON + * string containing a list of tags that are whitelisted for use by the push + * registration endpoint. + * + * @param {string} [siteConfig.push.tagsRequiringAuth] Gets or sets a JSON + * string containing a list of tags that require user authentication to be used + * in the push registration endpoint. + * Tags can consist of alphanumeric characters and the following: + * '_', '@', '#', '.', ':', '-'. + * Validation should be performed at the PushRequestHandler. + * + * @param {string} [siteConfig.push.dynamicTagsJson] Gets or sets a JSON string + * containing a list of dynamic tags that will be evaluated from user claims in + * the push registration endpoint. + * + * @param {string} [siteConfig.push.kind] Kind of resource. + * + * @param {object} [siteConfig.apiDefinition] Information about the formal API + * definition for the app. + * + * @param {string} [siteConfig.apiDefinition.url] The URL of the API + * definition. + * + * @param {string} [siteConfig.autoSwapSlotName] Auto-swap slot name. + * + * @param {boolean} [siteConfig.localMySqlEnabled] true to enable + * local MySQL; otherwise, false. + * + * @param {number} [siteConfig.managedServiceIdentityId] Managed Service + * Identity Id + * + * @param {number} [siteConfig.xManagedServiceIdentityId] Explicit Managed + * Service Identity Id + * + * @param {array} [siteConfig.ipSecurityRestrictions] IP security restrictions. + * + * @param {boolean} [siteConfig.http20Enabled] Http20Enabled: configures a web + * site to allow clients to connect over http2.0 + * + * @param {string} [siteConfig.minTlsVersion] MinTlsVersion: configures the + * minimum version of TLS required for SSL requests. Possible values include: + * '1.0', '1.1', '1.2' + * + * @param {string} [siteConfig.ftpsState] State of FTP / FTPS service. Possible + * values include: 'AllAllowed', 'FtpsOnly', 'Disabled' + * + * @param {number} [siteConfig.reservedInstanceCount] Number of reserved + * instances. + * This setting only applies to the Consumption Plan + * + * @param {string} [siteConfig.kind] Kind of resource. + * + * @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 {SiteConfigResource} - 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. + * + * {SiteConfigResource} [result] - The deserialized result object if an error did not occur. + * See {@link SiteConfigResource} 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. + */ + createOrUpdateConfiguration(resourceGroupName: string, name: string, siteConfig: models.SiteConfigResource, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdateConfiguration(resourceGroupName: string, name: string, siteConfig: models.SiteConfigResource, callback: ServiceCallback): void; + createOrUpdateConfiguration(resourceGroupName: string, name: string, siteConfig: models.SiteConfigResource, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Updates the configuration of an app. + * + * Updates the configuration of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} siteConfig JSON representation of a SiteConfig object. See + * example. + * + * @param {number} [siteConfig.numberOfWorkers] Number of workers. + * + * @param {array} [siteConfig.defaultDocuments] Default documents. + * + * @param {string} [siteConfig.netFrameworkVersion] .NET Framework version. + * + * @param {string} [siteConfig.phpVersion] Version of PHP. + * + * @param {string} [siteConfig.pythonVersion] Version of Python. + * + * @param {string} [siteConfig.nodeVersion] Version of Node.js. + * + * @param {string} [siteConfig.linuxFxVersion] Linux App Framework and version + * + * @param {string} [siteConfig.windowsFxVersion] Xenon App Framework and + * version + * + * @param {boolean} [siteConfig.requestTracingEnabled] true if + * request tracing is enabled; otherwise, false. + * + * @param {date} [siteConfig.requestTracingExpirationTime] Request tracing + * expiration time. + * + * @param {boolean} [siteConfig.remoteDebuggingEnabled] true if + * remote debugging is enabled; otherwise, false. + * + * @param {string} [siteConfig.remoteDebuggingVersion] Remote debugging + * version. + * + * @param {boolean} [siteConfig.httpLoggingEnabled] true if HTTP + * logging is enabled; otherwise, false. + * + * @param {number} [siteConfig.logsDirectorySizeLimit] HTTP logs directory size + * limit. + * + * @param {boolean} [siteConfig.detailedErrorLoggingEnabled] true + * if detailed error logging is enabled; otherwise, false. + * + * @param {string} [siteConfig.publishingUsername] Publishing user name. + * + * @param {array} [siteConfig.appSettings] Application settings. + * + * @param {object} [siteConfig.azureStorageAccounts] User-provided Azure + * storage accounts. + * + * @param {array} [siteConfig.connectionStrings] Connection strings. + * + * @param {array} [siteConfig.handlerMappings] Handler mappings. + * + * @param {string} [siteConfig.documentRoot] Document root. + * + * @param {string} [siteConfig.scmType] SCM type. Possible values include: + * 'None', 'Dropbox', 'Tfs', 'LocalGit', 'GitHub', 'CodePlexGit', 'CodePlexHg', + * 'BitbucketGit', 'BitbucketHg', 'ExternalGit', 'ExternalHg', 'OneDrive', + * 'VSO' + * + * @param {boolean} [siteConfig.use32BitWorkerProcess] true to use + * 32-bit worker process; otherwise, false. + * + * @param {boolean} [siteConfig.webSocketsEnabled] true if + * WebSocket is enabled; otherwise, false. + * + * @param {boolean} [siteConfig.alwaysOn] true if Always On is + * enabled; otherwise, false. + * + * @param {string} [siteConfig.javaVersion] Java version. + * + * @param {string} [siteConfig.javaContainer] Java container. + * + * @param {string} [siteConfig.javaContainerVersion] Java container version. + * + * @param {string} [siteConfig.appCommandLine] App command line to launch. + * + * @param {string} [siteConfig.managedPipelineMode] Managed pipeline mode. + * Possible values include: 'Integrated', 'Classic' + * + * @param {array} [siteConfig.virtualApplications] Virtual applications. + * + * @param {string} [siteConfig.loadBalancing] Site load balancing. Possible + * values include: 'WeightedRoundRobin', 'LeastRequests', 'LeastResponseTime', + * 'WeightedTotalTraffic', 'RequestHash' + * + * @param {object} [siteConfig.experiments] This is work around for polymophic + * types. + * + * @param {array} [siteConfig.experiments.rampUpRules] List of ramp-up rules. + * + * @param {object} [siteConfig.limits] Site limits. + * + * @param {number} [siteConfig.limits.maxPercentageCpu] Maximum allowed CPU + * usage percentage. + * + * @param {number} [siteConfig.limits.maxMemoryInMb] Maximum allowed memory + * usage in MB. + * + * @param {number} [siteConfig.limits.maxDiskSizeInMb] Maximum allowed disk + * size usage in MB. + * + * @param {boolean} [siteConfig.autoHealEnabled] true if Auto Heal + * is enabled; otherwise, false. + * + * @param {object} [siteConfig.autoHealRules] Auto Heal rules. + * + * @param {object} [siteConfig.autoHealRules.triggers] Conditions that describe + * when to execute the auto-heal actions. + * + * @param {object} [siteConfig.autoHealRules.triggers.requests] A rule based on + * total requests. + * + * @param {number} [siteConfig.autoHealRules.triggers.requests.count] Request + * Count. + * + * @param {string} [siteConfig.autoHealRules.triggers.requests.timeInterval] + * Time interval. + * + * @param {number} [siteConfig.autoHealRules.triggers.privateBytesInKB] A rule + * based on private bytes. + * + * @param {array} [siteConfig.autoHealRules.triggers.statusCodes] A rule based + * on status codes. + * + * @param {object} [siteConfig.autoHealRules.triggers.slowRequests] A rule + * based on request execution time. + * + * @param {string} [siteConfig.autoHealRules.triggers.slowRequests.timeTaken] + * Time taken. + * + * @param {number} [siteConfig.autoHealRules.triggers.slowRequests.count] + * Request Count. + * + * @param {string} + * [siteConfig.autoHealRules.triggers.slowRequests.timeInterval] Time interval. + * + * @param {object} [siteConfig.autoHealRules.actions] Actions to be executed + * when a rule is triggered. + * + * @param {string} [siteConfig.autoHealRules.actions.actionType] Predefined + * action to be taken. Possible values include: 'Recycle', 'LogEvent', + * 'CustomAction' + * + * @param {object} [siteConfig.autoHealRules.actions.customAction] Custom + * action to be taken. + * + * @param {string} [siteConfig.autoHealRules.actions.customAction.exe] + * Executable to be run. + * + * @param {string} [siteConfig.autoHealRules.actions.customAction.parameters] + * Parameters for the executable. + * + * @param {string} [siteConfig.autoHealRules.actions.minProcessExecutionTime] + * Minimum time the process must execute + * before taking the action + * + * @param {string} [siteConfig.tracingOptions] Tracing options. + * + * @param {string} [siteConfig.vnetName] Virtual Network name. + * + * @param {object} [siteConfig.cors] Cross-Origin Resource Sharing (CORS) + * settings. + * + * @param {array} [siteConfig.cors.allowedOrigins] Gets or sets the list of + * origins that should be allowed to make cross-origin + * calls (for example: http://example.com:12345). Use "*" to allow all. + * + * @param {object} [siteConfig.push] Push endpoint settings. + * + * @param {boolean} siteConfig.push.isPushEnabled Gets or sets a flag + * indicating whether the Push endpoint is enabled. + * + * @param {string} [siteConfig.push.tagWhitelistJson] Gets or sets a JSON + * string containing a list of tags that are whitelisted for use by the push + * registration endpoint. + * + * @param {string} [siteConfig.push.tagsRequiringAuth] Gets or sets a JSON + * string containing a list of tags that require user authentication to be used + * in the push registration endpoint. + * Tags can consist of alphanumeric characters and the following: + * '_', '@', '#', '.', ':', '-'. + * Validation should be performed at the PushRequestHandler. + * + * @param {string} [siteConfig.push.dynamicTagsJson] Gets or sets a JSON string + * containing a list of dynamic tags that will be evaluated from user claims in + * the push registration endpoint. + * + * @param {string} [siteConfig.push.kind] Kind of resource. + * + * @param {object} [siteConfig.apiDefinition] Information about the formal API + * definition for the app. + * + * @param {string} [siteConfig.apiDefinition.url] The URL of the API + * definition. + * + * @param {string} [siteConfig.autoSwapSlotName] Auto-swap slot name. + * + * @param {boolean} [siteConfig.localMySqlEnabled] true to enable + * local MySQL; otherwise, false. + * + * @param {number} [siteConfig.managedServiceIdentityId] Managed Service + * Identity Id + * + * @param {number} [siteConfig.xManagedServiceIdentityId] Explicit Managed + * Service Identity Id + * + * @param {array} [siteConfig.ipSecurityRestrictions] IP security restrictions. + * + * @param {boolean} [siteConfig.http20Enabled] Http20Enabled: configures a web + * site to allow clients to connect over http2.0 + * + * @param {string} [siteConfig.minTlsVersion] MinTlsVersion: configures the + * minimum version of TLS required for SSL requests. Possible values include: + * '1.0', '1.1', '1.2' + * + * @param {string} [siteConfig.ftpsState] State of FTP / FTPS service. Possible + * values include: 'AllAllowed', 'FtpsOnly', 'Disabled' + * + * @param {number} [siteConfig.reservedInstanceCount] Number of reserved + * instances. + * This setting only applies to the Consumption Plan + * + * @param {string} [siteConfig.kind] Kind of resource. + * + * @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. + */ + updateConfigurationWithHttpOperationResponse(resourceGroupName: string, name: string, siteConfig: models.SiteConfigResource, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Updates the configuration of an app. + * + * Updates the configuration of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} siteConfig JSON representation of a SiteConfig object. See + * example. + * + * @param {number} [siteConfig.numberOfWorkers] Number of workers. + * + * @param {array} [siteConfig.defaultDocuments] Default documents. + * + * @param {string} [siteConfig.netFrameworkVersion] .NET Framework version. + * + * @param {string} [siteConfig.phpVersion] Version of PHP. + * + * @param {string} [siteConfig.pythonVersion] Version of Python. + * + * @param {string} [siteConfig.nodeVersion] Version of Node.js. + * + * @param {string} [siteConfig.linuxFxVersion] Linux App Framework and version + * + * @param {string} [siteConfig.windowsFxVersion] Xenon App Framework and + * version + * + * @param {boolean} [siteConfig.requestTracingEnabled] true if + * request tracing is enabled; otherwise, false. + * + * @param {date} [siteConfig.requestTracingExpirationTime] Request tracing + * expiration time. + * + * @param {boolean} [siteConfig.remoteDebuggingEnabled] true if + * remote debugging is enabled; otherwise, false. + * + * @param {string} [siteConfig.remoteDebuggingVersion] Remote debugging + * version. + * + * @param {boolean} [siteConfig.httpLoggingEnabled] true if HTTP + * logging is enabled; otherwise, false. + * + * @param {number} [siteConfig.logsDirectorySizeLimit] HTTP logs directory size + * limit. + * + * @param {boolean} [siteConfig.detailedErrorLoggingEnabled] true + * if detailed error logging is enabled; otherwise, false. + * + * @param {string} [siteConfig.publishingUsername] Publishing user name. + * + * @param {array} [siteConfig.appSettings] Application settings. + * + * @param {object} [siteConfig.azureStorageAccounts] User-provided Azure + * storage accounts. + * + * @param {array} [siteConfig.connectionStrings] Connection strings. + * + * @param {array} [siteConfig.handlerMappings] Handler mappings. + * + * @param {string} [siteConfig.documentRoot] Document root. + * + * @param {string} [siteConfig.scmType] SCM type. Possible values include: + * 'None', 'Dropbox', 'Tfs', 'LocalGit', 'GitHub', 'CodePlexGit', 'CodePlexHg', + * 'BitbucketGit', 'BitbucketHg', 'ExternalGit', 'ExternalHg', 'OneDrive', + * 'VSO' + * + * @param {boolean} [siteConfig.use32BitWorkerProcess] true to use + * 32-bit worker process; otherwise, false. + * + * @param {boolean} [siteConfig.webSocketsEnabled] true if + * WebSocket is enabled; otherwise, false. + * + * @param {boolean} [siteConfig.alwaysOn] true if Always On is + * enabled; otherwise, false. + * + * @param {string} [siteConfig.javaVersion] Java version. + * + * @param {string} [siteConfig.javaContainer] Java container. + * + * @param {string} [siteConfig.javaContainerVersion] Java container version. + * + * @param {string} [siteConfig.appCommandLine] App command line to launch. + * + * @param {string} [siteConfig.managedPipelineMode] Managed pipeline mode. + * Possible values include: 'Integrated', 'Classic' + * + * @param {array} [siteConfig.virtualApplications] Virtual applications. + * + * @param {string} [siteConfig.loadBalancing] Site load balancing. Possible + * values include: 'WeightedRoundRobin', 'LeastRequests', 'LeastResponseTime', + * 'WeightedTotalTraffic', 'RequestHash' + * + * @param {object} [siteConfig.experiments] This is work around for polymophic + * types. + * + * @param {array} [siteConfig.experiments.rampUpRules] List of ramp-up rules. + * + * @param {object} [siteConfig.limits] Site limits. + * + * @param {number} [siteConfig.limits.maxPercentageCpu] Maximum allowed CPU + * usage percentage. + * + * @param {number} [siteConfig.limits.maxMemoryInMb] Maximum allowed memory + * usage in MB. + * + * @param {number} [siteConfig.limits.maxDiskSizeInMb] Maximum allowed disk + * size usage in MB. + * + * @param {boolean} [siteConfig.autoHealEnabled] true if Auto Heal + * is enabled; otherwise, false. + * + * @param {object} [siteConfig.autoHealRules] Auto Heal rules. + * + * @param {object} [siteConfig.autoHealRules.triggers] Conditions that describe + * when to execute the auto-heal actions. + * + * @param {object} [siteConfig.autoHealRules.triggers.requests] A rule based on + * total requests. + * + * @param {number} [siteConfig.autoHealRules.triggers.requests.count] Request + * Count. + * + * @param {string} [siteConfig.autoHealRules.triggers.requests.timeInterval] + * Time interval. + * + * @param {number} [siteConfig.autoHealRules.triggers.privateBytesInKB] A rule + * based on private bytes. + * + * @param {array} [siteConfig.autoHealRules.triggers.statusCodes] A rule based + * on status codes. + * + * @param {object} [siteConfig.autoHealRules.triggers.slowRequests] A rule + * based on request execution time. + * + * @param {string} [siteConfig.autoHealRules.triggers.slowRequests.timeTaken] + * Time taken. + * + * @param {number} [siteConfig.autoHealRules.triggers.slowRequests.count] + * Request Count. + * + * @param {string} + * [siteConfig.autoHealRules.triggers.slowRequests.timeInterval] Time interval. + * + * @param {object} [siteConfig.autoHealRules.actions] Actions to be executed + * when a rule is triggered. + * + * @param {string} [siteConfig.autoHealRules.actions.actionType] Predefined + * action to be taken. Possible values include: 'Recycle', 'LogEvent', + * 'CustomAction' + * + * @param {object} [siteConfig.autoHealRules.actions.customAction] Custom + * action to be taken. + * + * @param {string} [siteConfig.autoHealRules.actions.customAction.exe] + * Executable to be run. + * + * @param {string} [siteConfig.autoHealRules.actions.customAction.parameters] + * Parameters for the executable. + * + * @param {string} [siteConfig.autoHealRules.actions.minProcessExecutionTime] + * Minimum time the process must execute + * before taking the action + * + * @param {string} [siteConfig.tracingOptions] Tracing options. + * + * @param {string} [siteConfig.vnetName] Virtual Network name. + * + * @param {object} [siteConfig.cors] Cross-Origin Resource Sharing (CORS) + * settings. + * + * @param {array} [siteConfig.cors.allowedOrigins] Gets or sets the list of + * origins that should be allowed to make cross-origin + * calls (for example: http://example.com:12345). Use "*" to allow all. + * + * @param {object} [siteConfig.push] Push endpoint settings. + * + * @param {boolean} siteConfig.push.isPushEnabled Gets or sets a flag + * indicating whether the Push endpoint is enabled. + * + * @param {string} [siteConfig.push.tagWhitelistJson] Gets or sets a JSON + * string containing a list of tags that are whitelisted for use by the push + * registration endpoint. + * + * @param {string} [siteConfig.push.tagsRequiringAuth] Gets or sets a JSON + * string containing a list of tags that require user authentication to be used + * in the push registration endpoint. + * Tags can consist of alphanumeric characters and the following: + * '_', '@', '#', '.', ':', '-'. + * Validation should be performed at the PushRequestHandler. + * + * @param {string} [siteConfig.push.dynamicTagsJson] Gets or sets a JSON string + * containing a list of dynamic tags that will be evaluated from user claims in + * the push registration endpoint. + * + * @param {string} [siteConfig.push.kind] Kind of resource. + * + * @param {object} [siteConfig.apiDefinition] Information about the formal API + * definition for the app. + * + * @param {string} [siteConfig.apiDefinition.url] The URL of the API + * definition. + * + * @param {string} [siteConfig.autoSwapSlotName] Auto-swap slot name. + * + * @param {boolean} [siteConfig.localMySqlEnabled] true to enable + * local MySQL; otherwise, false. + * + * @param {number} [siteConfig.managedServiceIdentityId] Managed Service + * Identity Id + * + * @param {number} [siteConfig.xManagedServiceIdentityId] Explicit Managed + * Service Identity Id + * + * @param {array} [siteConfig.ipSecurityRestrictions] IP security restrictions. + * + * @param {boolean} [siteConfig.http20Enabled] Http20Enabled: configures a web + * site to allow clients to connect over http2.0 + * + * @param {string} [siteConfig.minTlsVersion] MinTlsVersion: configures the + * minimum version of TLS required for SSL requests. Possible values include: + * '1.0', '1.1', '1.2' + * + * @param {string} [siteConfig.ftpsState] State of FTP / FTPS service. Possible + * values include: 'AllAllowed', 'FtpsOnly', 'Disabled' + * + * @param {number} [siteConfig.reservedInstanceCount] Number of reserved + * instances. + * This setting only applies to the Consumption Plan + * + * @param {string} [siteConfig.kind] Kind of resource. + * + * @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 {SiteConfigResource} - 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. + * + * {SiteConfigResource} [result] - The deserialized result object if an error did not occur. + * See {@link SiteConfigResource} 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. + */ + updateConfiguration(resourceGroupName: string, name: string, siteConfig: models.SiteConfigResource, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + updateConfiguration(resourceGroupName: string, name: string, siteConfig: models.SiteConfigResource, callback: ServiceCallback): void; + updateConfiguration(resourceGroupName: string, name: string, siteConfig: models.SiteConfigResource, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Gets a list of web app configuration snapshots identifiers. Each + * element of the list contains a timestamp and the ID of the snapshot. + * + * Gets a list of web app configuration snapshots identifiers. Each element of + * the list contains a timestamp and the ID of the snapshot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @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. + */ + listConfigurationSnapshotInfoWithHttpOperationResponse(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets a list of web app configuration snapshots identifiers. Each + * element of the list contains a timestamp and the ID of the snapshot. + * + * Gets a list of web app configuration snapshots identifiers. Each element of + * the list contains a timestamp and the ID of the snapshot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @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 {SiteConfigurationSnapshotInfoCollection} - 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. + * + * {SiteConfigurationSnapshotInfoCollection} [result] - The deserialized result object if an error did not occur. + * See {@link SiteConfigurationSnapshotInfoCollection} 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. + */ + listConfigurationSnapshotInfo(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listConfigurationSnapshotInfo(resourceGroupName: string, name: string, callback: ServiceCallback): void; + listConfigurationSnapshotInfo(resourceGroupName: string, name: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Gets a snapshot of the configuration of an app at a previous point + * in time. + * + * Gets a snapshot of the configuration of an app at a previous point in time. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} snapshotId The ID of the snapshot to read. + * + * @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. + */ + getConfigurationSnapshotWithHttpOperationResponse(resourceGroupName: string, name: string, snapshotId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets a snapshot of the configuration of an app at a previous point + * in time. + * + * Gets a snapshot of the configuration of an app at a previous point in time. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} snapshotId The ID of the snapshot to read. + * + * @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 {SiteConfigResource} - 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. + * + * {SiteConfigResource} [result] - The deserialized result object if an error did not occur. + * See {@link SiteConfigResource} 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. + */ + getConfigurationSnapshot(resourceGroupName: string, name: string, snapshotId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getConfigurationSnapshot(resourceGroupName: string, name: string, snapshotId: string, callback: ServiceCallback): void; + getConfigurationSnapshot(resourceGroupName: string, name: string, snapshotId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Reverts the configuration of an app to a previous snapshot. + * + * Reverts the configuration of an app to a previous snapshot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} snapshotId The ID of the snapshot to read. + * + * @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. + */ + recoverSiteConfigurationSnapshotWithHttpOperationResponse(resourceGroupName: string, name: string, snapshotId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Reverts the configuration of an app to a previous snapshot. + * + * Reverts the configuration of an app to a previous snapshot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} snapshotId The ID of the snapshot to read. + * + * @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 {null} - 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. + * + * {null} [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. + */ + recoverSiteConfigurationSnapshot(resourceGroupName: string, name: string, snapshotId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + recoverSiteConfigurationSnapshot(resourceGroupName: string, name: string, snapshotId: string, callback: ServiceCallback): void; + recoverSiteConfigurationSnapshot(resourceGroupName: string, name: string, snapshotId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Gets the last lines of docker logs for the given site + * + * Gets the last lines of docker logs for the given site + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @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. + */ + getWebSiteContainerLogsWithHttpOperationResponse(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets the last lines of docker logs for the given site + * + * Gets the last lines of docker logs for the given site + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @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 {Object} - 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. + * + * {Object} [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. + */ + getWebSiteContainerLogs(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getWebSiteContainerLogs(resourceGroupName: string, name: string, callback: ServiceCallback): void; + getWebSiteContainerLogs(resourceGroupName: string, name: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Gets the ZIP archived docker log files for the given site + * + * Gets the ZIP archived docker log files for the given site + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @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. + */ + getContainerLogsZipWithHttpOperationResponse(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets the ZIP archived docker log files for the given site + * + * Gets the ZIP archived docker log files for the given site + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @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 {Object} - 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. + * + * {Object} [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. + */ + getContainerLogsZip(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getContainerLogsZip(resourceGroupName: string, name: string, callback: ServiceCallback): void; + getContainerLogsZip(resourceGroupName: string, name: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary List continuous web jobs for an app, or a deployment slot. + * + * List continuous web jobs for an app, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @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. + */ + listContinuousWebJobsWithHttpOperationResponse(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary List continuous web jobs for an app, or a deployment slot. + * + * List continuous web jobs for an app, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @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 {ContinuousWebJobCollection} - 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. + * + * {ContinuousWebJobCollection} [result] - The deserialized result object if an error did not occur. + * See {@link ContinuousWebJobCollection} 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. + */ + listContinuousWebJobs(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listContinuousWebJobs(resourceGroupName: string, name: string, callback: ServiceCallback): void; + listContinuousWebJobs(resourceGroupName: string, name: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Gets a continuous web job by its ID for an app, or a deployment + * slot. + * + * Gets a continuous web job by its ID for an app, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} webJobName Name of Web Job. + * + * @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. + */ + getContinuousWebJobWithHttpOperationResponse(resourceGroupName: string, name: string, webJobName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets a continuous web job by its ID for an app, or a deployment + * slot. + * + * Gets a continuous web job by its ID for an app, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} webJobName Name of Web Job. + * + * @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 {ContinuousWebJob} - 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. + * + * {ContinuousWebJob} [result] - The deserialized result object if an error did not occur. + * See {@link ContinuousWebJob} 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. + */ + getContinuousWebJob(resourceGroupName: string, name: string, webJobName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getContinuousWebJob(resourceGroupName: string, name: string, webJobName: string, callback: ServiceCallback): void; + getContinuousWebJob(resourceGroupName: string, name: string, webJobName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Delete a continuous web job by its ID for an app, or a deployment + * slot. + * + * Delete a continuous web job by its ID for an app, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} webJobName Name of Web Job. + * + * @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. + */ + deleteContinuousWebJobWithHttpOperationResponse(resourceGroupName: string, name: string, webJobName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Delete a continuous web job by its ID for an app, or a deployment + * slot. + * + * Delete a continuous web job by its ID for an app, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} webJobName Name of Web Job. + * + * @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 {null} - 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. + * + * {null} [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. + */ + deleteContinuousWebJob(resourceGroupName: string, name: string, webJobName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteContinuousWebJob(resourceGroupName: string, name: string, webJobName: string, callback: ServiceCallback): void; + deleteContinuousWebJob(resourceGroupName: string, name: string, webJobName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Start a continuous web job for an app, or a deployment slot. + * + * Start a continuous web job for an app, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} webJobName Name of Web Job. + * + * @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. + */ + startContinuousWebJobWithHttpOperationResponse(resourceGroupName: string, name: string, webJobName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Start a continuous web job for an app, or a deployment slot. + * + * Start a continuous web job for an app, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} webJobName Name of Web Job. + * + * @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 {null} - 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. + * + * {null} [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. + */ + startContinuousWebJob(resourceGroupName: string, name: string, webJobName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + startContinuousWebJob(resourceGroupName: string, name: string, webJobName: string, callback: ServiceCallback): void; + startContinuousWebJob(resourceGroupName: string, name: string, webJobName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Stop a continuous web job for an app, or a deployment slot. + * + * Stop a continuous web job for an app, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} webJobName Name of Web Job. + * + * @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. + */ + stopContinuousWebJobWithHttpOperationResponse(resourceGroupName: string, name: string, webJobName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Stop a continuous web job for an app, or a deployment slot. + * + * Stop a continuous web job for an app, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} webJobName Name of Web Job. + * + * @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 {null} - 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. + * + * {null} [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. + */ + stopContinuousWebJob(resourceGroupName: string, name: string, webJobName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + stopContinuousWebJob(resourceGroupName: string, name: string, webJobName: string, callback: ServiceCallback): void; + stopContinuousWebJob(resourceGroupName: string, name: string, webJobName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary List deployments for an app, or a deployment slot. + * + * List deployments for an app, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @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. + */ + listDeploymentsWithHttpOperationResponse(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary List deployments for an app, or a deployment slot. + * + * List deployments for an app, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @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 {DeploymentCollection} - 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. + * + * {DeploymentCollection} [result] - The deserialized result object if an error did not occur. + * See {@link DeploymentCollection} 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. + */ + listDeployments(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listDeployments(resourceGroupName: string, name: string, callback: ServiceCallback): void; + listDeployments(resourceGroupName: string, name: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Get a deployment by its ID for an app, or a deployment slot. + * + * Get a deployment by its ID for an app, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} id Deployment ID. + * + * @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. + */ + getDeploymentWithHttpOperationResponse(resourceGroupName: string, name: string, id: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get a deployment by its ID for an app, or a deployment slot. + * + * Get a deployment by its ID for an app, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} id Deployment ID. + * + * @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 {Deployment} - 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. + * + * {Deployment} [result] - The deserialized result object if an error did not occur. + * See {@link Deployment} 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. + */ + getDeployment(resourceGroupName: string, name: string, id: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getDeployment(resourceGroupName: string, name: string, id: string, callback: ServiceCallback): void; + getDeployment(resourceGroupName: string, name: string, id: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Create a deployment for an app, or a deployment slot. + * + * Create a deployment for an app, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} id ID of an existing deployment. + * + * @param {object} deployment Deployment details. + * + * @param {number} [deployment.status] Deployment status. + * + * @param {string} [deployment.message] Details about deployment status. + * + * @param {string} [deployment.author] Who authored the deployment. + * + * @param {string} [deployment.deployer] Who performed the deployment. + * + * @param {string} [deployment.authorEmail] Author email. + * + * @param {date} [deployment.startTime] Start time. + * + * @param {date} [deployment.endTime] End time. + * + * @param {boolean} [deployment.active] True if deployment is currently active, + * false if completed and null if not started. + * + * @param {string} [deployment.details] Details on deployment. + * + * @param {string} [deployment.kind] Kind of resource. + * + * @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. + */ + createDeploymentWithHttpOperationResponse(resourceGroupName: string, name: string, id: string, deployment: models.Deployment, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Create a deployment for an app, or a deployment slot. + * + * Create a deployment for an app, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} id ID of an existing deployment. + * + * @param {object} deployment Deployment details. + * + * @param {number} [deployment.status] Deployment status. + * + * @param {string} [deployment.message] Details about deployment status. + * + * @param {string} [deployment.author] Who authored the deployment. + * + * @param {string} [deployment.deployer] Who performed the deployment. + * + * @param {string} [deployment.authorEmail] Author email. + * + * @param {date} [deployment.startTime] Start time. + * + * @param {date} [deployment.endTime] End time. + * + * @param {boolean} [deployment.active] True if deployment is currently active, + * false if completed and null if not started. + * + * @param {string} [deployment.details] Details on deployment. + * + * @param {string} [deployment.kind] Kind of resource. + * + * @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 {Deployment} - 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. + * + * {Deployment} [result] - The deserialized result object if an error did not occur. + * See {@link Deployment} 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. + */ + createDeployment(resourceGroupName: string, name: string, id: string, deployment: models.Deployment, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createDeployment(resourceGroupName: string, name: string, id: string, deployment: models.Deployment, callback: ServiceCallback): void; + createDeployment(resourceGroupName: string, name: string, id: string, deployment: models.Deployment, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Delete a deployment by its ID for an app, or a deployment slot. + * + * Delete a deployment by its ID for an app, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} id Deployment ID. + * + * @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. + */ + deleteDeploymentWithHttpOperationResponse(resourceGroupName: string, name: string, id: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Delete a deployment by its ID for an app, or a deployment slot. + * + * Delete a deployment by its ID for an app, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} id Deployment ID. + * + * @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 {null} - 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. + * + * {null} [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. + */ + deleteDeployment(resourceGroupName: string, name: string, id: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteDeployment(resourceGroupName: string, name: string, id: string, callback: ServiceCallback): void; + deleteDeployment(resourceGroupName: string, name: string, id: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary List deployment log for specific deployment for an app, or a + * deployment slot. + * + * List deployment log for specific deployment for an app, or a deployment + * slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} id The ID of a specific deployment. This is the value of the + * name property in the JSON response from "GET + * /api/sites/{siteName}/deployments". + * + * @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. + */ + listDeploymentLogWithHttpOperationResponse(resourceGroupName: string, name: string, id: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary List deployment log for specific deployment for an app, or a + * deployment slot. + * + * List deployment log for specific deployment for an app, or a deployment + * slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} id The ID of a specific deployment. This is the value of the + * name property in the JSON response from "GET + * /api/sites/{siteName}/deployments". + * + * @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 {Deployment} - 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. + * + * {Deployment} [result] - The deserialized result object if an error did not occur. + * See {@link Deployment} 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. + */ + listDeploymentLog(resourceGroupName: string, name: string, id: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listDeploymentLog(resourceGroupName: string, name: string, id: string, callback: ServiceCallback): void; + listDeploymentLog(resourceGroupName: string, name: string, id: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Discovers an existing app backup that can be restored from a blob + * in Azure storage. Use this to get information about the databases stored in + * a backup. + * + * Discovers an existing app backup that can be restored from a blob in Azure + * storage. Use this to get information about the databases stored in a backup. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} request A RestoreRequest object that includes Azure storage + * URL and blog name for discovery of backup. + * + * @param {string} request.storageAccountUrl SAS URL to the container. + * + * @param {string} [request.blobName] Name of a blob which contains the backup. + * + * @param {boolean} request.overwrite true if the restore + * operation can overwrite target app; otherwise, false. + * true is needed if trying to restore over an existing app. + * + * @param {string} [request.siteName] Name of an app. + * + * @param {array} [request.databases] Collection of databases which should be + * restored. This list has to match the list of databases included in the + * backup. + * + * @param {boolean} [request.ignoreConflictingHostNames] Changes a logic when + * restoring an app with custom domains. true to remove custom + * domains automatically. If false, custom domains are added to + * the app's object when it is being restored, but that might fail due to + * conflicts during the operation. + * + * @param {boolean} [request.ignoreDatabases] Ignore the databases and only + * restore the site content + * + * @param {string} [request.appServicePlan] Specify app service plan that will + * own restored site. + * + * @param {string} [request.operationType] Operation type. Possible values + * include: 'Default', 'Clone', 'Relocation', 'Snapshot', 'CloudFS' + * + * @param {boolean} [request.adjustConnectionStrings] true if + * SiteConfig.ConnectionStrings should be set in new app; otherwise, + * false. + * + * @param {string} [request.hostingEnvironment] App Service Environment name, + * if needed (only when restoring an app to an App Service Environment). + * + * @param {string} [request.kind] Kind of resource. + * + * @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. + */ + discoverBackupWithHttpOperationResponse(resourceGroupName: string, name: string, request: models.RestoreRequest, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Discovers an existing app backup that can be restored from a blob + * in Azure storage. Use this to get information about the databases stored in + * a backup. + * + * Discovers an existing app backup that can be restored from a blob in Azure + * storage. Use this to get information about the databases stored in a backup. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} request A RestoreRequest object that includes Azure storage + * URL and blog name for discovery of backup. + * + * @param {string} request.storageAccountUrl SAS URL to the container. + * + * @param {string} [request.blobName] Name of a blob which contains the backup. + * + * @param {boolean} request.overwrite true if the restore + * operation can overwrite target app; otherwise, false. + * true is needed if trying to restore over an existing app. + * + * @param {string} [request.siteName] Name of an app. + * + * @param {array} [request.databases] Collection of databases which should be + * restored. This list has to match the list of databases included in the + * backup. + * + * @param {boolean} [request.ignoreConflictingHostNames] Changes a logic when + * restoring an app with custom domains. true to remove custom + * domains automatically. If false, custom domains are added to + * the app's object when it is being restored, but that might fail due to + * conflicts during the operation. + * + * @param {boolean} [request.ignoreDatabases] Ignore the databases and only + * restore the site content + * + * @param {string} [request.appServicePlan] Specify app service plan that will + * own restored site. + * + * @param {string} [request.operationType] Operation type. Possible values + * include: 'Default', 'Clone', 'Relocation', 'Snapshot', 'CloudFS' + * + * @param {boolean} [request.adjustConnectionStrings] true if + * SiteConfig.ConnectionStrings should be set in new app; otherwise, + * false. + * + * @param {string} [request.hostingEnvironment] App Service Environment name, + * if needed (only when restoring an app to an App Service Environment). + * + * @param {string} [request.kind] Kind of resource. + * + * @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 {RestoreRequest} - 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. + * + * {RestoreRequest} [result] - The deserialized result object if an error did not occur. + * See {@link RestoreRequest} 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. + */ + discoverBackup(resourceGroupName: string, name: string, request: models.RestoreRequest, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + discoverBackup(resourceGroupName: string, name: string, request: models.RestoreRequest, callback: ServiceCallback): void; + discoverBackup(resourceGroupName: string, name: string, request: models.RestoreRequest, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Lists ownership identifiers for domain associated with web app. + * + * Lists ownership identifiers for domain associated with web app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @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. + */ + listDomainOwnershipIdentifiersWithHttpOperationResponse(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Lists ownership identifiers for domain associated with web app. + * + * Lists ownership identifiers for domain associated with web app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @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 {IdentifierCollection} - 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. + * + * {IdentifierCollection} [result] - The deserialized result object if an error did not occur. + * See {@link IdentifierCollection} 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. + */ + listDomainOwnershipIdentifiers(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listDomainOwnershipIdentifiers(resourceGroupName: string, name: string, callback: ServiceCallback): void; + listDomainOwnershipIdentifiers(resourceGroupName: string, name: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Get domain ownership identifier for web app. + * + * Get domain ownership identifier for web app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} domainOwnershipIdentifierName Name of domain ownership + * identifier. + * + * @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. + */ + getDomainOwnershipIdentifierWithHttpOperationResponse(resourceGroupName: string, name: string, domainOwnershipIdentifierName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get domain ownership identifier for web app. + * + * Get domain ownership identifier for web app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} domainOwnershipIdentifierName Name of domain ownership + * identifier. + * + * @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 {Identifier} - 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. + * + * {Identifier} [result] - The deserialized result object if an error did not occur. + * See {@link Identifier} 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. + */ + getDomainOwnershipIdentifier(resourceGroupName: string, name: string, domainOwnershipIdentifierName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getDomainOwnershipIdentifier(resourceGroupName: string, name: string, domainOwnershipIdentifierName: string, callback: ServiceCallback): void; + getDomainOwnershipIdentifier(resourceGroupName: string, name: string, domainOwnershipIdentifierName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Creates a domain ownership identifier for web app, or updates an + * existing ownership identifier. + * + * Creates a domain ownership identifier for web app, or updates an existing + * ownership identifier. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} domainOwnershipIdentifierName Name of domain ownership + * identifier. + * + * @param {object} domainOwnershipIdentifier A JSON representation of the + * domain ownership properties. + * + * @param {string} [domainOwnershipIdentifier.identifierId] String + * representation of the identity. + * + * @param {string} [domainOwnershipIdentifier.kind] Kind of resource. + * + * @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. + */ + createOrUpdateDomainOwnershipIdentifierWithHttpOperationResponse(resourceGroupName: string, name: string, domainOwnershipIdentifierName: string, domainOwnershipIdentifier: models.Identifier, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Creates a domain ownership identifier for web app, or updates an + * existing ownership identifier. + * + * Creates a domain ownership identifier for web app, or updates an existing + * ownership identifier. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} domainOwnershipIdentifierName Name of domain ownership + * identifier. + * + * @param {object} domainOwnershipIdentifier A JSON representation of the + * domain ownership properties. + * + * @param {string} [domainOwnershipIdentifier.identifierId] String + * representation of the identity. + * + * @param {string} [domainOwnershipIdentifier.kind] Kind of resource. + * + * @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 {Identifier} - 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. + * + * {Identifier} [result] - The deserialized result object if an error did not occur. + * See {@link Identifier} 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. + */ + createOrUpdateDomainOwnershipIdentifier(resourceGroupName: string, name: string, domainOwnershipIdentifierName: string, domainOwnershipIdentifier: models.Identifier, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdateDomainOwnershipIdentifier(resourceGroupName: string, name: string, domainOwnershipIdentifierName: string, domainOwnershipIdentifier: models.Identifier, callback: ServiceCallback): void; + createOrUpdateDomainOwnershipIdentifier(resourceGroupName: string, name: string, domainOwnershipIdentifierName: string, domainOwnershipIdentifier: models.Identifier, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Deletes a domain ownership identifier for a web app. + * + * Deletes a domain ownership identifier for a web app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} domainOwnershipIdentifierName Name of domain ownership + * identifier. + * + * @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. + */ + deleteDomainOwnershipIdentifierWithHttpOperationResponse(resourceGroupName: string, name: string, domainOwnershipIdentifierName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Deletes a domain ownership identifier for a web app. + * + * Deletes a domain ownership identifier for a web app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} domainOwnershipIdentifierName Name of domain ownership + * identifier. + * + * @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 {null} - 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. + * + * {null} [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. + */ + deleteDomainOwnershipIdentifier(resourceGroupName: string, name: string, domainOwnershipIdentifierName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteDomainOwnershipIdentifier(resourceGroupName: string, name: string, domainOwnershipIdentifierName: string, callback: ServiceCallback): void; + deleteDomainOwnershipIdentifier(resourceGroupName: string, name: string, domainOwnershipIdentifierName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Creates a domain ownership identifier for web app, or updates an + * existing ownership identifier. + * + * Creates a domain ownership identifier for web app, or updates an existing + * ownership identifier. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} domainOwnershipIdentifierName Name of domain ownership + * identifier. + * + * @param {object} domainOwnershipIdentifier A JSON representation of the + * domain ownership properties. + * + * @param {string} [domainOwnershipIdentifier.identifierId] String + * representation of the identity. + * + * @param {string} [domainOwnershipIdentifier.kind] Kind of resource. + * + * @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. + */ + updateDomainOwnershipIdentifierWithHttpOperationResponse(resourceGroupName: string, name: string, domainOwnershipIdentifierName: string, domainOwnershipIdentifier: models.Identifier, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Creates a domain ownership identifier for web app, or updates an + * existing ownership identifier. + * + * Creates a domain ownership identifier for web app, or updates an existing + * ownership identifier. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} domainOwnershipIdentifierName Name of domain ownership + * identifier. + * + * @param {object} domainOwnershipIdentifier A JSON representation of the + * domain ownership properties. + * + * @param {string} [domainOwnershipIdentifier.identifierId] String + * representation of the identity. + * + * @param {string} [domainOwnershipIdentifier.kind] Kind of resource. + * + * @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 {Identifier} - 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. + * + * {Identifier} [result] - The deserialized result object if an error did not occur. + * See {@link Identifier} 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. + */ + updateDomainOwnershipIdentifier(resourceGroupName: string, name: string, domainOwnershipIdentifierName: string, domainOwnershipIdentifier: models.Identifier, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + updateDomainOwnershipIdentifier(resourceGroupName: string, name: string, domainOwnershipIdentifierName: string, domainOwnershipIdentifier: models.Identifier, callback: ServiceCallback): void; + updateDomainOwnershipIdentifier(resourceGroupName: string, name: string, domainOwnershipIdentifierName: string, domainOwnershipIdentifier: models.Identifier, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Get the status of the last MSDeploy operation. + * + * Get the status of the last MSDeploy operation. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @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. + */ + getMSDeployStatusWithHttpOperationResponse(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get the status of the last MSDeploy operation. + * + * Get the status of the last MSDeploy operation. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @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 {MSDeployStatus} - 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. + * + * {MSDeployStatus} [result] - The deserialized result object if an error did not occur. + * See {@link MSDeployStatus} 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. + */ + getMSDeployStatus(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getMSDeployStatus(resourceGroupName: string, name: string, callback: ServiceCallback): void; + getMSDeployStatus(resourceGroupName: string, name: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Invoke the MSDeploy web app extension. + * + * Invoke the MSDeploy web app extension. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {object} mSDeploy Details of MSDeploy operation + * + * @param {string} [mSDeploy.packageUri] Package URI + * + * @param {string} [mSDeploy.connectionString] SQL Connection String + * + * @param {string} [mSDeploy.dbType] Database Type + * + * @param {string} [mSDeploy.setParametersXmlFileUri] URI of MSDeploy + * Parameters file. Must not be set if SetParameters is used. + * + * @param {object} [mSDeploy.setParameters] MSDeploy Parameters. Must not be + * set if SetParametersXmlFileUri is used. + * + * @param {boolean} [mSDeploy.skipAppData] Controls whether the MSDeploy + * operation skips the App_Data directory. + * If set to true, the existing App_Data directory on the + * destination + * will not be deleted, and any App_Data directory in the source will be + * ignored. + * Setting is false by default. + * + * @param {boolean} [mSDeploy.appOffline] Sets the AppOffline rule while the + * MSDeploy operation executes. + * Setting is false by default. + * + * @param {string} [mSDeploy.kind] Kind of resource. + * + * @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. + */ + createMSDeployOperationWithHttpOperationResponse(resourceGroupName: string, name: string, mSDeploy: models.MSDeploy, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Invoke the MSDeploy web app extension. + * + * Invoke the MSDeploy web app extension. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {object} mSDeploy Details of MSDeploy operation + * + * @param {string} [mSDeploy.packageUri] Package URI + * + * @param {string} [mSDeploy.connectionString] SQL Connection String + * + * @param {string} [mSDeploy.dbType] Database Type + * + * @param {string} [mSDeploy.setParametersXmlFileUri] URI of MSDeploy + * Parameters file. Must not be set if SetParameters is used. + * + * @param {object} [mSDeploy.setParameters] MSDeploy Parameters. Must not be + * set if SetParametersXmlFileUri is used. + * + * @param {boolean} [mSDeploy.skipAppData] Controls whether the MSDeploy + * operation skips the App_Data directory. + * If set to true, the existing App_Data directory on the + * destination + * will not be deleted, and any App_Data directory in the source will be + * ignored. + * Setting is false by default. + * + * @param {boolean} [mSDeploy.appOffline] Sets the AppOffline rule while the + * MSDeploy operation executes. + * Setting is false by default. + * + * @param {string} [mSDeploy.kind] Kind of resource. + * + * @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 {MSDeployStatus} - 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. + * + * {MSDeployStatus} [result] - The deserialized result object if an error did not occur. + * See {@link MSDeployStatus} 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. + */ + createMSDeployOperation(resourceGroupName: string, name: string, mSDeploy: models.MSDeploy, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createMSDeployOperation(resourceGroupName: string, name: string, mSDeploy: models.MSDeploy, callback: ServiceCallback): void; + createMSDeployOperation(resourceGroupName: string, name: string, mSDeploy: models.MSDeploy, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Get the MSDeploy Log for the last MSDeploy operation. + * + * Get the MSDeploy Log for the last MSDeploy operation. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @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. + */ + getMSDeployLogWithHttpOperationResponse(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get the MSDeploy Log for the last MSDeploy operation. + * + * Get the MSDeploy Log for the last MSDeploy operation. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @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 {MSDeployLog} - 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. + * + * {MSDeployLog} [result] - The deserialized result object if an error did not occur. + * See {@link MSDeployLog} 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. + */ + getMSDeployLog(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getMSDeployLog(resourceGroupName: string, name: string, callback: ServiceCallback): void; + getMSDeployLog(resourceGroupName: string, name: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary List the functions for a web site, or a deployment slot. + * + * List the functions for a web site, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @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. + */ + listFunctionsWithHttpOperationResponse(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary List the functions for a web site, or a deployment slot. + * + * List the functions for a web site, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @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 {FunctionEnvelopeCollection} - 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. + * + * {FunctionEnvelopeCollection} [result] - The deserialized result object if an error did not occur. + * See {@link FunctionEnvelopeCollection} 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. + */ + listFunctions(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listFunctions(resourceGroupName: string, name: string, callback: ServiceCallback): void; + listFunctions(resourceGroupName: string, name: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Fetch a short lived token that can be exchanged for a master key. + * + * Fetch a short lived token that can be exchanged for a master key. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @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. + */ + getFunctionsAdminTokenWithHttpOperationResponse(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Fetch a short lived token that can be exchanged for a master key. + * + * Fetch a short lived token that can be exchanged for a master key. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @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 {String} - 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. + * + * {String} [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. + */ + getFunctionsAdminToken(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getFunctionsAdminToken(resourceGroupName: string, name: string, callback: ServiceCallback): void; + getFunctionsAdminToken(resourceGroupName: string, name: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Get function information by its ID for web site, or a deployment + * slot. + * + * Get function information by its ID for web site, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} functionName Function name. + * + * @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. + */ + getFunctionWithHttpOperationResponse(resourceGroupName: string, name: string, functionName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get function information by its ID for web site, or a deployment + * slot. + * + * Get function information by its ID for web site, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} functionName Function name. + * + * @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 {FunctionEnvelope} - 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. + * + * {FunctionEnvelope} [result] - The deserialized result object if an error did not occur. + * See {@link FunctionEnvelope} 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. + */ + getFunction(resourceGroupName: string, name: string, functionName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getFunction(resourceGroupName: string, name: string, functionName: string, callback: ServiceCallback): void; + getFunction(resourceGroupName: string, name: string, functionName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Create function for web site, or a deployment slot. + * + * Create function for web site, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} functionName Function name. + * + * @param {object} functionEnvelope Function details. + * + * @param {string} [functionEnvelope.functionAppId] Function App ID. + * + * @param {string} [functionEnvelope.scriptRootPathHref] Script root path URI. + * + * @param {string} [functionEnvelope.scriptHref] Script URI. + * + * @param {string} [functionEnvelope.configHref] Config URI. + * + * @param {string} [functionEnvelope.secretsFileHref] Secrets file URI. + * + * @param {string} [functionEnvelope.href] Function URI. + * + * @param {object} [functionEnvelope.config] Config information. + * + * @param {object} [functionEnvelope.files] File list. + * + * @param {string} [functionEnvelope.testData] Test data used when testing via + * the Azure Portal. + * + * @param {string} [functionEnvelope.kind] Kind of resource. + * + * @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. + */ + createFunctionWithHttpOperationResponse(resourceGroupName: string, name: string, functionName: string, functionEnvelope: models.FunctionEnvelope, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Create function for web site, or a deployment slot. + * + * Create function for web site, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} functionName Function name. + * + * @param {object} functionEnvelope Function details. + * + * @param {string} [functionEnvelope.functionAppId] Function App ID. + * + * @param {string} [functionEnvelope.scriptRootPathHref] Script root path URI. + * + * @param {string} [functionEnvelope.scriptHref] Script URI. + * + * @param {string} [functionEnvelope.configHref] Config URI. + * + * @param {string} [functionEnvelope.secretsFileHref] Secrets file URI. + * + * @param {string} [functionEnvelope.href] Function URI. + * + * @param {object} [functionEnvelope.config] Config information. + * + * @param {object} [functionEnvelope.files] File list. + * + * @param {string} [functionEnvelope.testData] Test data used when testing via + * the Azure Portal. + * + * @param {string} [functionEnvelope.kind] Kind of resource. + * + * @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 {FunctionEnvelope} - 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. + * + * {FunctionEnvelope} [result] - The deserialized result object if an error did not occur. + * See {@link FunctionEnvelope} 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. + */ + createFunction(resourceGroupName: string, name: string, functionName: string, functionEnvelope: models.FunctionEnvelope, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createFunction(resourceGroupName: string, name: string, functionName: string, functionEnvelope: models.FunctionEnvelope, callback: ServiceCallback): void; + createFunction(resourceGroupName: string, name: string, functionName: string, functionEnvelope: models.FunctionEnvelope, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Delete a function for web site, or a deployment slot. + * + * Delete a function for web site, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} functionName Function name. + * + * @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. + */ + deleteFunctionWithHttpOperationResponse(resourceGroupName: string, name: string, functionName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Delete a function for web site, or a deployment slot. + * + * Delete a function for web site, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} functionName Function name. + * + * @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 {null} - 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. + * + * {null} [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. + */ + deleteFunction(resourceGroupName: string, name: string, functionName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteFunction(resourceGroupName: string, name: string, functionName: string, callback: ServiceCallback): void; + deleteFunction(resourceGroupName: string, name: string, functionName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Get function secrets for a function in a web site, or a deployment + * slot. + * + * Get function secrets for a function in a web site, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} functionName Function name. + * + * @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. + */ + listFunctionSecretsWithHttpOperationResponse(resourceGroupName: string, name: string, functionName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get function secrets for a function in a web site, or a deployment + * slot. + * + * Get function secrets for a function in a web site, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} functionName Function name. + * + * @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 {FunctionSecrets} - 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. + * + * {FunctionSecrets} [result] - The deserialized result object if an error did not occur. + * See {@link FunctionSecrets} 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. + */ + listFunctionSecrets(resourceGroupName: string, name: string, functionName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listFunctionSecrets(resourceGroupName: string, name: string, functionName: string, callback: ServiceCallback): void; + listFunctionSecrets(resourceGroupName: string, name: string, functionName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Get hostname bindings for an app or a deployment slot. + * + * Get hostname bindings for an app or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @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. + */ + listHostNameBindingsWithHttpOperationResponse(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get hostname bindings for an app or a deployment slot. + * + * Get hostname bindings for an app or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @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 {HostNameBindingCollection} - 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. + * + * {HostNameBindingCollection} [result] - The deserialized result object if an error did not occur. + * See {@link HostNameBindingCollection} 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. + */ + listHostNameBindings(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listHostNameBindings(resourceGroupName: string, name: string, callback: ServiceCallback): void; + listHostNameBindings(resourceGroupName: string, name: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Get the named hostname binding for an app (or deployment slot, if + * specified). + * + * Get the named hostname binding for an app (or deployment slot, if + * specified). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} hostName Hostname in the hostname binding. + * + * @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. + */ + getHostNameBindingWithHttpOperationResponse(resourceGroupName: string, name: string, hostName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get the named hostname binding for an app (or deployment slot, if + * specified). + * + * Get the named hostname binding for an app (or deployment slot, if + * specified). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} hostName Hostname in the hostname binding. + * + * @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 {HostNameBinding} - 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. + * + * {HostNameBinding} [result] - The deserialized result object if an error did not occur. + * See {@link HostNameBinding} 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. + */ + getHostNameBinding(resourceGroupName: string, name: string, hostName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getHostNameBinding(resourceGroupName: string, name: string, hostName: string, callback: ServiceCallback): void; + getHostNameBinding(resourceGroupName: string, name: string, hostName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Creates a hostname binding for an app. + * + * Creates a hostname binding for an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} hostName Hostname in the hostname binding. + * + * @param {object} hostNameBinding Binding details. This is the JSON + * representation of a HostNameBinding object. + * + * @param {string} [hostNameBinding.siteName] App Service app name. + * + * @param {string} [hostNameBinding.domainId] Fully qualified ARM domain + * resource URI. + * + * @param {string} [hostNameBinding.azureResourceName] Azure resource name. + * + * @param {string} [hostNameBinding.azureResourceType] Azure resource type. + * Possible values include: 'Website', 'TrafficManager' + * + * @param {string} [hostNameBinding.customHostNameDnsRecordType] Custom DNS + * record type. Possible values include: 'CName', 'A' + * + * @param {string} [hostNameBinding.hostNameType] Hostname type. Possible + * values include: 'Verified', 'Managed' + * + * @param {string} [hostNameBinding.sslState] SSL type. Possible values + * include: 'Disabled', 'SniEnabled', 'IpBasedEnabled' + * + * @param {string} [hostNameBinding.thumbprint] SSL certificate thumbprint + * + * @param {string} [hostNameBinding.kind] Kind of resource. + * + * @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. + */ + createOrUpdateHostNameBindingWithHttpOperationResponse(resourceGroupName: string, name: string, hostName: string, hostNameBinding: models.HostNameBinding, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Creates a hostname binding for an app. + * + * Creates a hostname binding for an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} hostName Hostname in the hostname binding. + * + * @param {object} hostNameBinding Binding details. This is the JSON + * representation of a HostNameBinding object. + * + * @param {string} [hostNameBinding.siteName] App Service app name. + * + * @param {string} [hostNameBinding.domainId] Fully qualified ARM domain + * resource URI. + * + * @param {string} [hostNameBinding.azureResourceName] Azure resource name. + * + * @param {string} [hostNameBinding.azureResourceType] Azure resource type. + * Possible values include: 'Website', 'TrafficManager' + * + * @param {string} [hostNameBinding.customHostNameDnsRecordType] Custom DNS + * record type. Possible values include: 'CName', 'A' + * + * @param {string} [hostNameBinding.hostNameType] Hostname type. Possible + * values include: 'Verified', 'Managed' + * + * @param {string} [hostNameBinding.sslState] SSL type. Possible values + * include: 'Disabled', 'SniEnabled', 'IpBasedEnabled' + * + * @param {string} [hostNameBinding.thumbprint] SSL certificate thumbprint + * + * @param {string} [hostNameBinding.kind] Kind of resource. + * + * @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 {HostNameBinding} - 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. + * + * {HostNameBinding} [result] - The deserialized result object if an error did not occur. + * See {@link HostNameBinding} 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. + */ + createOrUpdateHostNameBinding(resourceGroupName: string, name: string, hostName: string, hostNameBinding: models.HostNameBinding, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdateHostNameBinding(resourceGroupName: string, name: string, hostName: string, hostNameBinding: models.HostNameBinding, callback: ServiceCallback): void; + createOrUpdateHostNameBinding(resourceGroupName: string, name: string, hostName: string, hostNameBinding: models.HostNameBinding, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Deletes a hostname binding for an app. + * + * Deletes a hostname binding for an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} hostName Hostname in the hostname binding. + * + * @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. + */ + deleteHostNameBindingWithHttpOperationResponse(resourceGroupName: string, name: string, hostName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Deletes a hostname binding for an app. + * + * Deletes a hostname binding for an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} hostName Hostname in the hostname binding. + * + * @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 {null} - 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. + * + * {null} [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. + */ + deleteHostNameBinding(resourceGroupName: string, name: string, hostName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteHostNameBinding(resourceGroupName: string, name: string, hostName: string, callback: ServiceCallback): void; + deleteHostNameBinding(resourceGroupName: string, name: string, hostName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Retrieves a specific Service Bus Hybrid Connection used by this Web + * App. + * + * Retrieves a specific Service Bus Hybrid Connection used by this Web App. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @param {string} namespaceName The namespace for this hybrid connection. + * + * @param {string} relayName The relay name for this hybrid connection. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + getHybridConnectionWithHttpOperationResponse(resourceGroupName: string, name: string, namespaceName: string, relayName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Retrieves a specific Service Bus Hybrid Connection used by this Web + * App. + * + * Retrieves a specific Service Bus Hybrid Connection used by this Web App. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @param {string} namespaceName The namespace for this hybrid connection. + * + * @param {string} relayName The relay name for this hybrid connection. + * + * @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 {HybridConnection} - 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. + * + * {HybridConnection} [result] - The deserialized result object if an error did not occur. + * See {@link HybridConnection} 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. + */ + getHybridConnection(resourceGroupName: string, name: string, namespaceName: string, relayName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getHybridConnection(resourceGroupName: string, name: string, namespaceName: string, relayName: string, callback: ServiceCallback): void; + getHybridConnection(resourceGroupName: string, name: string, namespaceName: string, relayName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Creates a new Hybrid Connection using a Service Bus relay. + * + * Creates a new Hybrid Connection using a Service Bus relay. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @param {string} namespaceName The namespace for this hybrid connection. + * + * @param {string} relayName The relay name for this hybrid connection. + * + * @param {object} connectionEnvelope The details of the hybrid connection. + * + * @param {string} [connectionEnvelope.serviceBusNamespace] The name of the + * Service Bus namespace. + * + * @param {string} [connectionEnvelope.relayName] The name of the Service Bus + * relay. + * + * @param {string} [connectionEnvelope.relayArmUri] The ARM URI to the Service + * Bus relay. + * + * @param {string} [connectionEnvelope.hostname] The hostname of the endpoint. + * + * @param {number} [connectionEnvelope.port] The port of the endpoint. + * + * @param {string} [connectionEnvelope.sendKeyName] The name of the Service Bus + * key which has Send permissions. This is used to authenticate to Service Bus. + * + * @param {string} [connectionEnvelope.sendKeyValue] The value of the Service + * Bus key. This is used to authenticate to Service Bus. In ARM this key will + * not be returned + * normally, use the POST /listKeys API instead. + * + * @param {string} [connectionEnvelope.serviceBusSuffix] The suffix for the + * service bus endpoint. By default this is .servicebus.windows.net + * + * @param {string} [connectionEnvelope.kind] Kind of resource. + * + * @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. + */ + createOrUpdateHybridConnectionWithHttpOperationResponse(resourceGroupName: string, name: string, namespaceName: string, relayName: string, connectionEnvelope: models.HybridConnection, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Creates a new Hybrid Connection using a Service Bus relay. + * + * Creates a new Hybrid Connection using a Service Bus relay. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @param {string} namespaceName The namespace for this hybrid connection. + * + * @param {string} relayName The relay name for this hybrid connection. + * + * @param {object} connectionEnvelope The details of the hybrid connection. + * + * @param {string} [connectionEnvelope.serviceBusNamespace] The name of the + * Service Bus namespace. + * + * @param {string} [connectionEnvelope.relayName] The name of the Service Bus + * relay. + * + * @param {string} [connectionEnvelope.relayArmUri] The ARM URI to the Service + * Bus relay. + * + * @param {string} [connectionEnvelope.hostname] The hostname of the endpoint. + * + * @param {number} [connectionEnvelope.port] The port of the endpoint. + * + * @param {string} [connectionEnvelope.sendKeyName] The name of the Service Bus + * key which has Send permissions. This is used to authenticate to Service Bus. + * + * @param {string} [connectionEnvelope.sendKeyValue] The value of the Service + * Bus key. This is used to authenticate to Service Bus. In ARM this key will + * not be returned + * normally, use the POST /listKeys API instead. + * + * @param {string} [connectionEnvelope.serviceBusSuffix] The suffix for the + * service bus endpoint. By default this is .servicebus.windows.net + * + * @param {string} [connectionEnvelope.kind] Kind of resource. + * + * @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 {HybridConnection} - 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. + * + * {HybridConnection} [result] - The deserialized result object if an error did not occur. + * See {@link HybridConnection} 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. + */ + createOrUpdateHybridConnection(resourceGroupName: string, name: string, namespaceName: string, relayName: string, connectionEnvelope: models.HybridConnection, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdateHybridConnection(resourceGroupName: string, name: string, namespaceName: string, relayName: string, connectionEnvelope: models.HybridConnection, callback: ServiceCallback): void; + createOrUpdateHybridConnection(resourceGroupName: string, name: string, namespaceName: string, relayName: string, connectionEnvelope: models.HybridConnection, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Removes a Hybrid Connection from this site. + * + * Removes a Hybrid Connection from this site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @param {string} namespaceName The namespace for this hybrid connection. + * + * @param {string} relayName The relay name for this hybrid connection. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + deleteHybridConnectionWithHttpOperationResponse(resourceGroupName: string, name: string, namespaceName: string, relayName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Removes a Hybrid Connection from this site. + * + * Removes a Hybrid Connection from this site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @param {string} namespaceName The namespace for this hybrid connection. + * + * @param {string} relayName The relay name for this hybrid connection. + * + * @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 {null} - 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. + * + * {null} [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. + */ + deleteHybridConnection(resourceGroupName: string, name: string, namespaceName: string, relayName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteHybridConnection(resourceGroupName: string, name: string, namespaceName: string, relayName: string, callback: ServiceCallback): void; + deleteHybridConnection(resourceGroupName: string, name: string, namespaceName: string, relayName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Creates a new Hybrid Connection using a Service Bus relay. + * + * Creates a new Hybrid Connection using a Service Bus relay. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @param {string} namespaceName The namespace for this hybrid connection. + * + * @param {string} relayName The relay name for this hybrid connection. + * + * @param {object} connectionEnvelope The details of the hybrid connection. + * + * @param {string} [connectionEnvelope.serviceBusNamespace] The name of the + * Service Bus namespace. + * + * @param {string} [connectionEnvelope.relayName] The name of the Service Bus + * relay. + * + * @param {string} [connectionEnvelope.relayArmUri] The ARM URI to the Service + * Bus relay. + * + * @param {string} [connectionEnvelope.hostname] The hostname of the endpoint. + * + * @param {number} [connectionEnvelope.port] The port of the endpoint. + * + * @param {string} [connectionEnvelope.sendKeyName] The name of the Service Bus + * key which has Send permissions. This is used to authenticate to Service Bus. + * + * @param {string} [connectionEnvelope.sendKeyValue] The value of the Service + * Bus key. This is used to authenticate to Service Bus. In ARM this key will + * not be returned + * normally, use the POST /listKeys API instead. + * + * @param {string} [connectionEnvelope.serviceBusSuffix] The suffix for the + * service bus endpoint. By default this is .servicebus.windows.net + * + * @param {string} [connectionEnvelope.kind] Kind of resource. + * + * @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. + */ + updateHybridConnectionWithHttpOperationResponse(resourceGroupName: string, name: string, namespaceName: string, relayName: string, connectionEnvelope: models.HybridConnection, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Creates a new Hybrid Connection using a Service Bus relay. + * + * Creates a new Hybrid Connection using a Service Bus relay. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @param {string} namespaceName The namespace for this hybrid connection. + * + * @param {string} relayName The relay name for this hybrid connection. + * + * @param {object} connectionEnvelope The details of the hybrid connection. + * + * @param {string} [connectionEnvelope.serviceBusNamespace] The name of the + * Service Bus namespace. + * + * @param {string} [connectionEnvelope.relayName] The name of the Service Bus + * relay. + * + * @param {string} [connectionEnvelope.relayArmUri] The ARM URI to the Service + * Bus relay. + * + * @param {string} [connectionEnvelope.hostname] The hostname of the endpoint. + * + * @param {number} [connectionEnvelope.port] The port of the endpoint. + * + * @param {string} [connectionEnvelope.sendKeyName] The name of the Service Bus + * key which has Send permissions. This is used to authenticate to Service Bus. + * + * @param {string} [connectionEnvelope.sendKeyValue] The value of the Service + * Bus key. This is used to authenticate to Service Bus. In ARM this key will + * not be returned + * normally, use the POST /listKeys API instead. + * + * @param {string} [connectionEnvelope.serviceBusSuffix] The suffix for the + * service bus endpoint. By default this is .servicebus.windows.net + * + * @param {string} [connectionEnvelope.kind] Kind of resource. + * + * @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 {HybridConnection} - 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. + * + * {HybridConnection} [result] - The deserialized result object if an error did not occur. + * See {@link HybridConnection} 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. + */ + updateHybridConnection(resourceGroupName: string, name: string, namespaceName: string, relayName: string, connectionEnvelope: models.HybridConnection, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + updateHybridConnection(resourceGroupName: string, name: string, namespaceName: string, relayName: string, connectionEnvelope: models.HybridConnection, callback: ServiceCallback): void; + updateHybridConnection(resourceGroupName: string, name: string, namespaceName: string, relayName: string, connectionEnvelope: models.HybridConnection, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Gets the send key name and value for a Hybrid Connection. + * + * Gets the send key name and value for a Hybrid Connection. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @param {string} namespaceName The namespace for this hybrid connection. + * + * @param {string} relayName The relay name for this hybrid connection. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listHybridConnectionKeysWithHttpOperationResponse(resourceGroupName: string, name: string, namespaceName: string, relayName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets the send key name and value for a Hybrid Connection. + * + * Gets the send key name and value for a Hybrid Connection. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @param {string} namespaceName The namespace for this hybrid connection. + * + * @param {string} relayName The relay name for this hybrid connection. + * + * @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 {HybridConnectionKey} - 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. + * + * {HybridConnectionKey} [result] - The deserialized result object if an error did not occur. + * See {@link HybridConnectionKey} 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. + */ + listHybridConnectionKeys(resourceGroupName: string, name: string, namespaceName: string, relayName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listHybridConnectionKeys(resourceGroupName: string, name: string, namespaceName: string, relayName: string, callback: ServiceCallback): void; + listHybridConnectionKeys(resourceGroupName: string, name: string, namespaceName: string, relayName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Retrieves all Service Bus Hybrid Connections used by this Web App. + * + * Retrieves all Service Bus Hybrid Connections used by this Web App. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @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. + */ + listHybridConnectionsWithHttpOperationResponse(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Retrieves all Service Bus Hybrid Connections used by this Web App. + * + * Retrieves all Service Bus Hybrid Connections used by this Web App. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @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 {HybridConnection} - 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. + * + * {HybridConnection} [result] - The deserialized result object if an error did not occur. + * See {@link HybridConnection} 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. + */ + listHybridConnections(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listHybridConnections(resourceGroupName: string, name: string, callback: ServiceCallback): void; + listHybridConnections(resourceGroupName: string, name: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Gets hybrid connections configured for an app (or deployment slot, + * if specified). + * + * Gets hybrid connections configured for an app (or deployment slot, if + * specified). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @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. + */ + listRelayServiceConnectionsWithHttpOperationResponse(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets hybrid connections configured for an app (or deployment slot, + * if specified). + * + * Gets hybrid connections configured for an app (or deployment slot, if + * specified). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @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 {RelayServiceConnectionEntity} - 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. + * + * {RelayServiceConnectionEntity} [result] - The deserialized result object if an error did not occur. + * See {@link RelayServiceConnectionEntity} 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. + */ + listRelayServiceConnections(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listRelayServiceConnections(resourceGroupName: string, name: string, callback: ServiceCallback): void; + listRelayServiceConnections(resourceGroupName: string, name: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Gets a hybrid connection configuration by its name. + * + * Gets a hybrid connection configuration by its name. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} entityName Name of the hybrid connection. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + getRelayServiceConnectionWithHttpOperationResponse(resourceGroupName: string, name: string, entityName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets a hybrid connection configuration by its name. + * + * Gets a hybrid connection configuration by its name. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} entityName Name of the hybrid connection. + * + * @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 {RelayServiceConnectionEntity} - 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. + * + * {RelayServiceConnectionEntity} [result] - The deserialized result object if an error did not occur. + * See {@link RelayServiceConnectionEntity} 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. + */ + getRelayServiceConnection(resourceGroupName: string, name: string, entityName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getRelayServiceConnection(resourceGroupName: string, name: string, entityName: string, callback: ServiceCallback): void; + getRelayServiceConnection(resourceGroupName: string, name: string, entityName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Creates a new hybrid connection configuration (PUT), or updates an + * existing one (PATCH). + * + * Creates a new hybrid connection configuration (PUT), or updates an existing + * one (PATCH). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} entityName Name of the hybrid connection configuration. + * + * @param {object} connectionEnvelope Details of the hybrid connection + * configuration. + * + * @param {string} [connectionEnvelope.entityName] + * + * @param {string} [connectionEnvelope.entityConnectionString] + * + * @param {string} [connectionEnvelope.resourceType] + * + * @param {string} [connectionEnvelope.resourceConnectionString] + * + * @param {string} [connectionEnvelope.hostname] + * + * @param {number} [connectionEnvelope.port] + * + * @param {string} [connectionEnvelope.biztalkUri] + * + * @param {string} [connectionEnvelope.kind] Kind of resource. + * + * @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. + */ + createOrUpdateRelayServiceConnectionWithHttpOperationResponse(resourceGroupName: string, name: string, entityName: string, connectionEnvelope: models.RelayServiceConnectionEntity, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Creates a new hybrid connection configuration (PUT), or updates an + * existing one (PATCH). + * + * Creates a new hybrid connection configuration (PUT), or updates an existing + * one (PATCH). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} entityName Name of the hybrid connection configuration. + * + * @param {object} connectionEnvelope Details of the hybrid connection + * configuration. + * + * @param {string} [connectionEnvelope.entityName] + * + * @param {string} [connectionEnvelope.entityConnectionString] + * + * @param {string} [connectionEnvelope.resourceType] + * + * @param {string} [connectionEnvelope.resourceConnectionString] + * + * @param {string} [connectionEnvelope.hostname] + * + * @param {number} [connectionEnvelope.port] + * + * @param {string} [connectionEnvelope.biztalkUri] + * + * @param {string} [connectionEnvelope.kind] Kind of resource. + * + * @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 {RelayServiceConnectionEntity} - 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. + * + * {RelayServiceConnectionEntity} [result] - The deserialized result object if an error did not occur. + * See {@link RelayServiceConnectionEntity} 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. + */ + createOrUpdateRelayServiceConnection(resourceGroupName: string, name: string, entityName: string, connectionEnvelope: models.RelayServiceConnectionEntity, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdateRelayServiceConnection(resourceGroupName: string, name: string, entityName: string, connectionEnvelope: models.RelayServiceConnectionEntity, callback: ServiceCallback): void; + createOrUpdateRelayServiceConnection(resourceGroupName: string, name: string, entityName: string, connectionEnvelope: models.RelayServiceConnectionEntity, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Deletes a relay service connection by its name. + * + * Deletes a relay service connection by its name. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} entityName Name of the hybrid connection configuration. + * + * @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. + */ + deleteRelayServiceConnectionWithHttpOperationResponse(resourceGroupName: string, name: string, entityName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Deletes a relay service connection by its name. + * + * Deletes a relay service connection by its name. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} entityName Name of the hybrid connection configuration. + * + * @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 {null} - 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. + * + * {null} [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. + */ + deleteRelayServiceConnection(resourceGroupName: string, name: string, entityName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteRelayServiceConnection(resourceGroupName: string, name: string, entityName: string, callback: ServiceCallback): void; + deleteRelayServiceConnection(resourceGroupName: string, name: string, entityName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Creates a new hybrid connection configuration (PUT), or updates an + * existing one (PATCH). + * + * Creates a new hybrid connection configuration (PUT), or updates an existing + * one (PATCH). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} entityName Name of the hybrid connection configuration. + * + * @param {object} connectionEnvelope Details of the hybrid connection + * configuration. + * + * @param {string} [connectionEnvelope.entityName] + * + * @param {string} [connectionEnvelope.entityConnectionString] + * + * @param {string} [connectionEnvelope.resourceType] + * + * @param {string} [connectionEnvelope.resourceConnectionString] + * + * @param {string} [connectionEnvelope.hostname] + * + * @param {number} [connectionEnvelope.port] + * + * @param {string} [connectionEnvelope.biztalkUri] + * + * @param {string} [connectionEnvelope.kind] Kind of resource. + * + * @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. + */ + updateRelayServiceConnectionWithHttpOperationResponse(resourceGroupName: string, name: string, entityName: string, connectionEnvelope: models.RelayServiceConnectionEntity, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Creates a new hybrid connection configuration (PUT), or updates an + * existing one (PATCH). + * + * Creates a new hybrid connection configuration (PUT), or updates an existing + * one (PATCH). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} entityName Name of the hybrid connection configuration. + * + * @param {object} connectionEnvelope Details of the hybrid connection + * configuration. + * + * @param {string} [connectionEnvelope.entityName] + * + * @param {string} [connectionEnvelope.entityConnectionString] + * + * @param {string} [connectionEnvelope.resourceType] + * + * @param {string} [connectionEnvelope.resourceConnectionString] + * + * @param {string} [connectionEnvelope.hostname] + * + * @param {number} [connectionEnvelope.port] + * + * @param {string} [connectionEnvelope.biztalkUri] + * + * @param {string} [connectionEnvelope.kind] Kind of resource. + * + * @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 {RelayServiceConnectionEntity} - 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. + * + * {RelayServiceConnectionEntity} [result] - The deserialized result object if an error did not occur. + * See {@link RelayServiceConnectionEntity} 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. + */ + updateRelayServiceConnection(resourceGroupName: string, name: string, entityName: string, connectionEnvelope: models.RelayServiceConnectionEntity, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + updateRelayServiceConnection(resourceGroupName: string, name: string, entityName: string, connectionEnvelope: models.RelayServiceConnectionEntity, callback: ServiceCallback): void; + updateRelayServiceConnection(resourceGroupName: string, name: string, entityName: string, connectionEnvelope: models.RelayServiceConnectionEntity, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Gets all scale-out instances of an app. + * + * Gets all scale-out instances of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @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. + */ + listInstanceIdentifiersWithHttpOperationResponse(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets all scale-out instances of an app. + * + * Gets all scale-out instances of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @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 {WebAppInstanceCollection} - 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. + * + * {WebAppInstanceCollection} [result] - The deserialized result object if an error did not occur. + * See {@link WebAppInstanceCollection} 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. + */ + listInstanceIdentifiers(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listInstanceIdentifiers(resourceGroupName: string, name: string, callback: ServiceCallback): void; + listInstanceIdentifiers(resourceGroupName: string, name: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Get the status of the last MSDeploy operation. + * + * Get the status of the last MSDeploy operation. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {string} instanceId ID of web app instance. + * + * @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. + */ + getInstanceMsDeployStatusWithHttpOperationResponse(resourceGroupName: string, name: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get the status of the last MSDeploy operation. + * + * Get the status of the last MSDeploy operation. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {string} instanceId ID of web app instance. + * + * @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 {MSDeployStatus} - 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. + * + * {MSDeployStatus} [result] - The deserialized result object if an error did not occur. + * See {@link MSDeployStatus} 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. + */ + getInstanceMsDeployStatus(resourceGroupName: string, name: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getInstanceMsDeployStatus(resourceGroupName: string, name: string, instanceId: string, callback: ServiceCallback): void; + getInstanceMsDeployStatus(resourceGroupName: string, name: string, instanceId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Invoke the MSDeploy web app extension. + * + * Invoke the MSDeploy web app extension. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {string} instanceId ID of web app instance. + * + * @param {object} mSDeploy Details of MSDeploy operation + * + * @param {string} [mSDeploy.packageUri] Package URI + * + * @param {string} [mSDeploy.connectionString] SQL Connection String + * + * @param {string} [mSDeploy.dbType] Database Type + * + * @param {string} [mSDeploy.setParametersXmlFileUri] URI of MSDeploy + * Parameters file. Must not be set if SetParameters is used. + * + * @param {object} [mSDeploy.setParameters] MSDeploy Parameters. Must not be + * set if SetParametersXmlFileUri is used. + * + * @param {boolean} [mSDeploy.skipAppData] Controls whether the MSDeploy + * operation skips the App_Data directory. + * If set to true, the existing App_Data directory on the + * destination + * will not be deleted, and any App_Data directory in the source will be + * ignored. + * Setting is false by default. + * + * @param {boolean} [mSDeploy.appOffline] Sets the AppOffline rule while the + * MSDeploy operation executes. + * Setting is false by default. + * + * @param {string} [mSDeploy.kind] Kind of resource. + * + * @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. + */ + createInstanceMSDeployOperationWithHttpOperationResponse(resourceGroupName: string, name: string, instanceId: string, mSDeploy: models.MSDeploy, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Invoke the MSDeploy web app extension. + * + * Invoke the MSDeploy web app extension. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {string} instanceId ID of web app instance. + * + * @param {object} mSDeploy Details of MSDeploy operation + * + * @param {string} [mSDeploy.packageUri] Package URI + * + * @param {string} [mSDeploy.connectionString] SQL Connection String + * + * @param {string} [mSDeploy.dbType] Database Type + * + * @param {string} [mSDeploy.setParametersXmlFileUri] URI of MSDeploy + * Parameters file. Must not be set if SetParameters is used. + * + * @param {object} [mSDeploy.setParameters] MSDeploy Parameters. Must not be + * set if SetParametersXmlFileUri is used. + * + * @param {boolean} [mSDeploy.skipAppData] Controls whether the MSDeploy + * operation skips the App_Data directory. + * If set to true, the existing App_Data directory on the + * destination + * will not be deleted, and any App_Data directory in the source will be + * ignored. + * Setting is false by default. + * + * @param {boolean} [mSDeploy.appOffline] Sets the AppOffline rule while the + * MSDeploy operation executes. + * Setting is false by default. + * + * @param {string} [mSDeploy.kind] Kind of resource. + * + * @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 {MSDeployStatus} - 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. + * + * {MSDeployStatus} [result] - The deserialized result object if an error did not occur. + * See {@link MSDeployStatus} 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. + */ + createInstanceMSDeployOperation(resourceGroupName: string, name: string, instanceId: string, mSDeploy: models.MSDeploy, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createInstanceMSDeployOperation(resourceGroupName: string, name: string, instanceId: string, mSDeploy: models.MSDeploy, callback: ServiceCallback): void; + createInstanceMSDeployOperation(resourceGroupName: string, name: string, instanceId: string, mSDeploy: models.MSDeploy, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Get the MSDeploy Log for the last MSDeploy operation. + * + * Get the MSDeploy Log for the last MSDeploy operation. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {string} instanceId ID of web app instance. + * + * @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. + */ + getInstanceMSDeployLogWithHttpOperationResponse(resourceGroupName: string, name: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get the MSDeploy Log for the last MSDeploy operation. + * + * Get the MSDeploy Log for the last MSDeploy operation. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {string} instanceId ID of web app instance. + * + * @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 {MSDeployLog} - 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. + * + * {MSDeployLog} [result] - The deserialized result object if an error did not occur. + * See {@link MSDeployLog} 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. + */ + getInstanceMSDeployLog(resourceGroupName: string, name: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getInstanceMSDeployLog(resourceGroupName: string, name: string, instanceId: string, callback: ServiceCallback): void; + getInstanceMSDeployLog(resourceGroupName: string, name: string, instanceId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Get list of processes for a web site, or a deployment slot, or for + * a specific scaled-out instance in a web site. + * + * Get list of processes for a web site, or a deployment slot, or for a + * specific scaled-out instance in a web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} instanceId ID of a specific scaled-out instance. This is the + * value of the name property in the JSON response from "GET + * api/sites/{siteName}/instances". + * + * @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. + */ + listInstanceProcessesWithHttpOperationResponse(resourceGroupName: string, name: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get list of processes for a web site, or a deployment slot, or for + * a specific scaled-out instance in a web site. + * + * Get list of processes for a web site, or a deployment slot, or for a + * specific scaled-out instance in a web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} instanceId ID of a specific scaled-out instance. This is the + * value of the name property in the JSON response from "GET + * api/sites/{siteName}/instances". + * + * @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 {ProcessInfoCollection} - 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. + * + * {ProcessInfoCollection} [result] - The deserialized result object if an error did not occur. + * See {@link ProcessInfoCollection} 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. + */ + listInstanceProcesses(resourceGroupName: string, name: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listInstanceProcesses(resourceGroupName: string, name: string, instanceId: string, callback: ServiceCallback): void; + listInstanceProcesses(resourceGroupName: string, name: string, instanceId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Get process information by its ID for a specific scaled-out + * instance in a web site. + * + * Get process information by its ID for a specific scaled-out instance in a + * web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @param {string} instanceId ID of a specific scaled-out instance. This is the + * value of the name property in the JSON response from "GET + * api/sites/{siteName}/instances". + * + * @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. + */ + getInstanceProcessWithHttpOperationResponse(resourceGroupName: string, name: string, processId: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get process information by its ID for a specific scaled-out + * instance in a web site. + * + * Get process information by its ID for a specific scaled-out instance in a + * web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @param {string} instanceId ID of a specific scaled-out instance. This is the + * value of the name property in the JSON response from "GET + * api/sites/{siteName}/instances". + * + * @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 {ProcessInfo} - 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. + * + * {ProcessInfo} [result] - The deserialized result object if an error did not occur. + * See {@link ProcessInfo} 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. + */ + getInstanceProcess(resourceGroupName: string, name: string, processId: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getInstanceProcess(resourceGroupName: string, name: string, processId: string, instanceId: string, callback: ServiceCallback): void; + getInstanceProcess(resourceGroupName: string, name: string, processId: string, instanceId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Terminate a process by its ID for a web site, or a deployment slot, + * or specific scaled-out instance in a web site. + * + * Terminate a process by its ID for a web site, or a deployment slot, or + * specific scaled-out instance in a web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @param {string} instanceId ID of a specific scaled-out instance. This is the + * value of the name property in the JSON response from "GET + * api/sites/{siteName}/instances". + * + * @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. + */ + deleteInstanceProcessWithHttpOperationResponse(resourceGroupName: string, name: string, processId: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Terminate a process by its ID for a web site, or a deployment slot, + * or specific scaled-out instance in a web site. + * + * Terminate a process by its ID for a web site, or a deployment slot, or + * specific scaled-out instance in a web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @param {string} instanceId ID of a specific scaled-out instance. This is the + * value of the name property in the JSON response from "GET + * api/sites/{siteName}/instances". + * + * @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 {null} - 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. + * + * {null} [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. + */ + deleteInstanceProcess(resourceGroupName: string, name: string, processId: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteInstanceProcess(resourceGroupName: string, name: string, processId: string, instanceId: string, callback: ServiceCallback): void; + deleteInstanceProcess(resourceGroupName: string, name: string, processId: string, instanceId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Get a memory dump of a process by its ID for a specific scaled-out + * instance in a web site. + * + * Get a memory dump of a process by its ID for a specific scaled-out instance + * in a web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @param {string} instanceId ID of a specific scaled-out instance. This is the + * value of the name property in the JSON response from "GET + * api/sites/{siteName}/instances". + * + * @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. + */ + getInstanceProcessDumpWithHttpOperationResponse(resourceGroupName: string, name: string, processId: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get a memory dump of a process by its ID for a specific scaled-out + * instance in a web site. + * + * Get a memory dump of a process by its ID for a specific scaled-out instance + * in a web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @param {string} instanceId ID of a specific scaled-out instance. This is the + * value of the name property in the JSON response from "GET + * api/sites/{siteName}/instances". + * + * @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 {Object} - 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. + * + * {Object} [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. + */ + getInstanceProcessDump(resourceGroupName: string, name: string, processId: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getInstanceProcessDump(resourceGroupName: string, name: string, processId: string, instanceId: string, callback: ServiceCallback): void; + getInstanceProcessDump(resourceGroupName: string, name: string, processId: string, instanceId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary List module information for a process by its ID for a specific + * scaled-out instance in a web site. + * + * List module information for a process by its ID for a specific scaled-out + * instance in a web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @param {string} instanceId ID of a specific scaled-out instance. This is the + * value of the name property in the JSON response from "GET + * api/sites/{siteName}/instances". + * + * @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. + */ + listInstanceProcessModulesWithHttpOperationResponse(resourceGroupName: string, name: string, processId: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary List module information for a process by its ID for a specific + * scaled-out instance in a web site. + * + * List module information for a process by its ID for a specific scaled-out + * instance in a web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @param {string} instanceId ID of a specific scaled-out instance. This is the + * value of the name property in the JSON response from "GET + * api/sites/{siteName}/instances". + * + * @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 {ProcessModuleInfoCollection} - 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. + * + * {ProcessModuleInfoCollection} [result] - The deserialized result object if an error did not occur. + * See {@link ProcessModuleInfoCollection} 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. + */ + listInstanceProcessModules(resourceGroupName: string, name: string, processId: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listInstanceProcessModules(resourceGroupName: string, name: string, processId: string, instanceId: string, callback: ServiceCallback): void; + listInstanceProcessModules(resourceGroupName: string, name: string, processId: string, instanceId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Get process information by its ID for a specific scaled-out + * instance in a web site. + * + * Get process information by its ID for a specific scaled-out instance in a + * web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @param {string} baseAddress Module base address. + * + * @param {string} instanceId ID of a specific scaled-out instance. This is the + * value of the name property in the JSON response from "GET + * api/sites/{siteName}/instances". + * + * @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. + */ + getInstanceProcessModuleWithHttpOperationResponse(resourceGroupName: string, name: string, processId: string, baseAddress: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get process information by its ID for a specific scaled-out + * instance in a web site. + * + * Get process information by its ID for a specific scaled-out instance in a + * web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @param {string} baseAddress Module base address. + * + * @param {string} instanceId ID of a specific scaled-out instance. This is the + * value of the name property in the JSON response from "GET + * api/sites/{siteName}/instances". + * + * @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 {ProcessModuleInfo} - 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. + * + * {ProcessModuleInfo} [result] - The deserialized result object if an error did not occur. + * See {@link ProcessModuleInfo} 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. + */ + getInstanceProcessModule(resourceGroupName: string, name: string, processId: string, baseAddress: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getInstanceProcessModule(resourceGroupName: string, name: string, processId: string, baseAddress: string, instanceId: string, callback: ServiceCallback): void; + getInstanceProcessModule(resourceGroupName: string, name: string, processId: string, baseAddress: string, instanceId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary List the threads in a process by its ID for a specific scaled-out + * instance in a web site. + * + * List the threads in a process by its ID for a specific scaled-out instance + * in a web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @param {string} instanceId ID of a specific scaled-out instance. This is the + * value of the name property in the JSON response from "GET + * api/sites/{siteName}/instances". + * + * @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. + */ + listInstanceProcessThreadsWithHttpOperationResponse(resourceGroupName: string, name: string, processId: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary List the threads in a process by its ID for a specific scaled-out + * instance in a web site. + * + * List the threads in a process by its ID for a specific scaled-out instance + * in a web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @param {string} instanceId ID of a specific scaled-out instance. This is the + * value of the name property in the JSON response from "GET + * api/sites/{siteName}/instances". + * + * @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 {ProcessThreadInfoCollection} - 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. + * + * {ProcessThreadInfoCollection} [result] - The deserialized result object if an error did not occur. + * See {@link ProcessThreadInfoCollection} 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. + */ + listInstanceProcessThreads(resourceGroupName: string, name: string, processId: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listInstanceProcessThreads(resourceGroupName: string, name: string, processId: string, instanceId: string, callback: ServiceCallback): void; + listInstanceProcessThreads(resourceGroupName: string, name: string, processId: string, instanceId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Get thread information by Thread ID for a specific process, in a + * specific scaled-out instance in a web site. + * + * Get thread information by Thread ID for a specific process, in a specific + * scaled-out instance in a web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @param {string} threadId TID. + * + * @param {string} instanceId ID of a specific scaled-out instance. This is the + * value of the name property in the JSON response from "GET + * api/sites/{siteName}/instances". + * + * @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. + */ + getInstanceProcessThreadWithHttpOperationResponse(resourceGroupName: string, name: string, processId: string, threadId: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get thread information by Thread ID for a specific process, in a + * specific scaled-out instance in a web site. + * + * Get thread information by Thread ID for a specific process, in a specific + * scaled-out instance in a web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @param {string} threadId TID. + * + * @param {string} instanceId ID of a specific scaled-out instance. This is the + * value of the name property in the JSON response from "GET + * api/sites/{siteName}/instances". + * + * @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 {ProcessThreadInfo} - 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. + * + * {ProcessThreadInfo} [result] - The deserialized result object if an error did not occur. + * See {@link ProcessThreadInfo} 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. + */ + getInstanceProcessThread(resourceGroupName: string, name: string, processId: string, threadId: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getInstanceProcessThread(resourceGroupName: string, name: string, processId: string, threadId: string, instanceId: string, callback: ServiceCallback): void; + getInstanceProcessThread(resourceGroupName: string, name: string, processId: string, threadId: string, instanceId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Shows whether an app can be cloned to another resource group or + * subscription. + * + * Shows whether an app can be cloned to another resource group or + * subscription. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @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. + */ + isCloneableWithHttpOperationResponse(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Shows whether an app can be cloned to another resource group or + * subscription. + * + * Shows whether an app can be cloned to another resource group or + * subscription. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @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 {SiteCloneability} - 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. + * + * {SiteCloneability} [result] - The deserialized result object if an error did not occur. + * See {@link SiteCloneability} 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. + */ + isCloneable(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + isCloneable(resourceGroupName: string, name: string, callback: ServiceCallback): void; + isCloneable(resourceGroupName: string, name: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary This is to allow calling via powershell and ARM template. + * + * This is to allow calling via powershell and ARM template. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @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. + */ + listSyncFunctionTriggersWithHttpOperationResponse(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary This is to allow calling via powershell and ARM template. + * + * This is to allow calling via powershell and ARM template. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @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 {FunctionSecrets} - 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. + * + * {FunctionSecrets} [result] - The deserialized result object if an error did not occur. + * See {@link FunctionSecrets} 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. + */ + listSyncFunctionTriggers(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listSyncFunctionTriggers(resourceGroupName: string, name: string, callback: ServiceCallback): void; + listSyncFunctionTriggers(resourceGroupName: string, name: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Gets all metric definitions of an app (or deployment slot, if + * specified). + * + * Gets all metric definitions of an app (or deployment slot, if specified). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @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. + */ + listMetricDefinitionsWithHttpOperationResponse(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets all metric definitions of an app (or deployment slot, if + * specified). + * + * Gets all metric definitions of an app (or deployment slot, if specified). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @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 {ResourceMetricDefinitionCollection} - 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. + * + * {ResourceMetricDefinitionCollection} [result] - The deserialized result object if an error did not occur. + * See {@link ResourceMetricDefinitionCollection} 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. + */ + listMetricDefinitions(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listMetricDefinitions(resourceGroupName: string, name: string, callback: ServiceCallback): void; + listMetricDefinitions(resourceGroupName: string, name: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Gets performance metrics of an app (or deployment slot, if + * specified). + * + * Gets performance metrics of an app (or deployment slot, if specified). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} [options] Optional Parameters. + * + * @param {boolean} [options.details] Specify "true" to include metric details + * in the response. It is "false" by default. + * + * @param {string} [options.filter] Return only metrics specified in the filter + * (using OData syntax). For example: $filter=(name.value eq 'Metric1' or + * name.value eq 'Metric2') and startTime eq 2014-01-01T00:00:00Z and endTime + * eq 2014-12-31T23:59:59Z and timeGrain eq duration'[Hour|Minute|Day]'. + * + * @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. + */ + listMetricsWithHttpOperationResponse(resourceGroupName: string, name: string, options?: { details? : boolean, filter? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets performance metrics of an app (or deployment slot, if + * specified). + * + * Gets performance metrics of an app (or deployment slot, if specified). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} [options] Optional Parameters. + * + * @param {boolean} [options.details] Specify "true" to include metric details + * in the response. It is "false" by default. + * + * @param {string} [options.filter] Return only metrics specified in the filter + * (using OData syntax). For example: $filter=(name.value eq 'Metric1' or + * name.value eq 'Metric2') and startTime eq 2014-01-01T00:00:00Z and endTime + * eq 2014-12-31T23:59:59Z and timeGrain eq duration'[Hour|Minute|Day]'. + * + * @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 {ResourceMetricCollection} - 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. + * + * {ResourceMetricCollection} [result] - The deserialized result object if an error did not occur. + * See {@link ResourceMetricCollection} 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. + */ + listMetrics(resourceGroupName: string, name: string, options?: { details? : boolean, filter? : string, customHeaders? : { [headerName: string]: string; } }): Promise; + listMetrics(resourceGroupName: string, name: string, callback: ServiceCallback): void; + listMetrics(resourceGroupName: string, name: string, options: { details? : boolean, filter? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Restores a web app. + * + * Restores a web app. + * + * @param {string} subscriptionName Azure subscription. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {object} migrationOptions Migration migrationOptions. + * + * @param {string} migrationOptions.azurefilesConnectionString AzureFiles + * connection string. + * + * @param {string} migrationOptions.azurefilesShare AzureFiles share. + * + * @param {boolean} [migrationOptions.switchSiteAfterMigration] + * trueif the app should be switched over; otherwise, + * false. + * + * @param {boolean} [migrationOptions.blockWriteAccessToSite] true + * if the app should be read only during copy operation; otherwise, + * false. + * + * @param {string} [migrationOptions.kind] Kind of resource. + * + * @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. + */ + migrateStorageWithHttpOperationResponse(subscriptionName: string, resourceGroupName: string, name: string, migrationOptions: models.StorageMigrationOptions, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Restores a web app. + * + * Restores a web app. + * + * @param {string} subscriptionName Azure subscription. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {object} migrationOptions Migration migrationOptions. + * + * @param {string} migrationOptions.azurefilesConnectionString AzureFiles + * connection string. + * + * @param {string} migrationOptions.azurefilesShare AzureFiles share. + * + * @param {boolean} [migrationOptions.switchSiteAfterMigration] + * trueif the app should be switched over; otherwise, + * false. + * + * @param {boolean} [migrationOptions.blockWriteAccessToSite] true + * if the app should be read only during copy operation; otherwise, + * false. + * + * @param {string} [migrationOptions.kind] Kind of resource. + * + * @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 {StorageMigrationResponse} - 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. + * + * {StorageMigrationResponse} [result] - The deserialized result object if an error did not occur. + * See {@link StorageMigrationResponse} 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. + */ + migrateStorage(subscriptionName: string, resourceGroupName: string, name: string, migrationOptions: models.StorageMigrationOptions, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + migrateStorage(subscriptionName: string, resourceGroupName: string, name: string, migrationOptions: models.StorageMigrationOptions, callback: ServiceCallback): void; + migrateStorage(subscriptionName: string, resourceGroupName: string, name: string, migrationOptions: models.StorageMigrationOptions, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Migrates a local (in-app) MySql database to a remote MySql + * database. + * + * Migrates a local (in-app) MySql database to a remote MySql database. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {object} migrationRequestEnvelope MySql migration options. + * + * @param {string} migrationRequestEnvelope.connectionString Connection string + * to the remote MySQL database. + * + * @param {string} migrationRequestEnvelope.migrationType The type of migration + * operation to be done. Possible values include: 'LocalToRemote', + * 'RemoteToLocal' + * + * @param {string} [migrationRequestEnvelope.kind] Kind of resource. + * + * @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. + */ + migrateMySqlWithHttpOperationResponse(resourceGroupName: string, name: string, migrationRequestEnvelope: models.MigrateMySqlRequest, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Migrates a local (in-app) MySql database to a remote MySql + * database. + * + * Migrates a local (in-app) MySql database to a remote MySql database. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {object} migrationRequestEnvelope MySql migration options. + * + * @param {string} migrationRequestEnvelope.connectionString Connection string + * to the remote MySQL database. + * + * @param {string} migrationRequestEnvelope.migrationType The type of migration + * operation to be done. Possible values include: 'LocalToRemote', + * 'RemoteToLocal' + * + * @param {string} [migrationRequestEnvelope.kind] Kind of resource. + * + * @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 {Operation} - 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. + * + * {Operation} [result] - The deserialized result object if an error did not occur. + * See {@link Operation} 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. + */ + migrateMySql(resourceGroupName: string, name: string, migrationRequestEnvelope: models.MigrateMySqlRequest, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + migrateMySql(resourceGroupName: string, name: string, migrationRequestEnvelope: models.MigrateMySqlRequest, callback: ServiceCallback): void; + migrateMySql(resourceGroupName: string, name: string, migrationRequestEnvelope: models.MigrateMySqlRequest, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Returns the status of MySql in app migration, if one is active, and + * whether or not MySql in app is enabled + * + * Returns the status of MySql in app migration, if one is active, and whether + * or not MySql in app is enabled + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @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. + */ + getMigrateMySqlStatusWithHttpOperationResponse(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Returns the status of MySql in app migration, if one is active, and + * whether or not MySql in app is enabled + * + * Returns the status of MySql in app migration, if one is active, and whether + * or not MySql in app is enabled + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @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 {MigrateMySqlStatus} - 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. + * + * {MigrateMySqlStatus} [result] - The deserialized result object if an error did not occur. + * See {@link MigrateMySqlStatus} 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. + */ + getMigrateMySqlStatus(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getMigrateMySqlStatus(resourceGroupName: string, name: string, callback: ServiceCallback): void; + getMigrateMySqlStatus(resourceGroupName: string, name: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Gets all network features used by the app (or deployment slot, if + * specified). + * + * Gets all network features used by the app (or deployment slot, if + * specified). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} view The type of view. This can either be "summary" or + * "detailed". + * + * @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. + */ + listNetworkFeaturesWithHttpOperationResponse(resourceGroupName: string, name: string, view: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets all network features used by the app (or deployment slot, if + * specified). + * + * Gets all network features used by the app (or deployment slot, if + * specified). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} view The type of view. This can either be "summary" or + * "detailed". + * + * @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 {NetworkFeatures} - 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. + * + * {NetworkFeatures} [result] - The deserialized result object if an error did not occur. + * See {@link NetworkFeatures} 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. + */ + listNetworkFeatures(resourceGroupName: string, name: string, view: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listNetworkFeatures(resourceGroupName: string, name: string, view: string, callback: ServiceCallback): void; + listNetworkFeatures(resourceGroupName: string, name: string, view: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Start capturing network packets for the site. + * + * Start capturing network packets for the site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.durationInSeconds] The duration to keep capturing + * in seconds. + * + * @param {number} [options.maxFrameLength] The maximum frame length in bytes + * (Optional). + * + * @param {string} [options.sasUrl] The Blob URL to store capture file. + * + * @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. + */ + startWebSiteNetworkTraceWithHttpOperationResponse(resourceGroupName: string, name: string, options?: { durationInSeconds? : number, maxFrameLength? : number, sasUrl? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Start capturing network packets for the site. + * + * Start capturing network packets for the site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.durationInSeconds] The duration to keep capturing + * in seconds. + * + * @param {number} [options.maxFrameLength] The maximum frame length in bytes + * (Optional). + * + * @param {string} [options.sasUrl] The Blob URL to store capture file. + * + * @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 {String} - 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. + * + * {String} [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. + */ + startWebSiteNetworkTrace(resourceGroupName: string, name: string, options?: { durationInSeconds? : number, maxFrameLength? : number, sasUrl? : string, customHeaders? : { [headerName: string]: string; } }): Promise; + startWebSiteNetworkTrace(resourceGroupName: string, name: string, callback: ServiceCallback): void; + startWebSiteNetworkTrace(resourceGroupName: string, name: string, options: { durationInSeconds? : number, maxFrameLength? : number, sasUrl? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Stop ongoing capturing network packets for the site. + * + * Stop ongoing capturing network packets for the site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @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. + */ + stopWebSiteNetworkTraceWithHttpOperationResponse(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Stop ongoing capturing network packets for the site. + * + * Stop ongoing capturing network packets for the site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @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 {String} - 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. + * + * {String} [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. + */ + stopWebSiteNetworkTrace(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + stopWebSiteNetworkTrace(resourceGroupName: string, name: string, callback: ServiceCallback): void; + stopWebSiteNetworkTrace(resourceGroupName: string, name: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Generates a new publishing password for an app (or deployment slot, + * if specified). + * + * Generates a new publishing password for an app (or deployment slot, if + * specified). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @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. + */ + generateNewSitePublishingPasswordWithHttpOperationResponse(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Generates a new publishing password for an app (or deployment slot, + * if specified). + * + * Generates a new publishing password for an app (or deployment slot, if + * specified). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @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 {null} - 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. + * + * {null} [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. + */ + generateNewSitePublishingPassword(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + generateNewSitePublishingPassword(resourceGroupName: string, name: string, callback: ServiceCallback): void; + generateNewSitePublishingPassword(resourceGroupName: string, name: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Gets perfmon counters for web app. + * + * Gets perfmon counters for web app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.filter] Return only usages/metrics specified in the + * filter. Filter conforms to odata syntax. Example: $filter=(startTime eq + * 2014-01-01T00:00:00Z and endTime eq 2014-12-31T23:59:59Z and timeGrain eq + * duration'[Hour|Minute|Day]'. + * + * @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. + */ + listPerfMonCountersWithHttpOperationResponse(resourceGroupName: string, name: string, options?: { filter? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets perfmon counters for web app. + * + * Gets perfmon counters for web app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.filter] Return only usages/metrics specified in the + * filter. Filter conforms to odata syntax. Example: $filter=(startTime eq + * 2014-01-01T00:00:00Z and endTime eq 2014-12-31T23:59:59Z and timeGrain eq + * duration'[Hour|Minute|Day]'. + * + * @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 {PerfMonCounterCollection} - 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. + * + * {PerfMonCounterCollection} [result] - The deserialized result object if an error did not occur. + * See {@link PerfMonCounterCollection} 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. + */ + listPerfMonCounters(resourceGroupName: string, name: string, options?: { filter? : string, customHeaders? : { [headerName: string]: string; } }): Promise; + listPerfMonCounters(resourceGroupName: string, name: string, callback: ServiceCallback): void; + listPerfMonCounters(resourceGroupName: string, name: string, options: { filter? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Gets web app's event logs. + * + * Gets web app's event logs. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @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. + */ + getSitePhpErrorLogFlagWithHttpOperationResponse(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets web app's event logs. + * + * Gets web app's event logs. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @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 {SitePhpErrorLogFlag} - 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. + * + * {SitePhpErrorLogFlag} [result] - The deserialized result object if an error did not occur. + * See {@link SitePhpErrorLogFlag} 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. + */ + getSitePhpErrorLogFlag(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getSitePhpErrorLogFlag(resourceGroupName: string, name: string, callback: ServiceCallback): void; + getSitePhpErrorLogFlag(resourceGroupName: string, name: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Gets the premier add-ons of an app. + * + * Gets the premier add-ons of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @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. + */ + listPremierAddOnsWithHttpOperationResponse(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets the premier add-ons of an app. + * + * Gets the premier add-ons of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @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 {PremierAddOn} - 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. + * + * {PremierAddOn} [result] - The deserialized result object if an error did not occur. + * See {@link PremierAddOn} 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. + */ + listPremierAddOns(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listPremierAddOns(resourceGroupName: string, name: string, callback: ServiceCallback): void; + listPremierAddOns(resourceGroupName: string, name: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Gets a named add-on of an app. + * + * Gets a named add-on of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} premierAddOnName Add-on name. + * + * @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. + */ + getPremierAddOnWithHttpOperationResponse(resourceGroupName: string, name: string, premierAddOnName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets a named add-on of an app. + * + * Gets a named add-on of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} premierAddOnName Add-on name. + * + * @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 {PremierAddOn} - 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. + * + * {PremierAddOn} [result] - The deserialized result object if an error did not occur. + * See {@link PremierAddOn} 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. + */ + getPremierAddOn(resourceGroupName: string, name: string, premierAddOnName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getPremierAddOn(resourceGroupName: string, name: string, premierAddOnName: string, callback: ServiceCallback): void; + getPremierAddOn(resourceGroupName: string, name: string, premierAddOnName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Updates a named add-on of an app. + * + * Updates a named add-on of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} premierAddOnName Add-on name. + * + * @param {object} premierAddOn A JSON representation of the edited premier + * add-on. + * + * @param {string} [premierAddOn.sku] Premier add on SKU. + * + * @param {string} [premierAddOn.product] Premier add on Product. + * + * @param {string} [premierAddOn.vendor] Premier add on Vendor. + * + * @param {string} [premierAddOn.marketplacePublisher] Premier add on + * Marketplace publisher. + * + * @param {string} [premierAddOn.marketplaceOffer] Premier add on Marketplace + * offer. + * + * @param {string} [premierAddOn.kind] Kind of resource. + * + * @param {string} premierAddOn.location Resource Location. + * + * @param {object} [premierAddOn.tags] Resource tags. + * + * @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. + */ + addPremierAddOnWithHttpOperationResponse(resourceGroupName: string, name: string, premierAddOnName: string, premierAddOn: models.PremierAddOn, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Updates a named add-on of an app. + * + * Updates a named add-on of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} premierAddOnName Add-on name. + * + * @param {object} premierAddOn A JSON representation of the edited premier + * add-on. + * + * @param {string} [premierAddOn.sku] Premier add on SKU. + * + * @param {string} [premierAddOn.product] Premier add on Product. + * + * @param {string} [premierAddOn.vendor] Premier add on Vendor. + * + * @param {string} [premierAddOn.marketplacePublisher] Premier add on + * Marketplace publisher. + * + * @param {string} [premierAddOn.marketplaceOffer] Premier add on Marketplace + * offer. + * + * @param {string} [premierAddOn.kind] Kind of resource. + * + * @param {string} premierAddOn.location Resource Location. + * + * @param {object} [premierAddOn.tags] Resource tags. + * + * @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 {PremierAddOn} - 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. + * + * {PremierAddOn} [result] - The deserialized result object if an error did not occur. + * See {@link PremierAddOn} 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. + */ + addPremierAddOn(resourceGroupName: string, name: string, premierAddOnName: string, premierAddOn: models.PremierAddOn, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + addPremierAddOn(resourceGroupName: string, name: string, premierAddOnName: string, premierAddOn: models.PremierAddOn, callback: ServiceCallback): void; + addPremierAddOn(resourceGroupName: string, name: string, premierAddOnName: string, premierAddOn: models.PremierAddOn, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Delete a premier add-on from an app. + * + * Delete a premier add-on from an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} premierAddOnName Add-on name. + * + * @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. + */ + deletePremierAddOnWithHttpOperationResponse(resourceGroupName: string, name: string, premierAddOnName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Delete a premier add-on from an app. + * + * Delete a premier add-on from an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} premierAddOnName Add-on name. + * + * @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 {null} - 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. + * + * {null} [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. + */ + deletePremierAddOn(resourceGroupName: string, name: string, premierAddOnName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deletePremierAddOn(resourceGroupName: string, name: string, premierAddOnName: string, callback: ServiceCallback): void; + deletePremierAddOn(resourceGroupName: string, name: string, premierAddOnName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Updates a named add-on of an app. + * + * Updates a named add-on of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} premierAddOnName Add-on name. + * + * @param {object} premierAddOn A JSON representation of the edited premier + * add-on. + * + * @param {string} [premierAddOn.sku] Premier add on SKU. + * + * @param {string} [premierAddOn.product] Premier add on Product. + * + * @param {string} [premierAddOn.vendor] Premier add on Vendor. + * + * @param {string} [premierAddOn.marketplacePublisher] Premier add on + * Marketplace publisher. + * + * @param {string} [premierAddOn.marketplaceOffer] Premier add on Marketplace + * offer. + * + * @param {string} [premierAddOn.kind] Kind of resource. + * + * @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. + */ + updatePremierAddOnWithHttpOperationResponse(resourceGroupName: string, name: string, premierAddOnName: string, premierAddOn: models.PremierAddOnPatchResource, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Updates a named add-on of an app. + * + * Updates a named add-on of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} premierAddOnName Add-on name. + * + * @param {object} premierAddOn A JSON representation of the edited premier + * add-on. + * + * @param {string} [premierAddOn.sku] Premier add on SKU. + * + * @param {string} [premierAddOn.product] Premier add on Product. + * + * @param {string} [premierAddOn.vendor] Premier add on Vendor. + * + * @param {string} [premierAddOn.marketplacePublisher] Premier add on + * Marketplace publisher. + * + * @param {string} [premierAddOn.marketplaceOffer] Premier add on Marketplace + * offer. + * + * @param {string} [premierAddOn.kind] Kind of resource. + * + * @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 {PremierAddOn} - 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. + * + * {PremierAddOn} [result] - The deserialized result object if an error did not occur. + * See {@link PremierAddOn} 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. + */ + updatePremierAddOn(resourceGroupName: string, name: string, premierAddOnName: string, premierAddOn: models.PremierAddOnPatchResource, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + updatePremierAddOn(resourceGroupName: string, name: string, premierAddOnName: string, premierAddOn: models.PremierAddOnPatchResource, callback: ServiceCallback): void; + updatePremierAddOn(resourceGroupName: string, name: string, premierAddOnName: string, premierAddOn: models.PremierAddOnPatchResource, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Gets data around private site access enablement and authorized + * Virtual Networks that can access the site. + * + * Gets data around private site access enablement and authorized Virtual + * Networks that can access the site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @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. + */ + getPrivateAccessWithHttpOperationResponse(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets data around private site access enablement and authorized + * Virtual Networks that can access the site. + * + * Gets data around private site access enablement and authorized Virtual + * Networks that can access the site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @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 {PrivateAccess} - 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. + * + * {PrivateAccess} [result] - The deserialized result object if an error did not occur. + * See {@link PrivateAccess} 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. + */ + getPrivateAccess(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getPrivateAccess(resourceGroupName: string, name: string, callback: ServiceCallback): void; + getPrivateAccess(resourceGroupName: string, name: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Sets data around private site access enablement and authorized + * Virtual Networks that can access the site. + * + * Sets data around private site access enablement and authorized Virtual + * Networks that can access the site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @param {object} access The information for the private access + * + * @param {boolean} [access.enabled] Whether private access is enabled or not. + * + * @param {array} [access.virtualNetworks] The Virtual Networks (and subnets) + * allowed to access the site privately. + * + * @param {string} [access.kind] Kind of resource. + * + * @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. + */ + putPrivateAccessVnetWithHttpOperationResponse(resourceGroupName: string, name: string, access: models.PrivateAccess, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Sets data around private site access enablement and authorized + * Virtual Networks that can access the site. + * + * Sets data around private site access enablement and authorized Virtual + * Networks that can access the site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @param {object} access The information for the private access + * + * @param {boolean} [access.enabled] Whether private access is enabled or not. + * + * @param {array} [access.virtualNetworks] The Virtual Networks (and subnets) + * allowed to access the site privately. + * + * @param {string} [access.kind] Kind of resource. + * + * @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 {PrivateAccess} - 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. + * + * {PrivateAccess} [result] - The deserialized result object if an error did not occur. + * See {@link PrivateAccess} 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. + */ + putPrivateAccessVnet(resourceGroupName: string, name: string, access: models.PrivateAccess, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + putPrivateAccessVnet(resourceGroupName: string, name: string, access: models.PrivateAccess, callback: ServiceCallback): void; + putPrivateAccessVnet(resourceGroupName: string, name: string, access: models.PrivateAccess, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Get list of processes for a web site, or a deployment slot, or for + * a specific scaled-out instance in a web site. + * + * Get list of processes for a web site, or a deployment slot, or for a + * specific scaled-out instance in a web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @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. + */ + listProcessesWithHttpOperationResponse(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get list of processes for a web site, or a deployment slot, or for + * a specific scaled-out instance in a web site. + * + * Get list of processes for a web site, or a deployment slot, or for a + * specific scaled-out instance in a web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @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 {ProcessInfoCollection} - 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. + * + * {ProcessInfoCollection} [result] - The deserialized result object if an error did not occur. + * See {@link ProcessInfoCollection} 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. + */ + listProcesses(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listProcesses(resourceGroupName: string, name: string, callback: ServiceCallback): void; + listProcesses(resourceGroupName: string, name: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Get process information by its ID for a specific scaled-out + * instance in a web site. + * + * Get process information by its ID for a specific scaled-out instance in a + * web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @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. + */ + getProcessWithHttpOperationResponse(resourceGroupName: string, name: string, processId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get process information by its ID for a specific scaled-out + * instance in a web site. + * + * Get process information by its ID for a specific scaled-out instance in a + * web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @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 {ProcessInfo} - 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. + * + * {ProcessInfo} [result] - The deserialized result object if an error did not occur. + * See {@link ProcessInfo} 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. + */ + getProcess(resourceGroupName: string, name: string, processId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getProcess(resourceGroupName: string, name: string, processId: string, callback: ServiceCallback): void; + getProcess(resourceGroupName: string, name: string, processId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Terminate a process by its ID for a web site, or a deployment slot, + * or specific scaled-out instance in a web site. + * + * Terminate a process by its ID for a web site, or a deployment slot, or + * specific scaled-out instance in a web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @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. + */ + deleteProcessWithHttpOperationResponse(resourceGroupName: string, name: string, processId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Terminate a process by its ID for a web site, or a deployment slot, + * or specific scaled-out instance in a web site. + * + * Terminate a process by its ID for a web site, or a deployment slot, or + * specific scaled-out instance in a web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @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 {null} - 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. + * + * {null} [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. + */ + deleteProcess(resourceGroupName: string, name: string, processId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteProcess(resourceGroupName: string, name: string, processId: string, callback: ServiceCallback): void; + deleteProcess(resourceGroupName: string, name: string, processId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Get a memory dump of a process by its ID for a specific scaled-out + * instance in a web site. + * + * Get a memory dump of a process by its ID for a specific scaled-out instance + * in a web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @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. + */ + getProcessDumpWithHttpOperationResponse(resourceGroupName: string, name: string, processId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get a memory dump of a process by its ID for a specific scaled-out + * instance in a web site. + * + * Get a memory dump of a process by its ID for a specific scaled-out instance + * in a web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @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 {Object} - 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. + * + * {Object} [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. + */ + getProcessDump(resourceGroupName: string, name: string, processId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getProcessDump(resourceGroupName: string, name: string, processId: string, callback: ServiceCallback): void; + getProcessDump(resourceGroupName: string, name: string, processId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary List module information for a process by its ID for a specific + * scaled-out instance in a web site. + * + * List module information for a process by its ID for a specific scaled-out + * instance in a web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @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. + */ + listProcessModulesWithHttpOperationResponse(resourceGroupName: string, name: string, processId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary List module information for a process by its ID for a specific + * scaled-out instance in a web site. + * + * List module information for a process by its ID for a specific scaled-out + * instance in a web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @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 {ProcessModuleInfoCollection} - 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. + * + * {ProcessModuleInfoCollection} [result] - The deserialized result object if an error did not occur. + * See {@link ProcessModuleInfoCollection} 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. + */ + listProcessModules(resourceGroupName: string, name: string, processId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listProcessModules(resourceGroupName: string, name: string, processId: string, callback: ServiceCallback): void; + listProcessModules(resourceGroupName: string, name: string, processId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Get process information by its ID for a specific scaled-out + * instance in a web site. + * + * Get process information by its ID for a specific scaled-out instance in a + * web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @param {string} baseAddress Module base address. + * + * @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. + */ + getProcessModuleWithHttpOperationResponse(resourceGroupName: string, name: string, processId: string, baseAddress: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get process information by its ID for a specific scaled-out + * instance in a web site. + * + * Get process information by its ID for a specific scaled-out instance in a + * web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @param {string} baseAddress Module base address. + * + * @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 {ProcessModuleInfo} - 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. + * + * {ProcessModuleInfo} [result] - The deserialized result object if an error did not occur. + * See {@link ProcessModuleInfo} 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. + */ + getProcessModule(resourceGroupName: string, name: string, processId: string, baseAddress: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getProcessModule(resourceGroupName: string, name: string, processId: string, baseAddress: string, callback: ServiceCallback): void; + getProcessModule(resourceGroupName: string, name: string, processId: string, baseAddress: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary List the threads in a process by its ID for a specific scaled-out + * instance in a web site. + * + * List the threads in a process by its ID for a specific scaled-out instance + * in a web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @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. + */ + listProcessThreadsWithHttpOperationResponse(resourceGroupName: string, name: string, processId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary List the threads in a process by its ID for a specific scaled-out + * instance in a web site. + * + * List the threads in a process by its ID for a specific scaled-out instance + * in a web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @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 {ProcessThreadInfoCollection} - 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. + * + * {ProcessThreadInfoCollection} [result] - The deserialized result object if an error did not occur. + * See {@link ProcessThreadInfoCollection} 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. + */ + listProcessThreads(resourceGroupName: string, name: string, processId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listProcessThreads(resourceGroupName: string, name: string, processId: string, callback: ServiceCallback): void; + listProcessThreads(resourceGroupName: string, name: string, processId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Get thread information by Thread ID for a specific process, in a + * specific scaled-out instance in a web site. + * + * Get thread information by Thread ID for a specific process, in a specific + * scaled-out instance in a web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @param {string} threadId TID. + * + * @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. + */ + getProcessThreadWithHttpOperationResponse(resourceGroupName: string, name: string, processId: string, threadId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get thread information by Thread ID for a specific process, in a + * specific scaled-out instance in a web site. + * + * Get thread information by Thread ID for a specific process, in a specific + * scaled-out instance in a web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @param {string} threadId TID. + * + * @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 {ProcessThreadInfo} - 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. + * + * {ProcessThreadInfo} [result] - The deserialized result object if an error did not occur. + * See {@link ProcessThreadInfo} 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. + */ + getProcessThread(resourceGroupName: string, name: string, processId: string, threadId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getProcessThread(resourceGroupName: string, name: string, processId: string, threadId: string, callback: ServiceCallback): void; + getProcessThread(resourceGroupName: string, name: string, processId: string, threadId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Get public certificates for an app or a deployment slot. + * + * Get public certificates for an app or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @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. + */ + listPublicCertificatesWithHttpOperationResponse(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get public certificates for an app or a deployment slot. + * + * Get public certificates for an app or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @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 {PublicCertificateCollection} - 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. + * + * {PublicCertificateCollection} [result] - The deserialized result object if an error did not occur. + * See {@link PublicCertificateCollection} 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. + */ + listPublicCertificates(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listPublicCertificates(resourceGroupName: string, name: string, callback: ServiceCallback): void; + listPublicCertificates(resourceGroupName: string, name: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Get the named public certificate for an app (or deployment slot, if + * specified). + * + * Get the named public certificate for an app (or deployment slot, if + * specified). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} publicCertificateName Public certificate name. + * + * @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. + */ + getPublicCertificateWithHttpOperationResponse(resourceGroupName: string, name: string, publicCertificateName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get the named public certificate for an app (or deployment slot, if + * specified). + * + * Get the named public certificate for an app (or deployment slot, if + * specified). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} publicCertificateName Public certificate name. + * + * @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 {PublicCertificate} - 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. + * + * {PublicCertificate} [result] - The deserialized result object if an error did not occur. + * See {@link PublicCertificate} 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. + */ + getPublicCertificate(resourceGroupName: string, name: string, publicCertificateName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getPublicCertificate(resourceGroupName: string, name: string, publicCertificateName: string, callback: ServiceCallback): void; + getPublicCertificate(resourceGroupName: string, name: string, publicCertificateName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Creates a hostname binding for an app. + * + * Creates a hostname binding for an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} publicCertificateName Public certificate name. + * + * @param {object} publicCertificate Public certificate details. This is the + * JSON representation of a PublicCertificate object. + * + * @param {buffer} [publicCertificate.blob] Public Certificate byte array + * + * @param {string} [publicCertificate.publicCertificateLocation] Public + * Certificate Location. Possible values include: 'CurrentUserMy', + * 'LocalMachineMy', 'Unknown' + * + * @param {string} [publicCertificate.kind] Kind of resource. + * + * @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. + */ + createOrUpdatePublicCertificateWithHttpOperationResponse(resourceGroupName: string, name: string, publicCertificateName: string, publicCertificate: models.PublicCertificate, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Creates a hostname binding for an app. + * + * Creates a hostname binding for an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} publicCertificateName Public certificate name. + * + * @param {object} publicCertificate Public certificate details. This is the + * JSON representation of a PublicCertificate object. + * + * @param {buffer} [publicCertificate.blob] Public Certificate byte array + * + * @param {string} [publicCertificate.publicCertificateLocation] Public + * Certificate Location. Possible values include: 'CurrentUserMy', + * 'LocalMachineMy', 'Unknown' + * + * @param {string} [publicCertificate.kind] Kind of resource. + * + * @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 {PublicCertificate} - 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. + * + * {PublicCertificate} [result] - The deserialized result object if an error did not occur. + * See {@link PublicCertificate} 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. + */ + createOrUpdatePublicCertificate(resourceGroupName: string, name: string, publicCertificateName: string, publicCertificate: models.PublicCertificate, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdatePublicCertificate(resourceGroupName: string, name: string, publicCertificateName: string, publicCertificate: models.PublicCertificate, callback: ServiceCallback): void; + createOrUpdatePublicCertificate(resourceGroupName: string, name: string, publicCertificateName: string, publicCertificate: models.PublicCertificate, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Deletes a hostname binding for an app. + * + * Deletes a hostname binding for an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} publicCertificateName Public certificate name. + * + * @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. + */ + deletePublicCertificateWithHttpOperationResponse(resourceGroupName: string, name: string, publicCertificateName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Deletes a hostname binding for an app. + * + * Deletes a hostname binding for an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} publicCertificateName Public certificate name. + * + * @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 {null} - 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. + * + * {null} [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. + */ + deletePublicCertificate(resourceGroupName: string, name: string, publicCertificateName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deletePublicCertificate(resourceGroupName: string, name: string, publicCertificateName: string, callback: ServiceCallback): void; + deletePublicCertificate(resourceGroupName: string, name: string, publicCertificateName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Gets the publishing profile for an app (or deployment slot, if + * specified). + * + * Gets the publishing profile for an app (or deployment slot, if specified). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} publishingProfileOptions Specifies publishingProfileOptions + * for publishing profile. For example, use {"format": "FileZilla3"} to get a + * FileZilla publishing profile. + * + * @param {string} [publishingProfileOptions.format] Name of the format. Valid + * values are: + * FileZilla3 + * WebDeploy -- default + * Ftp. Possible values include: 'FileZilla3', 'WebDeploy', 'Ftp' + * + * @param {boolean} [publishingProfileOptions.includeDisasterRecoveryEndpoints] + * Include the DisasterRecover endpoint if true + * + * @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. + */ + listPublishingProfileXmlWithSecretsWithHttpOperationResponse(resourceGroupName: string, name: string, publishingProfileOptions: models.CsmPublishingProfileOptions, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets the publishing profile for an app (or deployment slot, if + * specified). + * + * Gets the publishing profile for an app (or deployment slot, if specified). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} publishingProfileOptions Specifies publishingProfileOptions + * for publishing profile. For example, use {"format": "FileZilla3"} to get a + * FileZilla publishing profile. + * + * @param {string} [publishingProfileOptions.format] Name of the format. Valid + * values are: + * FileZilla3 + * WebDeploy -- default + * Ftp. Possible values include: 'FileZilla3', 'WebDeploy', 'Ftp' + * + * @param {boolean} [publishingProfileOptions.includeDisasterRecoveryEndpoints] + * Include the DisasterRecover endpoint if true + * + * @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 {Object} - 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. + * + * {Object} [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. + */ + listPublishingProfileXmlWithSecrets(resourceGroupName: string, name: string, publishingProfileOptions: models.CsmPublishingProfileOptions, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listPublishingProfileXmlWithSecrets(resourceGroupName: string, name: string, publishingProfileOptions: models.CsmPublishingProfileOptions, callback: ServiceCallback): void; + listPublishingProfileXmlWithSecrets(resourceGroupName: string, name: string, publishingProfileOptions: models.CsmPublishingProfileOptions, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Resets the configuration settings of the current slot if they were + * previously modified by calling the API with POST. + * + * Resets the configuration settings of the current slot if they were + * previously modified by calling the API with POST. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @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. + */ + resetProductionSlotConfigWithHttpOperationResponse(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Resets the configuration settings of the current slot if they were + * previously modified by calling the API with POST. + * + * Resets the configuration settings of the current slot if they were + * previously modified by calling the API with POST. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @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 {null} - 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. + * + * {null} [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. + */ + resetProductionSlotConfig(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + resetProductionSlotConfig(resourceGroupName: string, name: string, callback: ServiceCallback): void; + resetProductionSlotConfig(resourceGroupName: string, name: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Restarts an app (or deployment slot, if specified). + * + * Restarts an app (or deployment slot, if specified). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} [options] Optional Parameters. + * + * @param {boolean} [options.softRestart] Specify true to apply the + * configuration settings and restarts the app only if necessary. By default, + * the API always restarts and reprovisions the app. + * + * @param {boolean} [options.synchronous] Specify true to block until the app + * is restarted. By default, it is set to false, and the API responds + * immediately (asynchronous). + * + * @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. + */ + restartWithHttpOperationResponse(resourceGroupName: string, name: string, options?: { softRestart? : boolean, synchronous? : boolean, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Restarts an app (or deployment slot, if specified). + * + * Restarts an app (or deployment slot, if specified). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} [options] Optional Parameters. + * + * @param {boolean} [options.softRestart] Specify true to apply the + * configuration settings and restarts the app only if necessary. By default, + * the API always restarts and reprovisions the app. + * + * @param {boolean} [options.synchronous] Specify true to block until the app + * is restarted. By default, it is set to false, and the API responds + * immediately (asynchronous). + * + * @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 {null} - 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. + * + * {null} [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. + */ + restart(resourceGroupName: string, name: string, options?: { softRestart? : boolean, synchronous? : boolean, customHeaders? : { [headerName: string]: string; } }): Promise; + restart(resourceGroupName: string, name: string, callback: ServiceCallback): void; + restart(resourceGroupName: string, name: string, options: { softRestart? : boolean, synchronous? : boolean, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Restores an app from a backup blob in Azure Storage. + * + * Restores an app from a backup blob in Azure Storage. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} request Information on restore request . + * + * @param {string} request.storageAccountUrl SAS URL to the container. + * + * @param {string} [request.blobName] Name of a blob which contains the backup. + * + * @param {boolean} request.overwrite true if the restore + * operation can overwrite target app; otherwise, false. + * true is needed if trying to restore over an existing app. + * + * @param {string} [request.siteName] Name of an app. + * + * @param {array} [request.databases] Collection of databases which should be + * restored. This list has to match the list of databases included in the + * backup. + * + * @param {boolean} [request.ignoreConflictingHostNames] Changes a logic when + * restoring an app with custom domains. true to remove custom + * domains automatically. If false, custom domains are added to + * the app's object when it is being restored, but that might fail due to + * conflicts during the operation. + * + * @param {boolean} [request.ignoreDatabases] Ignore the databases and only + * restore the site content + * + * @param {string} [request.appServicePlan] Specify app service plan that will + * own restored site. + * + * @param {string} [request.operationType] Operation type. Possible values + * include: 'Default', 'Clone', 'Relocation', 'Snapshot', 'CloudFS' + * + * @param {boolean} [request.adjustConnectionStrings] true if + * SiteConfig.ConnectionStrings should be set in new app; otherwise, + * false. + * + * @param {string} [request.hostingEnvironment] App Service Environment name, + * if needed (only when restoring an app to an App Service Environment). + * + * @param {string} [request.kind] Kind of resource. + * + * @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. + */ + restoreFromBackupBlobWithHttpOperationResponse(resourceGroupName: string, name: string, request: models.RestoreRequest, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Restores an app from a backup blob in Azure Storage. + * + * Restores an app from a backup blob in Azure Storage. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} request Information on restore request . + * + * @param {string} request.storageAccountUrl SAS URL to the container. + * + * @param {string} [request.blobName] Name of a blob which contains the backup. + * + * @param {boolean} request.overwrite true if the restore + * operation can overwrite target app; otherwise, false. + * true is needed if trying to restore over an existing app. + * + * @param {string} [request.siteName] Name of an app. + * + * @param {array} [request.databases] Collection of databases which should be + * restored. This list has to match the list of databases included in the + * backup. + * + * @param {boolean} [request.ignoreConflictingHostNames] Changes a logic when + * restoring an app with custom domains. true to remove custom + * domains automatically. If false, custom domains are added to + * the app's object when it is being restored, but that might fail due to + * conflicts during the operation. + * + * @param {boolean} [request.ignoreDatabases] Ignore the databases and only + * restore the site content + * + * @param {string} [request.appServicePlan] Specify app service plan that will + * own restored site. + * + * @param {string} [request.operationType] Operation type. Possible values + * include: 'Default', 'Clone', 'Relocation', 'Snapshot', 'CloudFS' + * + * @param {boolean} [request.adjustConnectionStrings] true if + * SiteConfig.ConnectionStrings should be set in new app; otherwise, + * false. + * + * @param {string} [request.hostingEnvironment] App Service Environment name, + * if needed (only when restoring an app to an App Service Environment). + * + * @param {string} [request.kind] Kind of resource. + * + * @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 {null} - 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. + * + * {null} [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. + */ + restoreFromBackupBlob(resourceGroupName: string, name: string, request: models.RestoreRequest, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + restoreFromBackupBlob(resourceGroupName: string, name: string, request: models.RestoreRequest, callback: ServiceCallback): void; + restoreFromBackupBlob(resourceGroupName: string, name: string, request: models.RestoreRequest, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Restores a deleted web app to this web app. + * + * Restores a deleted web app to this web app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {object} restoreRequest Deleted web app restore information. + * + * @param {string} [restoreRequest.deletedSiteId] ARM resource ID of the + * deleted app. Example: + * /subscriptions/{subId}/providers/Microsoft.Web/deletedSites/{deletedSiteId} + * + * @param {boolean} [restoreRequest.recoverConfiguration] If true, deleted site + * configuration, in addition to content, will be restored. + * + * @param {string} [restoreRequest.snapshotTime] Point in time to restore the + * deleted app from, formatted as a DateTime string. + * If unspecified, default value is the time that the app was deleted. + * + * @param {string} [restoreRequest.kind] Kind of resource. + * + * @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. + */ + restoreFromDeletedAppWithHttpOperationResponse(resourceGroupName: string, name: string, restoreRequest: models.DeletedAppRestoreRequest, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Restores a deleted web app to this web app. + * + * Restores a deleted web app to this web app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {object} restoreRequest Deleted web app restore information. + * + * @param {string} [restoreRequest.deletedSiteId] ARM resource ID of the + * deleted app. Example: + * /subscriptions/{subId}/providers/Microsoft.Web/deletedSites/{deletedSiteId} + * + * @param {boolean} [restoreRequest.recoverConfiguration] If true, deleted site + * configuration, in addition to content, will be restored. + * + * @param {string} [restoreRequest.snapshotTime] Point in time to restore the + * deleted app from, formatted as a DateTime string. + * If unspecified, default value is the time that the app was deleted. + * + * @param {string} [restoreRequest.kind] Kind of resource. + * + * @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 {null} - 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. + * + * {null} [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. + */ + restoreFromDeletedApp(resourceGroupName: string, name: string, restoreRequest: models.DeletedAppRestoreRequest, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + restoreFromDeletedApp(resourceGroupName: string, name: string, restoreRequest: models.DeletedAppRestoreRequest, callback: ServiceCallback): void; + restoreFromDeletedApp(resourceGroupName: string, name: string, restoreRequest: models.DeletedAppRestoreRequest, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Restores a web app from a snapshot. + * + * Restores a web app from a snapshot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {object} restoreRequest Snapshot restore settings. Snapshot + * information can be obtained by calling GetDeletedSites or GetSiteSnapshots + * API. + * + * @param {string} [restoreRequest.snapshotTime] Point in time in which the app + * restore should be done, formatted as a DateTime string. + * + * @param {object} [restoreRequest.recoverySource] Optional. Specifies the web + * app that snapshot contents will be retrieved from. + * If empty, the targeted web app will be used as the source. + * + * @param {string} [restoreRequest.recoverySource.location] Geographical + * location of the source web app, e.g. SouthEastAsia, SouthCentralUS + * + * @param {string} [restoreRequest.recoverySource.id] ARM resource ID of the + * source app. + * /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName} + * for production slots and + * /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/slots/{slotName} + * for other slots. + * + * @param {boolean} restoreRequest.overwrite If true the restore + * operation can overwrite source app; otherwise, false. + * + * @param {boolean} [restoreRequest.recoverConfiguration] If true, site + * configuration, in addition to content, will be reverted. + * + * @param {boolean} [restoreRequest.ignoreConflictingHostNames] If true, custom + * hostname conflicts will be ignored when recovering to a target web app. + * This setting is only necessary when RecoverConfiguration is enabled. + * + * @param {string} [restoreRequest.kind] Kind of resource. + * + * @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. + */ + restoreSnapshotWithHttpOperationResponse(resourceGroupName: string, name: string, restoreRequest: models.SnapshotRestoreRequest, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Restores a web app from a snapshot. + * + * Restores a web app from a snapshot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {object} restoreRequest Snapshot restore settings. Snapshot + * information can be obtained by calling GetDeletedSites or GetSiteSnapshots + * API. + * + * @param {string} [restoreRequest.snapshotTime] Point in time in which the app + * restore should be done, formatted as a DateTime string. + * + * @param {object} [restoreRequest.recoverySource] Optional. Specifies the web + * app that snapshot contents will be retrieved from. + * If empty, the targeted web app will be used as the source. + * + * @param {string} [restoreRequest.recoverySource.location] Geographical + * location of the source web app, e.g. SouthEastAsia, SouthCentralUS + * + * @param {string} [restoreRequest.recoverySource.id] ARM resource ID of the + * source app. + * /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName} + * for production slots and + * /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/slots/{slotName} + * for other slots. + * + * @param {boolean} restoreRequest.overwrite If true the restore + * operation can overwrite source app; otherwise, false. + * + * @param {boolean} [restoreRequest.recoverConfiguration] If true, site + * configuration, in addition to content, will be reverted. + * + * @param {boolean} [restoreRequest.ignoreConflictingHostNames] If true, custom + * hostname conflicts will be ignored when recovering to a target web app. + * This setting is only necessary when RecoverConfiguration is enabled. + * + * @param {string} [restoreRequest.kind] Kind of resource. + * + * @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 {null} - 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. + * + * {null} [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. + */ + restoreSnapshot(resourceGroupName: string, name: string, restoreRequest: models.SnapshotRestoreRequest, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + restoreSnapshot(resourceGroupName: string, name: string, restoreRequest: models.SnapshotRestoreRequest, callback: ServiceCallback): void; + restoreSnapshot(resourceGroupName: string, name: string, restoreRequest: models.SnapshotRestoreRequest, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Get list of siteextensions for a web site, or a deployment slot. + * + * Get list of siteextensions for a web site, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @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. + */ + listSiteExtensionsWithHttpOperationResponse(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get list of siteextensions for a web site, or a deployment slot. + * + * Get list of siteextensions for a web site, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @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 {SiteExtensionInfoCollection} - 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. + * + * {SiteExtensionInfoCollection} [result] - The deserialized result object if an error did not occur. + * See {@link SiteExtensionInfoCollection} 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. + */ + listSiteExtensions(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listSiteExtensions(resourceGroupName: string, name: string, callback: ServiceCallback): void; + listSiteExtensions(resourceGroupName: string, name: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Get site extension information by its ID for a web site, or a + * deployment slot. + * + * Get site extension information by its ID for a web site, or a deployment + * slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} siteExtensionId Site extension name. + * + * @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. + */ + getSiteExtensionWithHttpOperationResponse(resourceGroupName: string, name: string, siteExtensionId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get site extension information by its ID for a web site, or a + * deployment slot. + * + * Get site extension information by its ID for a web site, or a deployment + * slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} siteExtensionId Site extension name. + * + * @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 {SiteExtensionInfo} - 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. + * + * {SiteExtensionInfo} [result] - The deserialized result object if an error did not occur. + * See {@link SiteExtensionInfo} 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. + */ + getSiteExtension(resourceGroupName: string, name: string, siteExtensionId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getSiteExtension(resourceGroupName: string, name: string, siteExtensionId: string, callback: ServiceCallback): void; + getSiteExtension(resourceGroupName: string, name: string, siteExtensionId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Install site extension on a web site, or a deployment slot. + * + * Install site extension on a web site, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} siteExtensionId Site extension name. + * + * @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. + */ + installSiteExtensionWithHttpOperationResponse(resourceGroupName: string, name: string, siteExtensionId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Install site extension on a web site, or a deployment slot. + * + * Install site extension on a web site, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} siteExtensionId Site extension name. + * + * @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 {SiteExtensionInfo} - 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. + * + * {SiteExtensionInfo} [result] - The deserialized result object if an error did not occur. + * See {@link SiteExtensionInfo} 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. + */ + installSiteExtension(resourceGroupName: string, name: string, siteExtensionId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + installSiteExtension(resourceGroupName: string, name: string, siteExtensionId: string, callback: ServiceCallback): void; + installSiteExtension(resourceGroupName: string, name: string, siteExtensionId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Remove a site extension from a web site, or a deployment slot. + * + * Remove a site extension from a web site, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} siteExtensionId Site extension name. + * + * @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. + */ + deleteSiteExtensionWithHttpOperationResponse(resourceGroupName: string, name: string, siteExtensionId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Remove a site extension from a web site, or a deployment slot. + * + * Remove a site extension from a web site, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} siteExtensionId Site extension name. + * + * @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 {null} - 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. + * + * {null} [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. + */ + deleteSiteExtension(resourceGroupName: string, name: string, siteExtensionId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteSiteExtension(resourceGroupName: string, name: string, siteExtensionId: string, callback: ServiceCallback): void; + deleteSiteExtension(resourceGroupName: string, name: string, siteExtensionId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Gets an app's deployment slots. + * + * Gets an app's deployment slots. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @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. + */ + listSlotsWithHttpOperationResponse(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets an app's deployment slots. + * + * Gets an app's deployment slots. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @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 {WebAppCollection} - 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. + * + * {WebAppCollection} [result] - The deserialized result object if an error did not occur. + * See {@link WebAppCollection} 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. + */ + listSlots(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listSlots(resourceGroupName: string, name: string, callback: ServiceCallback): void; + listSlots(resourceGroupName: string, name: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Gets the details of a web, mobile, or API app. + * + * Gets the details of a web, mobile, or API app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. By default, this API + * returns the production slot. + * + * @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. + */ + getSlotWithHttpOperationResponse(resourceGroupName: string, name: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets the details of a web, mobile, or API app. + * + * Gets the details of a web, mobile, or API app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. By default, this API + * returns the production slot. + * + * @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 {Site} - 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. + * + * {Site} [result] - The deserialized result object if an error did not occur. + * See {@link Site} 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. + */ + getSlot(resourceGroupName: string, name: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getSlot(resourceGroupName: string, name: string, slot: string, callback: ServiceCallback): void; + getSlot(resourceGroupName: string, name: string, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Creates a new web, mobile, or API app in an existing resource + * group, or updates an existing app. + * + * Creates a new web, mobile, or API app in an existing resource group, or + * updates an existing app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Unique name of the app to create or update. To create + * or update a deployment slot, use the {slot} parameter. + * + * @param {object} siteEnvelope A JSON representation of the app properties. + * See example. + * + * @param {boolean} [siteEnvelope.enabled] true if the app is + * enabled; otherwise, false. Setting this value to false disables + * the app (takes the app offline). + * + * @param {array} [siteEnvelope.hostNameSslStates] Hostname SSL states are used + * to manage the SSL bindings for app's hostnames. + * + * @param {string} [siteEnvelope.serverFarmId] Resource ID of the associated + * App Service plan, formatted as: + * "/subscriptions/{subscriptionID}/resourceGroups/{groupName}/providers/Microsoft.Web/serverfarms/{appServicePlanName}". + * + * @param {boolean} [siteEnvelope.reserved] true if reserved; + * otherwise, false. + * + * @param {boolean} [siteEnvelope.isXenon] Obsolete: Hyper-V sandbox. + * + * @param {boolean} [siteEnvelope.hyperV] Hyper-V sandbox. + * + * @param {object} [siteEnvelope.siteConfig] Configuration of the app. + * + * @param {number} [siteEnvelope.siteConfig.numberOfWorkers] Number of workers. + * + * @param {array} [siteEnvelope.siteConfig.defaultDocuments] Default documents. + * + * @param {string} [siteEnvelope.siteConfig.netFrameworkVersion] .NET Framework + * version. + * + * @param {string} [siteEnvelope.siteConfig.phpVersion] Version of PHP. + * + * @param {string} [siteEnvelope.siteConfig.pythonVersion] Version of Python. + * + * @param {string} [siteEnvelope.siteConfig.nodeVersion] Version of Node.js. + * + * @param {string} [siteEnvelope.siteConfig.linuxFxVersion] Linux App Framework + * and version + * + * @param {string} [siteEnvelope.siteConfig.windowsFxVersion] Xenon App + * Framework and version + * + * @param {boolean} [siteEnvelope.siteConfig.requestTracingEnabled] + * true if request tracing is enabled; otherwise, + * false. + * + * @param {date} [siteEnvelope.siteConfig.requestTracingExpirationTime] Request + * tracing expiration time. + * + * @param {boolean} [siteEnvelope.siteConfig.remoteDebuggingEnabled] + * true if remote debugging is enabled; otherwise, + * false. + * + * @param {string} [siteEnvelope.siteConfig.remoteDebuggingVersion] Remote + * debugging version. + * + * @param {boolean} [siteEnvelope.siteConfig.httpLoggingEnabled] + * true if HTTP logging is enabled; otherwise, false. + * + * @param {number} [siteEnvelope.siteConfig.logsDirectorySizeLimit] HTTP logs + * directory size limit. + * + * @param {boolean} [siteEnvelope.siteConfig.detailedErrorLoggingEnabled] + * true if detailed error logging is enabled; otherwise, + * false. + * + * @param {string} [siteEnvelope.siteConfig.publishingUsername] Publishing user + * name. + * + * @param {array} [siteEnvelope.siteConfig.appSettings] Application settings. + * + * @param {object} [siteEnvelope.siteConfig.azureStorageAccounts] User-provided + * Azure storage accounts. + * + * @param {array} [siteEnvelope.siteConfig.connectionStrings] Connection + * strings. + * + * @param {array} [siteEnvelope.siteConfig.handlerMappings] Handler mappings. + * + * @param {string} [siteEnvelope.siteConfig.documentRoot] Document root. + * + * @param {string} [siteEnvelope.siteConfig.scmType] SCM type. Possible values + * include: 'None', 'Dropbox', 'Tfs', 'LocalGit', 'GitHub', 'CodePlexGit', + * 'CodePlexHg', 'BitbucketGit', 'BitbucketHg', 'ExternalGit', 'ExternalHg', + * 'OneDrive', 'VSO' + * + * @param {boolean} [siteEnvelope.siteConfig.use32BitWorkerProcess] + * true to use 32-bit worker process; otherwise, + * false. + * + * @param {boolean} [siteEnvelope.siteConfig.webSocketsEnabled] + * true if WebSocket is enabled; otherwise, false. + * + * @param {boolean} [siteEnvelope.siteConfig.alwaysOn] true if + * Always On is enabled; otherwise, false. + * + * @param {string} [siteEnvelope.siteConfig.javaVersion] Java version. + * + * @param {string} [siteEnvelope.siteConfig.javaContainer] Java container. + * + * @param {string} [siteEnvelope.siteConfig.javaContainerVersion] Java + * container version. + * + * @param {string} [siteEnvelope.siteConfig.appCommandLine] App command line to + * launch. + * + * @param {string} [siteEnvelope.siteConfig.managedPipelineMode] Managed + * pipeline mode. Possible values include: 'Integrated', 'Classic' + * + * @param {array} [siteEnvelope.siteConfig.virtualApplications] Virtual + * applications. + * + * @param {string} [siteEnvelope.siteConfig.loadBalancing] Site load balancing. + * Possible values include: 'WeightedRoundRobin', 'LeastRequests', + * 'LeastResponseTime', 'WeightedTotalTraffic', 'RequestHash' + * + * @param {object} [siteEnvelope.siteConfig.experiments] This is work around + * for polymophic types. + * + * @param {array} [siteEnvelope.siteConfig.experiments.rampUpRules] List of + * ramp-up rules. + * + * @param {object} [siteEnvelope.siteConfig.limits] Site limits. + * + * @param {number} [siteEnvelope.siteConfig.limits.maxPercentageCpu] Maximum + * allowed CPU usage percentage. + * + * @param {number} [siteEnvelope.siteConfig.limits.maxMemoryInMb] Maximum + * allowed memory usage in MB. + * + * @param {number} [siteEnvelope.siteConfig.limits.maxDiskSizeInMb] Maximum + * allowed disk size usage in MB. + * + * @param {boolean} [siteEnvelope.siteConfig.autoHealEnabled] true + * if Auto Heal is enabled; otherwise, false. + * + * @param {object} [siteEnvelope.siteConfig.autoHealRules] Auto Heal rules. + * + * @param {object} [siteEnvelope.siteConfig.autoHealRules.triggers] Conditions + * that describe when to execute the auto-heal actions. + * + * @param {object} [siteEnvelope.siteConfig.autoHealRules.triggers.requests] A + * rule based on total requests. + * + * @param {number} + * [siteEnvelope.siteConfig.autoHealRules.triggers.requests.count] Request + * Count. + * + * @param {string} + * [siteEnvelope.siteConfig.autoHealRules.triggers.requests.timeInterval] Time + * interval. + * + * @param {number} + * [siteEnvelope.siteConfig.autoHealRules.triggers.privateBytesInKB] A rule + * based on private bytes. + * + * @param {array} [siteEnvelope.siteConfig.autoHealRules.triggers.statusCodes] + * A rule based on status codes. + * + * @param {object} + * [siteEnvelope.siteConfig.autoHealRules.triggers.slowRequests] A rule based + * on request execution time. + * + * @param {string} + * [siteEnvelope.siteConfig.autoHealRules.triggers.slowRequests.timeTaken] Time + * taken. + * + * @param {number} + * [siteEnvelope.siteConfig.autoHealRules.triggers.slowRequests.count] Request + * Count. + * + * @param {string} + * [siteEnvelope.siteConfig.autoHealRules.triggers.slowRequests.timeInterval] + * Time interval. + * + * @param {object} [siteEnvelope.siteConfig.autoHealRules.actions] Actions to + * be executed when a rule is triggered. + * + * @param {string} [siteEnvelope.siteConfig.autoHealRules.actions.actionType] + * Predefined action to be taken. Possible values include: 'Recycle', + * 'LogEvent', 'CustomAction' + * + * @param {object} [siteEnvelope.siteConfig.autoHealRules.actions.customAction] + * Custom action to be taken. + * + * @param {string} + * [siteEnvelope.siteConfig.autoHealRules.actions.customAction.exe] Executable + * to be run. + * + * @param {string} + * [siteEnvelope.siteConfig.autoHealRules.actions.customAction.parameters] + * Parameters for the executable. + * + * @param {string} + * [siteEnvelope.siteConfig.autoHealRules.actions.minProcessExecutionTime] + * Minimum time the process must execute + * before taking the action + * + * @param {string} [siteEnvelope.siteConfig.tracingOptions] Tracing options. + * + * @param {string} [siteEnvelope.siteConfig.vnetName] Virtual Network name. + * + * @param {object} [siteEnvelope.siteConfig.cors] Cross-Origin Resource Sharing + * (CORS) settings. + * + * @param {array} [siteEnvelope.siteConfig.cors.allowedOrigins] Gets or sets + * the list of origins that should be allowed to make cross-origin + * calls (for example: http://example.com:12345). Use "*" to allow all. + * + * @param {object} [siteEnvelope.siteConfig.push] Push endpoint settings. + * + * @param {boolean} siteEnvelope.siteConfig.push.isPushEnabled Gets or sets a + * flag indicating whether the Push endpoint is enabled. + * + * @param {string} [siteEnvelope.siteConfig.push.tagWhitelistJson] Gets or sets + * a JSON string containing a list of tags that are whitelisted for use by the + * push registration endpoint. + * + * @param {string} [siteEnvelope.siteConfig.push.tagsRequiringAuth] Gets or + * sets a JSON string containing a list of tags that require user + * authentication to be used in the push registration endpoint. + * Tags can consist of alphanumeric characters and the following: + * '_', '@', '#', '.', ':', '-'. + * Validation should be performed at the PushRequestHandler. + * + * @param {string} [siteEnvelope.siteConfig.push.dynamicTagsJson] Gets or sets + * a JSON string containing a list of dynamic tags that will be evaluated from + * user claims in the push registration endpoint. + * + * @param {string} [siteEnvelope.siteConfig.push.kind] Kind of resource. + * + * @param {object} [siteEnvelope.siteConfig.apiDefinition] Information about + * the formal API definition for the app. + * + * @param {string} [siteEnvelope.siteConfig.apiDefinition.url] The URL of the + * API definition. + * + * @param {string} [siteEnvelope.siteConfig.autoSwapSlotName] Auto-swap slot + * name. + * + * @param {boolean} [siteEnvelope.siteConfig.localMySqlEnabled] + * true to enable local MySQL; otherwise, false. + * + * @param {number} [siteEnvelope.siteConfig.managedServiceIdentityId] Managed + * Service Identity Id + * + * @param {number} [siteEnvelope.siteConfig.xManagedServiceIdentityId] Explicit + * Managed Service Identity Id + * + * @param {array} [siteEnvelope.siteConfig.ipSecurityRestrictions] IP security + * restrictions. + * + * @param {boolean} [siteEnvelope.siteConfig.http20Enabled] Http20Enabled: + * configures a web site to allow clients to connect over http2.0 + * + * @param {string} [siteEnvelope.siteConfig.minTlsVersion] MinTlsVersion: + * configures the minimum version of TLS required for SSL requests. Possible + * values include: '1.0', '1.1', '1.2' + * + * @param {string} [siteEnvelope.siteConfig.ftpsState] State of FTP / FTPS + * service. Possible values include: 'AllAllowed', 'FtpsOnly', 'Disabled' + * + * @param {number} [siteEnvelope.siteConfig.reservedInstanceCount] Number of + * reserved instances. + * This setting only applies to the Consumption Plan + * + * @param {boolean} [siteEnvelope.scmSiteAlsoStopped] true to stop + * SCM (KUDU) site when the app is stopped; otherwise, false. The + * default is false. + * + * @param {object} [siteEnvelope.hostingEnvironmentProfile] App Service + * Environment to use for the app. + * + * @param {string} [siteEnvelope.hostingEnvironmentProfile.id] Resource ID of + * the App Service Environment. + * + * @param {boolean} [siteEnvelope.clientAffinityEnabled] true to + * enable client affinity; false to stop sending session affinity + * cookies, which route client requests in the same session to the same + * instance. Default is true. + * + * @param {boolean} [siteEnvelope.clientCertEnabled] true to + * enable client certificate authentication (TLS mutual authentication); + * otherwise, false. Default is false. + * + * @param {boolean} [siteEnvelope.hostNamesDisabled] true to + * disable the public hostnames of the app; otherwise, false. + * If true, the app is only accessible via API management process. + * + * @param {number} [siteEnvelope.containerSize] Size of the function container. + * + * @param {number} [siteEnvelope.dailyMemoryTimeQuota] Maximum allowed daily + * memory-time quota (applicable on dynamic apps only). + * + * @param {object} [siteEnvelope.cloningInfo] If specified during app creation, + * the app is cloned from a source app. + * + * @param {uuid} [siteEnvelope.cloningInfo.correlationId] Correlation ID of + * cloning operation. This ID ties multiple cloning operations + * together to use the same snapshot. + * + * @param {boolean} [siteEnvelope.cloningInfo.overwrite] true to + * overwrite destination app; otherwise, false. + * + * @param {boolean} [siteEnvelope.cloningInfo.cloneCustomHostNames] + * true to clone custom hostnames from source app; otherwise, + * false. + * + * @param {boolean} [siteEnvelope.cloningInfo.cloneSourceControl] + * true to clone source control from source app; otherwise, + * false. + * + * @param {string} siteEnvelope.cloningInfo.sourceWebAppId ARM resource ID of + * the source app. App resource ID is of the form + * /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName} + * for production slots and + * /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/slots/{slotName} + * for other slots. + * + * @param {string} [siteEnvelope.cloningInfo.hostingEnvironment] App Service + * Environment. + * + * @param {object} [siteEnvelope.cloningInfo.appSettingsOverrides] Application + * setting overrides for cloned app. If specified, these settings override the + * settings cloned + * from source app. Otherwise, application settings from source app are + * retained. + * + * @param {boolean} [siteEnvelope.cloningInfo.configureLoadBalancing] + * true to configure load balancing for source and destination + * app. + * + * @param {string} [siteEnvelope.cloningInfo.trafficManagerProfileId] ARM + * resource ID of the Traffic Manager profile to use, if it exists. Traffic + * Manager resource ID is of the form + * /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/trafficManagerProfiles/{profileName}. + * + * @param {string} [siteEnvelope.cloningInfo.trafficManagerProfileName] Name of + * Traffic Manager profile to create. This is only needed if Traffic Manager + * profile does not already exist. + * + * @param {boolean} [siteEnvelope.httpsOnly] HttpsOnly: configures a web site + * to accept only https requests. Issues redirect for + * http requests + * + * @param {object} [siteEnvelope.identity] + * + * @param {string} [siteEnvelope.identity.type] Type of managed service + * identity. Possible values include: 'SystemAssigned', 'UserAssigned' + * + * @param {array} [siteEnvelope.identity.identityIds] Array of UserAssigned + * managed service identities. + * + * @param {string} [siteEnvelope.kind] Kind of resource. + * + * @param {string} siteEnvelope.location Resource Location. + * + * @param {object} [siteEnvelope.tags] Resource tags. + * + * @param {string} slot Name of the deployment slot to create or update. By + * default, this API attempts to create or modify the production slot. + * + * @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. + */ + createOrUpdateSlotWithHttpOperationResponse(resourceGroupName: string, name: string, siteEnvelope: models.Site, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Creates a new web, mobile, or API app in an existing resource + * group, or updates an existing app. + * + * Creates a new web, mobile, or API app in an existing resource group, or + * updates an existing app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Unique name of the app to create or update. To create + * or update a deployment slot, use the {slot} parameter. + * + * @param {object} siteEnvelope A JSON representation of the app properties. + * See example. + * + * @param {boolean} [siteEnvelope.enabled] true if the app is + * enabled; otherwise, false. Setting this value to false disables + * the app (takes the app offline). + * + * @param {array} [siteEnvelope.hostNameSslStates] Hostname SSL states are used + * to manage the SSL bindings for app's hostnames. + * + * @param {string} [siteEnvelope.serverFarmId] Resource ID of the associated + * App Service plan, formatted as: + * "/subscriptions/{subscriptionID}/resourceGroups/{groupName}/providers/Microsoft.Web/serverfarms/{appServicePlanName}". + * + * @param {boolean} [siteEnvelope.reserved] true if reserved; + * otherwise, false. + * + * @param {boolean} [siteEnvelope.isXenon] Obsolete: Hyper-V sandbox. + * + * @param {boolean} [siteEnvelope.hyperV] Hyper-V sandbox. + * + * @param {object} [siteEnvelope.siteConfig] Configuration of the app. + * + * @param {number} [siteEnvelope.siteConfig.numberOfWorkers] Number of workers. + * + * @param {array} [siteEnvelope.siteConfig.defaultDocuments] Default documents. + * + * @param {string} [siteEnvelope.siteConfig.netFrameworkVersion] .NET Framework + * version. + * + * @param {string} [siteEnvelope.siteConfig.phpVersion] Version of PHP. + * + * @param {string} [siteEnvelope.siteConfig.pythonVersion] Version of Python. + * + * @param {string} [siteEnvelope.siteConfig.nodeVersion] Version of Node.js. + * + * @param {string} [siteEnvelope.siteConfig.linuxFxVersion] Linux App Framework + * and version + * + * @param {string} [siteEnvelope.siteConfig.windowsFxVersion] Xenon App + * Framework and version + * + * @param {boolean} [siteEnvelope.siteConfig.requestTracingEnabled] + * true if request tracing is enabled; otherwise, + * false. + * + * @param {date} [siteEnvelope.siteConfig.requestTracingExpirationTime] Request + * tracing expiration time. + * + * @param {boolean} [siteEnvelope.siteConfig.remoteDebuggingEnabled] + * true if remote debugging is enabled; otherwise, + * false. + * + * @param {string} [siteEnvelope.siteConfig.remoteDebuggingVersion] Remote + * debugging version. + * + * @param {boolean} [siteEnvelope.siteConfig.httpLoggingEnabled] + * true if HTTP logging is enabled; otherwise, false. + * + * @param {number} [siteEnvelope.siteConfig.logsDirectorySizeLimit] HTTP logs + * directory size limit. + * + * @param {boolean} [siteEnvelope.siteConfig.detailedErrorLoggingEnabled] + * true if detailed error logging is enabled; otherwise, + * false. + * + * @param {string} [siteEnvelope.siteConfig.publishingUsername] Publishing user + * name. + * + * @param {array} [siteEnvelope.siteConfig.appSettings] Application settings. + * + * @param {object} [siteEnvelope.siteConfig.azureStorageAccounts] User-provided + * Azure storage accounts. + * + * @param {array} [siteEnvelope.siteConfig.connectionStrings] Connection + * strings. + * + * @param {array} [siteEnvelope.siteConfig.handlerMappings] Handler mappings. + * + * @param {string} [siteEnvelope.siteConfig.documentRoot] Document root. + * + * @param {string} [siteEnvelope.siteConfig.scmType] SCM type. Possible values + * include: 'None', 'Dropbox', 'Tfs', 'LocalGit', 'GitHub', 'CodePlexGit', + * 'CodePlexHg', 'BitbucketGit', 'BitbucketHg', 'ExternalGit', 'ExternalHg', + * 'OneDrive', 'VSO' + * + * @param {boolean} [siteEnvelope.siteConfig.use32BitWorkerProcess] + * true to use 32-bit worker process; otherwise, + * false. + * + * @param {boolean} [siteEnvelope.siteConfig.webSocketsEnabled] + * true if WebSocket is enabled; otherwise, false. + * + * @param {boolean} [siteEnvelope.siteConfig.alwaysOn] true if + * Always On is enabled; otherwise, false. + * + * @param {string} [siteEnvelope.siteConfig.javaVersion] Java version. + * + * @param {string} [siteEnvelope.siteConfig.javaContainer] Java container. + * + * @param {string} [siteEnvelope.siteConfig.javaContainerVersion] Java + * container version. + * + * @param {string} [siteEnvelope.siteConfig.appCommandLine] App command line to + * launch. + * + * @param {string} [siteEnvelope.siteConfig.managedPipelineMode] Managed + * pipeline mode. Possible values include: 'Integrated', 'Classic' + * + * @param {array} [siteEnvelope.siteConfig.virtualApplications] Virtual + * applications. + * + * @param {string} [siteEnvelope.siteConfig.loadBalancing] Site load balancing. + * Possible values include: 'WeightedRoundRobin', 'LeastRequests', + * 'LeastResponseTime', 'WeightedTotalTraffic', 'RequestHash' + * + * @param {object} [siteEnvelope.siteConfig.experiments] This is work around + * for polymophic types. + * + * @param {array} [siteEnvelope.siteConfig.experiments.rampUpRules] List of + * ramp-up rules. + * + * @param {object} [siteEnvelope.siteConfig.limits] Site limits. + * + * @param {number} [siteEnvelope.siteConfig.limits.maxPercentageCpu] Maximum + * allowed CPU usage percentage. + * + * @param {number} [siteEnvelope.siteConfig.limits.maxMemoryInMb] Maximum + * allowed memory usage in MB. + * + * @param {number} [siteEnvelope.siteConfig.limits.maxDiskSizeInMb] Maximum + * allowed disk size usage in MB. + * + * @param {boolean} [siteEnvelope.siteConfig.autoHealEnabled] true + * if Auto Heal is enabled; otherwise, false. + * + * @param {object} [siteEnvelope.siteConfig.autoHealRules] Auto Heal rules. + * + * @param {object} [siteEnvelope.siteConfig.autoHealRules.triggers] Conditions + * that describe when to execute the auto-heal actions. + * + * @param {object} [siteEnvelope.siteConfig.autoHealRules.triggers.requests] A + * rule based on total requests. + * + * @param {number} + * [siteEnvelope.siteConfig.autoHealRules.triggers.requests.count] Request + * Count. + * + * @param {string} + * [siteEnvelope.siteConfig.autoHealRules.triggers.requests.timeInterval] Time + * interval. + * + * @param {number} + * [siteEnvelope.siteConfig.autoHealRules.triggers.privateBytesInKB] A rule + * based on private bytes. + * + * @param {array} [siteEnvelope.siteConfig.autoHealRules.triggers.statusCodes] + * A rule based on status codes. + * + * @param {object} + * [siteEnvelope.siteConfig.autoHealRules.triggers.slowRequests] A rule based + * on request execution time. + * + * @param {string} + * [siteEnvelope.siteConfig.autoHealRules.triggers.slowRequests.timeTaken] Time + * taken. + * + * @param {number} + * [siteEnvelope.siteConfig.autoHealRules.triggers.slowRequests.count] Request + * Count. + * + * @param {string} + * [siteEnvelope.siteConfig.autoHealRules.triggers.slowRequests.timeInterval] + * Time interval. + * + * @param {object} [siteEnvelope.siteConfig.autoHealRules.actions] Actions to + * be executed when a rule is triggered. + * + * @param {string} [siteEnvelope.siteConfig.autoHealRules.actions.actionType] + * Predefined action to be taken. Possible values include: 'Recycle', + * 'LogEvent', 'CustomAction' + * + * @param {object} [siteEnvelope.siteConfig.autoHealRules.actions.customAction] + * Custom action to be taken. + * + * @param {string} + * [siteEnvelope.siteConfig.autoHealRules.actions.customAction.exe] Executable + * to be run. + * + * @param {string} + * [siteEnvelope.siteConfig.autoHealRules.actions.customAction.parameters] + * Parameters for the executable. + * + * @param {string} + * [siteEnvelope.siteConfig.autoHealRules.actions.minProcessExecutionTime] + * Minimum time the process must execute + * before taking the action + * + * @param {string} [siteEnvelope.siteConfig.tracingOptions] Tracing options. + * + * @param {string} [siteEnvelope.siteConfig.vnetName] Virtual Network name. + * + * @param {object} [siteEnvelope.siteConfig.cors] Cross-Origin Resource Sharing + * (CORS) settings. + * + * @param {array} [siteEnvelope.siteConfig.cors.allowedOrigins] Gets or sets + * the list of origins that should be allowed to make cross-origin + * calls (for example: http://example.com:12345). Use "*" to allow all. + * + * @param {object} [siteEnvelope.siteConfig.push] Push endpoint settings. + * + * @param {boolean} siteEnvelope.siteConfig.push.isPushEnabled Gets or sets a + * flag indicating whether the Push endpoint is enabled. + * + * @param {string} [siteEnvelope.siteConfig.push.tagWhitelistJson] Gets or sets + * a JSON string containing a list of tags that are whitelisted for use by the + * push registration endpoint. + * + * @param {string} [siteEnvelope.siteConfig.push.tagsRequiringAuth] Gets or + * sets a JSON string containing a list of tags that require user + * authentication to be used in the push registration endpoint. + * Tags can consist of alphanumeric characters and the following: + * '_', '@', '#', '.', ':', '-'. + * Validation should be performed at the PushRequestHandler. + * + * @param {string} [siteEnvelope.siteConfig.push.dynamicTagsJson] Gets or sets + * a JSON string containing a list of dynamic tags that will be evaluated from + * user claims in the push registration endpoint. + * + * @param {string} [siteEnvelope.siteConfig.push.kind] Kind of resource. + * + * @param {object} [siteEnvelope.siteConfig.apiDefinition] Information about + * the formal API definition for the app. + * + * @param {string} [siteEnvelope.siteConfig.apiDefinition.url] The URL of the + * API definition. + * + * @param {string} [siteEnvelope.siteConfig.autoSwapSlotName] Auto-swap slot + * name. + * + * @param {boolean} [siteEnvelope.siteConfig.localMySqlEnabled] + * true to enable local MySQL; otherwise, false. + * + * @param {number} [siteEnvelope.siteConfig.managedServiceIdentityId] Managed + * Service Identity Id + * + * @param {number} [siteEnvelope.siteConfig.xManagedServiceIdentityId] Explicit + * Managed Service Identity Id + * + * @param {array} [siteEnvelope.siteConfig.ipSecurityRestrictions] IP security + * restrictions. + * + * @param {boolean} [siteEnvelope.siteConfig.http20Enabled] Http20Enabled: + * configures a web site to allow clients to connect over http2.0 + * + * @param {string} [siteEnvelope.siteConfig.minTlsVersion] MinTlsVersion: + * configures the minimum version of TLS required for SSL requests. Possible + * values include: '1.0', '1.1', '1.2' + * + * @param {string} [siteEnvelope.siteConfig.ftpsState] State of FTP / FTPS + * service. Possible values include: 'AllAllowed', 'FtpsOnly', 'Disabled' + * + * @param {number} [siteEnvelope.siteConfig.reservedInstanceCount] Number of + * reserved instances. + * This setting only applies to the Consumption Plan + * + * @param {boolean} [siteEnvelope.scmSiteAlsoStopped] true to stop + * SCM (KUDU) site when the app is stopped; otherwise, false. The + * default is false. + * + * @param {object} [siteEnvelope.hostingEnvironmentProfile] App Service + * Environment to use for the app. + * + * @param {string} [siteEnvelope.hostingEnvironmentProfile.id] Resource ID of + * the App Service Environment. + * + * @param {boolean} [siteEnvelope.clientAffinityEnabled] true to + * enable client affinity; false to stop sending session affinity + * cookies, which route client requests in the same session to the same + * instance. Default is true. + * + * @param {boolean} [siteEnvelope.clientCertEnabled] true to + * enable client certificate authentication (TLS mutual authentication); + * otherwise, false. Default is false. + * + * @param {boolean} [siteEnvelope.hostNamesDisabled] true to + * disable the public hostnames of the app; otherwise, false. + * If true, the app is only accessible via API management process. + * + * @param {number} [siteEnvelope.containerSize] Size of the function container. + * + * @param {number} [siteEnvelope.dailyMemoryTimeQuota] Maximum allowed daily + * memory-time quota (applicable on dynamic apps only). + * + * @param {object} [siteEnvelope.cloningInfo] If specified during app creation, + * the app is cloned from a source app. + * + * @param {uuid} [siteEnvelope.cloningInfo.correlationId] Correlation ID of + * cloning operation. This ID ties multiple cloning operations + * together to use the same snapshot. + * + * @param {boolean} [siteEnvelope.cloningInfo.overwrite] true to + * overwrite destination app; otherwise, false. + * + * @param {boolean} [siteEnvelope.cloningInfo.cloneCustomHostNames] + * true to clone custom hostnames from source app; otherwise, + * false. + * + * @param {boolean} [siteEnvelope.cloningInfo.cloneSourceControl] + * true to clone source control from source app; otherwise, + * false. + * + * @param {string} siteEnvelope.cloningInfo.sourceWebAppId ARM resource ID of + * the source app. App resource ID is of the form + * /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName} + * for production slots and + * /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/slots/{slotName} + * for other slots. + * + * @param {string} [siteEnvelope.cloningInfo.hostingEnvironment] App Service + * Environment. + * + * @param {object} [siteEnvelope.cloningInfo.appSettingsOverrides] Application + * setting overrides for cloned app. If specified, these settings override the + * settings cloned + * from source app. Otherwise, application settings from source app are + * retained. + * + * @param {boolean} [siteEnvelope.cloningInfo.configureLoadBalancing] + * true to configure load balancing for source and destination + * app. + * + * @param {string} [siteEnvelope.cloningInfo.trafficManagerProfileId] ARM + * resource ID of the Traffic Manager profile to use, if it exists. Traffic + * Manager resource ID is of the form + * /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/trafficManagerProfiles/{profileName}. + * + * @param {string} [siteEnvelope.cloningInfo.trafficManagerProfileName] Name of + * Traffic Manager profile to create. This is only needed if Traffic Manager + * profile does not already exist. + * + * @param {boolean} [siteEnvelope.httpsOnly] HttpsOnly: configures a web site + * to accept only https requests. Issues redirect for + * http requests + * + * @param {object} [siteEnvelope.identity] + * + * @param {string} [siteEnvelope.identity.type] Type of managed service + * identity. Possible values include: 'SystemAssigned', 'UserAssigned' + * + * @param {array} [siteEnvelope.identity.identityIds] Array of UserAssigned + * managed service identities. + * + * @param {string} [siteEnvelope.kind] Kind of resource. + * + * @param {string} siteEnvelope.location Resource Location. + * + * @param {object} [siteEnvelope.tags] Resource tags. + * + * @param {string} slot Name of the deployment slot to create or update. By + * default, this API attempts to create or modify the production slot. + * + * @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 {Site} - 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. + * + * {Site} [result] - The deserialized result object if an error did not occur. + * See {@link Site} 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. + */ + createOrUpdateSlot(resourceGroupName: string, name: string, siteEnvelope: models.Site, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdateSlot(resourceGroupName: string, name: string, siteEnvelope: models.Site, slot: string, callback: ServiceCallback): void; + createOrUpdateSlot(resourceGroupName: string, name: string, siteEnvelope: models.Site, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Deletes a web, mobile, or API app, or one of the deployment slots. + * + * Deletes a web, mobile, or API app, or one of the deployment slots. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app to delete. + * + * @param {string} slot Name of the deployment slot to delete. By default, the + * API deletes the production slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {boolean} [options.deleteMetrics] If true, web app metrics are also + * deleted. + * + * @param {boolean} [options.deleteEmptyServerFarm] Specify true if the App + * Service plan will be empty after app deletion and you want to delete the + * empty App Service plan. By default, the empty App Service plan is not + * deleted. + * + * @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. + */ + deleteSlotWithHttpOperationResponse(resourceGroupName: string, name: string, slot: 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. + * + * Deletes a web, mobile, or API app, or one of the deployment slots. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app to delete. + * + * @param {string} slot Name of the deployment slot to delete. By default, the + * API deletes the production slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {boolean} [options.deleteMetrics] If true, web app metrics are also + * deleted. + * + * @param {boolean} [options.deleteEmptyServerFarm] Specify true if the App + * Service plan will be empty after app deletion and you want to delete the + * empty App Service plan. By default, the empty App Service plan is not + * deleted. + * + * @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 {null} - 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. + * + * {null} [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. + */ + deleteSlot(resourceGroupName: string, name: string, slot: string, options?: { deleteMetrics? : boolean, deleteEmptyServerFarm? : boolean, customHeaders? : { [headerName: string]: string; } }): Promise; + deleteSlot(resourceGroupName: string, name: string, slot: string, callback: ServiceCallback): void; + deleteSlot(resourceGroupName: string, name: string, slot: string, options: { deleteMetrics? : boolean, deleteEmptyServerFarm? : boolean, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Creates a new web, mobile, or API app in an existing resource + * group, or updates an existing app. + * + * Creates a new web, mobile, or API app in an existing resource group, or + * updates an existing app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Unique name of the app to create or update. To create + * or update a deployment slot, use the {slot} parameter. + * + * @param {object} siteEnvelope A JSON representation of the app properties. + * See example. + * + * @param {boolean} [siteEnvelope.enabled] true if the app is + * enabled; otherwise, false. Setting this value to false disables + * the app (takes the app offline). + * + * @param {array} [siteEnvelope.hostNameSslStates] Hostname SSL states are used + * to manage the SSL bindings for app's hostnames. + * + * @param {string} [siteEnvelope.serverFarmId] Resource ID of the associated + * App Service plan, formatted as: + * "/subscriptions/{subscriptionID}/resourceGroups/{groupName}/providers/Microsoft.Web/serverfarms/{appServicePlanName}". + * + * @param {boolean} [siteEnvelope.reserved] true if reserved; + * otherwise, false. + * + * @param {boolean} [siteEnvelope.isXenon] Obsolete: Hyper-V sandbox. + * + * @param {boolean} [siteEnvelope.hyperV] Hyper-V sandbox. + * + * @param {object} [siteEnvelope.siteConfig] Configuration of the app. + * + * @param {number} [siteEnvelope.siteConfig.numberOfWorkers] Number of workers. + * + * @param {array} [siteEnvelope.siteConfig.defaultDocuments] Default documents. + * + * @param {string} [siteEnvelope.siteConfig.netFrameworkVersion] .NET Framework + * version. + * + * @param {string} [siteEnvelope.siteConfig.phpVersion] Version of PHP. + * + * @param {string} [siteEnvelope.siteConfig.pythonVersion] Version of Python. + * + * @param {string} [siteEnvelope.siteConfig.nodeVersion] Version of Node.js. + * + * @param {string} [siteEnvelope.siteConfig.linuxFxVersion] Linux App Framework + * and version + * + * @param {string} [siteEnvelope.siteConfig.windowsFxVersion] Xenon App + * Framework and version + * + * @param {boolean} [siteEnvelope.siteConfig.requestTracingEnabled] + * true if request tracing is enabled; otherwise, + * false. + * + * @param {date} [siteEnvelope.siteConfig.requestTracingExpirationTime] Request + * tracing expiration time. + * + * @param {boolean} [siteEnvelope.siteConfig.remoteDebuggingEnabled] + * true if remote debugging is enabled; otherwise, + * false. + * + * @param {string} [siteEnvelope.siteConfig.remoteDebuggingVersion] Remote + * debugging version. + * + * @param {boolean} [siteEnvelope.siteConfig.httpLoggingEnabled] + * true if HTTP logging is enabled; otherwise, false. + * + * @param {number} [siteEnvelope.siteConfig.logsDirectorySizeLimit] HTTP logs + * directory size limit. + * + * @param {boolean} [siteEnvelope.siteConfig.detailedErrorLoggingEnabled] + * true if detailed error logging is enabled; otherwise, + * false. + * + * @param {string} [siteEnvelope.siteConfig.publishingUsername] Publishing user + * name. + * + * @param {array} [siteEnvelope.siteConfig.appSettings] Application settings. + * + * @param {object} [siteEnvelope.siteConfig.azureStorageAccounts] User-provided + * Azure storage accounts. + * + * @param {array} [siteEnvelope.siteConfig.connectionStrings] Connection + * strings. + * + * @param {array} [siteEnvelope.siteConfig.handlerMappings] Handler mappings. + * + * @param {string} [siteEnvelope.siteConfig.documentRoot] Document root. + * + * @param {string} [siteEnvelope.siteConfig.scmType] SCM type. Possible values + * include: 'None', 'Dropbox', 'Tfs', 'LocalGit', 'GitHub', 'CodePlexGit', + * 'CodePlexHg', 'BitbucketGit', 'BitbucketHg', 'ExternalGit', 'ExternalHg', + * 'OneDrive', 'VSO' + * + * @param {boolean} [siteEnvelope.siteConfig.use32BitWorkerProcess] + * true to use 32-bit worker process; otherwise, + * false. + * + * @param {boolean} [siteEnvelope.siteConfig.webSocketsEnabled] + * true if WebSocket is enabled; otherwise, false. + * + * @param {boolean} [siteEnvelope.siteConfig.alwaysOn] true if + * Always On is enabled; otherwise, false. + * + * @param {string} [siteEnvelope.siteConfig.javaVersion] Java version. + * + * @param {string} [siteEnvelope.siteConfig.javaContainer] Java container. + * + * @param {string} [siteEnvelope.siteConfig.javaContainerVersion] Java + * container version. + * + * @param {string} [siteEnvelope.siteConfig.appCommandLine] App command line to + * launch. + * + * @param {string} [siteEnvelope.siteConfig.managedPipelineMode] Managed + * pipeline mode. Possible values include: 'Integrated', 'Classic' + * + * @param {array} [siteEnvelope.siteConfig.virtualApplications] Virtual + * applications. + * + * @param {string} [siteEnvelope.siteConfig.loadBalancing] Site load balancing. + * Possible values include: 'WeightedRoundRobin', 'LeastRequests', + * 'LeastResponseTime', 'WeightedTotalTraffic', 'RequestHash' + * + * @param {object} [siteEnvelope.siteConfig.experiments] This is work around + * for polymophic types. + * + * @param {array} [siteEnvelope.siteConfig.experiments.rampUpRules] List of + * ramp-up rules. + * + * @param {object} [siteEnvelope.siteConfig.limits] Site limits. + * + * @param {number} [siteEnvelope.siteConfig.limits.maxPercentageCpu] Maximum + * allowed CPU usage percentage. + * + * @param {number} [siteEnvelope.siteConfig.limits.maxMemoryInMb] Maximum + * allowed memory usage in MB. + * + * @param {number} [siteEnvelope.siteConfig.limits.maxDiskSizeInMb] Maximum + * allowed disk size usage in MB. + * + * @param {boolean} [siteEnvelope.siteConfig.autoHealEnabled] true + * if Auto Heal is enabled; otherwise, false. + * + * @param {object} [siteEnvelope.siteConfig.autoHealRules] Auto Heal rules. + * + * @param {object} [siteEnvelope.siteConfig.autoHealRules.triggers] Conditions + * that describe when to execute the auto-heal actions. + * + * @param {object} [siteEnvelope.siteConfig.autoHealRules.triggers.requests] A + * rule based on total requests. + * + * @param {number} + * [siteEnvelope.siteConfig.autoHealRules.triggers.requests.count] Request + * Count. + * + * @param {string} + * [siteEnvelope.siteConfig.autoHealRules.triggers.requests.timeInterval] Time + * interval. + * + * @param {number} + * [siteEnvelope.siteConfig.autoHealRules.triggers.privateBytesInKB] A rule + * based on private bytes. + * + * @param {array} [siteEnvelope.siteConfig.autoHealRules.triggers.statusCodes] + * A rule based on status codes. + * + * @param {object} + * [siteEnvelope.siteConfig.autoHealRules.triggers.slowRequests] A rule based + * on request execution time. + * + * @param {string} + * [siteEnvelope.siteConfig.autoHealRules.triggers.slowRequests.timeTaken] Time + * taken. + * + * @param {number} + * [siteEnvelope.siteConfig.autoHealRules.triggers.slowRequests.count] Request + * Count. + * + * @param {string} + * [siteEnvelope.siteConfig.autoHealRules.triggers.slowRequests.timeInterval] + * Time interval. + * + * @param {object} [siteEnvelope.siteConfig.autoHealRules.actions] Actions to + * be executed when a rule is triggered. + * + * @param {string} [siteEnvelope.siteConfig.autoHealRules.actions.actionType] + * Predefined action to be taken. Possible values include: 'Recycle', + * 'LogEvent', 'CustomAction' + * + * @param {object} [siteEnvelope.siteConfig.autoHealRules.actions.customAction] + * Custom action to be taken. + * + * @param {string} + * [siteEnvelope.siteConfig.autoHealRules.actions.customAction.exe] Executable + * to be run. + * + * @param {string} + * [siteEnvelope.siteConfig.autoHealRules.actions.customAction.parameters] + * Parameters for the executable. + * + * @param {string} + * [siteEnvelope.siteConfig.autoHealRules.actions.minProcessExecutionTime] + * Minimum time the process must execute + * before taking the action + * + * @param {string} [siteEnvelope.siteConfig.tracingOptions] Tracing options. + * + * @param {string} [siteEnvelope.siteConfig.vnetName] Virtual Network name. + * + * @param {object} [siteEnvelope.siteConfig.cors] Cross-Origin Resource Sharing + * (CORS) settings. + * + * @param {array} [siteEnvelope.siteConfig.cors.allowedOrigins] Gets or sets + * the list of origins that should be allowed to make cross-origin + * calls (for example: http://example.com:12345). Use "*" to allow all. + * + * @param {object} [siteEnvelope.siteConfig.push] Push endpoint settings. + * + * @param {boolean} siteEnvelope.siteConfig.push.isPushEnabled Gets or sets a + * flag indicating whether the Push endpoint is enabled. + * + * @param {string} [siteEnvelope.siteConfig.push.tagWhitelistJson] Gets or sets + * a JSON string containing a list of tags that are whitelisted for use by the + * push registration endpoint. + * + * @param {string} [siteEnvelope.siteConfig.push.tagsRequiringAuth] Gets or + * sets a JSON string containing a list of tags that require user + * authentication to be used in the push registration endpoint. + * Tags can consist of alphanumeric characters and the following: + * '_', '@', '#', '.', ':', '-'. + * Validation should be performed at the PushRequestHandler. + * + * @param {string} [siteEnvelope.siteConfig.push.dynamicTagsJson] Gets or sets + * a JSON string containing a list of dynamic tags that will be evaluated from + * user claims in the push registration endpoint. + * + * @param {string} [siteEnvelope.siteConfig.push.kind] Kind of resource. + * + * @param {object} [siteEnvelope.siteConfig.apiDefinition] Information about + * the formal API definition for the app. + * + * @param {string} [siteEnvelope.siteConfig.apiDefinition.url] The URL of the + * API definition. + * + * @param {string} [siteEnvelope.siteConfig.autoSwapSlotName] Auto-swap slot + * name. + * + * @param {boolean} [siteEnvelope.siteConfig.localMySqlEnabled] + * true to enable local MySQL; otherwise, false. + * + * @param {number} [siteEnvelope.siteConfig.managedServiceIdentityId] Managed + * Service Identity Id + * + * @param {number} [siteEnvelope.siteConfig.xManagedServiceIdentityId] Explicit + * Managed Service Identity Id + * + * @param {array} [siteEnvelope.siteConfig.ipSecurityRestrictions] IP security + * restrictions. + * + * @param {boolean} [siteEnvelope.siteConfig.http20Enabled] Http20Enabled: + * configures a web site to allow clients to connect over http2.0 + * + * @param {string} [siteEnvelope.siteConfig.minTlsVersion] MinTlsVersion: + * configures the minimum version of TLS required for SSL requests. Possible + * values include: '1.0', '1.1', '1.2' + * + * @param {string} [siteEnvelope.siteConfig.ftpsState] State of FTP / FTPS + * service. Possible values include: 'AllAllowed', 'FtpsOnly', 'Disabled' + * + * @param {number} [siteEnvelope.siteConfig.reservedInstanceCount] Number of + * reserved instances. + * This setting only applies to the Consumption Plan + * + * @param {boolean} [siteEnvelope.scmSiteAlsoStopped] true to stop + * SCM (KUDU) site when the app is stopped; otherwise, false. The + * default is false. + * + * @param {object} [siteEnvelope.hostingEnvironmentProfile] App Service + * Environment to use for the app. + * + * @param {string} [siteEnvelope.hostingEnvironmentProfile.id] Resource ID of + * the App Service Environment. + * + * @param {boolean} [siteEnvelope.clientAffinityEnabled] true to + * enable client affinity; false to stop sending session affinity + * cookies, which route client requests in the same session to the same + * instance. Default is true. + * + * @param {boolean} [siteEnvelope.clientCertEnabled] true to + * enable client certificate authentication (TLS mutual authentication); + * otherwise, false. Default is false. + * + * @param {boolean} [siteEnvelope.hostNamesDisabled] true to + * disable the public hostnames of the app; otherwise, false. + * If true, the app is only accessible via API management process. + * + * @param {number} [siteEnvelope.containerSize] Size of the function container. + * + * @param {number} [siteEnvelope.dailyMemoryTimeQuota] Maximum allowed daily + * memory-time quota (applicable on dynamic apps only). + * + * @param {object} [siteEnvelope.cloningInfo] If specified during app creation, + * the app is cloned from a source app. + * + * @param {uuid} [siteEnvelope.cloningInfo.correlationId] Correlation ID of + * cloning operation. This ID ties multiple cloning operations + * together to use the same snapshot. + * + * @param {boolean} [siteEnvelope.cloningInfo.overwrite] true to + * overwrite destination app; otherwise, false. + * + * @param {boolean} [siteEnvelope.cloningInfo.cloneCustomHostNames] + * true to clone custom hostnames from source app; otherwise, + * false. + * + * @param {boolean} [siteEnvelope.cloningInfo.cloneSourceControl] + * true to clone source control from source app; otherwise, + * false. + * + * @param {string} siteEnvelope.cloningInfo.sourceWebAppId ARM resource ID of + * the source app. App resource ID is of the form + * /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName} + * for production slots and + * /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/slots/{slotName} + * for other slots. + * + * @param {string} [siteEnvelope.cloningInfo.hostingEnvironment] App Service + * Environment. + * + * @param {object} [siteEnvelope.cloningInfo.appSettingsOverrides] Application + * setting overrides for cloned app. If specified, these settings override the + * settings cloned + * from source app. Otherwise, application settings from source app are + * retained. + * + * @param {boolean} [siteEnvelope.cloningInfo.configureLoadBalancing] + * true to configure load balancing for source and destination + * app. + * + * @param {string} [siteEnvelope.cloningInfo.trafficManagerProfileId] ARM + * resource ID of the Traffic Manager profile to use, if it exists. Traffic + * Manager resource ID is of the form + * /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/trafficManagerProfiles/{profileName}. + * + * @param {string} [siteEnvelope.cloningInfo.trafficManagerProfileName] Name of + * Traffic Manager profile to create. This is only needed if Traffic Manager + * profile does not already exist. + * + * @param {boolean} [siteEnvelope.httpsOnly] HttpsOnly: configures a web site + * to accept only https requests. Issues redirect for + * http requests + * + * @param {string} [siteEnvelope.kind] Kind of resource. + * + * @param {string} slot Name of the deployment slot to create or update. By + * default, this API attempts to create or modify the production slot. + * + * @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. + */ + updateSlotWithHttpOperationResponse(resourceGroupName: string, name: string, siteEnvelope: models.SitePatchResource, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Creates a new web, mobile, or API app in an existing resource + * group, or updates an existing app. + * + * Creates a new web, mobile, or API app in an existing resource group, or + * updates an existing app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Unique name of the app to create or update. To create + * or update a deployment slot, use the {slot} parameter. + * + * @param {object} siteEnvelope A JSON representation of the app properties. + * See example. + * + * @param {boolean} [siteEnvelope.enabled] true if the app is + * enabled; otherwise, false. Setting this value to false disables + * the app (takes the app offline). + * + * @param {array} [siteEnvelope.hostNameSslStates] Hostname SSL states are used + * to manage the SSL bindings for app's hostnames. + * + * @param {string} [siteEnvelope.serverFarmId] Resource ID of the associated + * App Service plan, formatted as: + * "/subscriptions/{subscriptionID}/resourceGroups/{groupName}/providers/Microsoft.Web/serverfarms/{appServicePlanName}". + * + * @param {boolean} [siteEnvelope.reserved] true if reserved; + * otherwise, false. + * + * @param {boolean} [siteEnvelope.isXenon] Obsolete: Hyper-V sandbox. + * + * @param {boolean} [siteEnvelope.hyperV] Hyper-V sandbox. + * + * @param {object} [siteEnvelope.siteConfig] Configuration of the app. + * + * @param {number} [siteEnvelope.siteConfig.numberOfWorkers] Number of workers. + * + * @param {array} [siteEnvelope.siteConfig.defaultDocuments] Default documents. + * + * @param {string} [siteEnvelope.siteConfig.netFrameworkVersion] .NET Framework + * version. + * + * @param {string} [siteEnvelope.siteConfig.phpVersion] Version of PHP. + * + * @param {string} [siteEnvelope.siteConfig.pythonVersion] Version of Python. + * + * @param {string} [siteEnvelope.siteConfig.nodeVersion] Version of Node.js. + * + * @param {string} [siteEnvelope.siteConfig.linuxFxVersion] Linux App Framework + * and version + * + * @param {string} [siteEnvelope.siteConfig.windowsFxVersion] Xenon App + * Framework and version + * + * @param {boolean} [siteEnvelope.siteConfig.requestTracingEnabled] + * true if request tracing is enabled; otherwise, + * false. + * + * @param {date} [siteEnvelope.siteConfig.requestTracingExpirationTime] Request + * tracing expiration time. + * + * @param {boolean} [siteEnvelope.siteConfig.remoteDebuggingEnabled] + * true if remote debugging is enabled; otherwise, + * false. + * + * @param {string} [siteEnvelope.siteConfig.remoteDebuggingVersion] Remote + * debugging version. + * + * @param {boolean} [siteEnvelope.siteConfig.httpLoggingEnabled] + * true if HTTP logging is enabled; otherwise, false. + * + * @param {number} [siteEnvelope.siteConfig.logsDirectorySizeLimit] HTTP logs + * directory size limit. + * + * @param {boolean} [siteEnvelope.siteConfig.detailedErrorLoggingEnabled] + * true if detailed error logging is enabled; otherwise, + * false. + * + * @param {string} [siteEnvelope.siteConfig.publishingUsername] Publishing user + * name. + * + * @param {array} [siteEnvelope.siteConfig.appSettings] Application settings. + * + * @param {object} [siteEnvelope.siteConfig.azureStorageAccounts] User-provided + * Azure storage accounts. + * + * @param {array} [siteEnvelope.siteConfig.connectionStrings] Connection + * strings. + * + * @param {array} [siteEnvelope.siteConfig.handlerMappings] Handler mappings. + * + * @param {string} [siteEnvelope.siteConfig.documentRoot] Document root. + * + * @param {string} [siteEnvelope.siteConfig.scmType] SCM type. Possible values + * include: 'None', 'Dropbox', 'Tfs', 'LocalGit', 'GitHub', 'CodePlexGit', + * 'CodePlexHg', 'BitbucketGit', 'BitbucketHg', 'ExternalGit', 'ExternalHg', + * 'OneDrive', 'VSO' + * + * @param {boolean} [siteEnvelope.siteConfig.use32BitWorkerProcess] + * true to use 32-bit worker process; otherwise, + * false. + * + * @param {boolean} [siteEnvelope.siteConfig.webSocketsEnabled] + * true if WebSocket is enabled; otherwise, false. + * + * @param {boolean} [siteEnvelope.siteConfig.alwaysOn] true if + * Always On is enabled; otherwise, false. + * + * @param {string} [siteEnvelope.siteConfig.javaVersion] Java version. + * + * @param {string} [siteEnvelope.siteConfig.javaContainer] Java container. + * + * @param {string} [siteEnvelope.siteConfig.javaContainerVersion] Java + * container version. + * + * @param {string} [siteEnvelope.siteConfig.appCommandLine] App command line to + * launch. + * + * @param {string} [siteEnvelope.siteConfig.managedPipelineMode] Managed + * pipeline mode. Possible values include: 'Integrated', 'Classic' + * + * @param {array} [siteEnvelope.siteConfig.virtualApplications] Virtual + * applications. + * + * @param {string} [siteEnvelope.siteConfig.loadBalancing] Site load balancing. + * Possible values include: 'WeightedRoundRobin', 'LeastRequests', + * 'LeastResponseTime', 'WeightedTotalTraffic', 'RequestHash' + * + * @param {object} [siteEnvelope.siteConfig.experiments] This is work around + * for polymophic types. + * + * @param {array} [siteEnvelope.siteConfig.experiments.rampUpRules] List of + * ramp-up rules. + * + * @param {object} [siteEnvelope.siteConfig.limits] Site limits. + * + * @param {number} [siteEnvelope.siteConfig.limits.maxPercentageCpu] Maximum + * allowed CPU usage percentage. + * + * @param {number} [siteEnvelope.siteConfig.limits.maxMemoryInMb] Maximum + * allowed memory usage in MB. + * + * @param {number} [siteEnvelope.siteConfig.limits.maxDiskSizeInMb] Maximum + * allowed disk size usage in MB. + * + * @param {boolean} [siteEnvelope.siteConfig.autoHealEnabled] true + * if Auto Heal is enabled; otherwise, false. + * + * @param {object} [siteEnvelope.siteConfig.autoHealRules] Auto Heal rules. + * + * @param {object} [siteEnvelope.siteConfig.autoHealRules.triggers] Conditions + * that describe when to execute the auto-heal actions. + * + * @param {object} [siteEnvelope.siteConfig.autoHealRules.triggers.requests] A + * rule based on total requests. + * + * @param {number} + * [siteEnvelope.siteConfig.autoHealRules.triggers.requests.count] Request + * Count. + * + * @param {string} + * [siteEnvelope.siteConfig.autoHealRules.triggers.requests.timeInterval] Time + * interval. + * + * @param {number} + * [siteEnvelope.siteConfig.autoHealRules.triggers.privateBytesInKB] A rule + * based on private bytes. + * + * @param {array} [siteEnvelope.siteConfig.autoHealRules.triggers.statusCodes] + * A rule based on status codes. + * + * @param {object} + * [siteEnvelope.siteConfig.autoHealRules.triggers.slowRequests] A rule based + * on request execution time. + * + * @param {string} + * [siteEnvelope.siteConfig.autoHealRules.triggers.slowRequests.timeTaken] Time + * taken. + * + * @param {number} + * [siteEnvelope.siteConfig.autoHealRules.triggers.slowRequests.count] Request + * Count. + * + * @param {string} + * [siteEnvelope.siteConfig.autoHealRules.triggers.slowRequests.timeInterval] + * Time interval. + * + * @param {object} [siteEnvelope.siteConfig.autoHealRules.actions] Actions to + * be executed when a rule is triggered. + * + * @param {string} [siteEnvelope.siteConfig.autoHealRules.actions.actionType] + * Predefined action to be taken. Possible values include: 'Recycle', + * 'LogEvent', 'CustomAction' + * + * @param {object} [siteEnvelope.siteConfig.autoHealRules.actions.customAction] + * Custom action to be taken. + * + * @param {string} + * [siteEnvelope.siteConfig.autoHealRules.actions.customAction.exe] Executable + * to be run. + * + * @param {string} + * [siteEnvelope.siteConfig.autoHealRules.actions.customAction.parameters] + * Parameters for the executable. + * + * @param {string} + * [siteEnvelope.siteConfig.autoHealRules.actions.minProcessExecutionTime] + * Minimum time the process must execute + * before taking the action + * + * @param {string} [siteEnvelope.siteConfig.tracingOptions] Tracing options. + * + * @param {string} [siteEnvelope.siteConfig.vnetName] Virtual Network name. + * + * @param {object} [siteEnvelope.siteConfig.cors] Cross-Origin Resource Sharing + * (CORS) settings. + * + * @param {array} [siteEnvelope.siteConfig.cors.allowedOrigins] Gets or sets + * the list of origins that should be allowed to make cross-origin + * calls (for example: http://example.com:12345). Use "*" to allow all. + * + * @param {object} [siteEnvelope.siteConfig.push] Push endpoint settings. + * + * @param {boolean} siteEnvelope.siteConfig.push.isPushEnabled Gets or sets a + * flag indicating whether the Push endpoint is enabled. + * + * @param {string} [siteEnvelope.siteConfig.push.tagWhitelistJson] Gets or sets + * a JSON string containing a list of tags that are whitelisted for use by the + * push registration endpoint. + * + * @param {string} [siteEnvelope.siteConfig.push.tagsRequiringAuth] Gets or + * sets a JSON string containing a list of tags that require user + * authentication to be used in the push registration endpoint. + * Tags can consist of alphanumeric characters and the following: + * '_', '@', '#', '.', ':', '-'. + * Validation should be performed at the PushRequestHandler. + * + * @param {string} [siteEnvelope.siteConfig.push.dynamicTagsJson] Gets or sets + * a JSON string containing a list of dynamic tags that will be evaluated from + * user claims in the push registration endpoint. + * + * @param {string} [siteEnvelope.siteConfig.push.kind] Kind of resource. + * + * @param {object} [siteEnvelope.siteConfig.apiDefinition] Information about + * the formal API definition for the app. + * + * @param {string} [siteEnvelope.siteConfig.apiDefinition.url] The URL of the + * API definition. + * + * @param {string} [siteEnvelope.siteConfig.autoSwapSlotName] Auto-swap slot + * name. + * + * @param {boolean} [siteEnvelope.siteConfig.localMySqlEnabled] + * true to enable local MySQL; otherwise, false. + * + * @param {number} [siteEnvelope.siteConfig.managedServiceIdentityId] Managed + * Service Identity Id + * + * @param {number} [siteEnvelope.siteConfig.xManagedServiceIdentityId] Explicit + * Managed Service Identity Id + * + * @param {array} [siteEnvelope.siteConfig.ipSecurityRestrictions] IP security + * restrictions. + * + * @param {boolean} [siteEnvelope.siteConfig.http20Enabled] Http20Enabled: + * configures a web site to allow clients to connect over http2.0 + * + * @param {string} [siteEnvelope.siteConfig.minTlsVersion] MinTlsVersion: + * configures the minimum version of TLS required for SSL requests. Possible + * values include: '1.0', '1.1', '1.2' + * + * @param {string} [siteEnvelope.siteConfig.ftpsState] State of FTP / FTPS + * service. Possible values include: 'AllAllowed', 'FtpsOnly', 'Disabled' + * + * @param {number} [siteEnvelope.siteConfig.reservedInstanceCount] Number of + * reserved instances. + * This setting only applies to the Consumption Plan + * + * @param {boolean} [siteEnvelope.scmSiteAlsoStopped] true to stop + * SCM (KUDU) site when the app is stopped; otherwise, false. The + * default is false. + * + * @param {object} [siteEnvelope.hostingEnvironmentProfile] App Service + * Environment to use for the app. + * + * @param {string} [siteEnvelope.hostingEnvironmentProfile.id] Resource ID of + * the App Service Environment. + * + * @param {boolean} [siteEnvelope.clientAffinityEnabled] true to + * enable client affinity; false to stop sending session affinity + * cookies, which route client requests in the same session to the same + * instance. Default is true. + * + * @param {boolean} [siteEnvelope.clientCertEnabled] true to + * enable client certificate authentication (TLS mutual authentication); + * otherwise, false. Default is false. + * + * @param {boolean} [siteEnvelope.hostNamesDisabled] true to + * disable the public hostnames of the app; otherwise, false. + * If true, the app is only accessible via API management process. + * + * @param {number} [siteEnvelope.containerSize] Size of the function container. + * + * @param {number} [siteEnvelope.dailyMemoryTimeQuota] Maximum allowed daily + * memory-time quota (applicable on dynamic apps only). + * + * @param {object} [siteEnvelope.cloningInfo] If specified during app creation, + * the app is cloned from a source app. + * + * @param {uuid} [siteEnvelope.cloningInfo.correlationId] Correlation ID of + * cloning operation. This ID ties multiple cloning operations + * together to use the same snapshot. + * + * @param {boolean} [siteEnvelope.cloningInfo.overwrite] true to + * overwrite destination app; otherwise, false. + * + * @param {boolean} [siteEnvelope.cloningInfo.cloneCustomHostNames] + * true to clone custom hostnames from source app; otherwise, + * false. + * + * @param {boolean} [siteEnvelope.cloningInfo.cloneSourceControl] + * true to clone source control from source app; otherwise, + * false. + * + * @param {string} siteEnvelope.cloningInfo.sourceWebAppId ARM resource ID of + * the source app. App resource ID is of the form + * /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName} + * for production slots and + * /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/slots/{slotName} + * for other slots. + * + * @param {string} [siteEnvelope.cloningInfo.hostingEnvironment] App Service + * Environment. + * + * @param {object} [siteEnvelope.cloningInfo.appSettingsOverrides] Application + * setting overrides for cloned app. If specified, these settings override the + * settings cloned + * from source app. Otherwise, application settings from source app are + * retained. + * + * @param {boolean} [siteEnvelope.cloningInfo.configureLoadBalancing] + * true to configure load balancing for source and destination + * app. + * + * @param {string} [siteEnvelope.cloningInfo.trafficManagerProfileId] ARM + * resource ID of the Traffic Manager profile to use, if it exists. Traffic + * Manager resource ID is of the form + * /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/trafficManagerProfiles/{profileName}. + * + * @param {string} [siteEnvelope.cloningInfo.trafficManagerProfileName] Name of + * Traffic Manager profile to create. This is only needed if Traffic Manager + * profile does not already exist. + * + * @param {boolean} [siteEnvelope.httpsOnly] HttpsOnly: configures a web site + * to accept only https requests. Issues redirect for + * http requests + * + * @param {string} [siteEnvelope.kind] Kind of resource. + * + * @param {string} slot Name of the deployment slot to create or update. By + * default, this API attempts to create or modify the production slot. + * + * @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 {Site} - 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. + * + * {Site} [result] - The deserialized result object if an error did not occur. + * See {@link Site} 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. + */ + updateSlot(resourceGroupName: string, name: string, siteEnvelope: models.SitePatchResource, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + updateSlot(resourceGroupName: string, name: string, siteEnvelope: models.SitePatchResource, slot: string, callback: ServiceCallback): void; + updateSlot(resourceGroupName: string, name: string, siteEnvelope: models.SitePatchResource, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Analyze a custom hostname. + * + * Analyze a custom hostname. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {string} slot Name of web app slot. If not specified then will + * default to production slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.hostName] Custom hostname. + * + * @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. + */ + analyzeCustomHostnameSlotWithHttpOperationResponse(resourceGroupName: string, name: string, slot: string, options?: { hostName? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Analyze a custom hostname. + * + * Analyze a custom hostname. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {string} slot Name of web app slot. If not specified then will + * default to production slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.hostName] Custom hostname. + * + * @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 {CustomHostnameAnalysisResult} - 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. + * + * {CustomHostnameAnalysisResult} [result] - The deserialized result object if an error did not occur. + * See {@link CustomHostnameAnalysisResult} 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. + */ + analyzeCustomHostnameSlot(resourceGroupName: string, name: string, slot: string, options?: { hostName? : string, customHeaders? : { [headerName: string]: string; } }): Promise; + analyzeCustomHostnameSlot(resourceGroupName: string, name: string, slot: string, callback: ServiceCallback): void; + analyzeCustomHostnameSlot(resourceGroupName: string, name: string, slot: string, options: { hostName? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Applies the configuration settings from the target slot onto the + * current slot. + * + * Applies the configuration settings from the target slot onto the current + * slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} slotSwapEntity JSON object that contains the target slot + * name. See example. + * + * @param {string} slotSwapEntity.targetSlot Destination deployment slot during + * swap operation. + * + * @param {boolean} slotSwapEntity.preserveVnet true to preserve + * Virtual Network to the slot during swap; otherwise, false. + * + * @param {string} slot Name of the source slot. If a slot is not specified, + * the production slot is used as the source slot. + * + * @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. + */ + applySlotConfigurationSlotWithHttpOperationResponse(resourceGroupName: string, name: string, slotSwapEntity: models.CsmSlotEntity, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Applies the configuration settings from the target slot onto the + * current slot. + * + * Applies the configuration settings from the target slot onto the current + * slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} slotSwapEntity JSON object that contains the target slot + * name. See example. + * + * @param {string} slotSwapEntity.targetSlot Destination deployment slot during + * swap operation. + * + * @param {boolean} slotSwapEntity.preserveVnet true to preserve + * Virtual Network to the slot during swap; otherwise, false. + * + * @param {string} slot Name of the source slot. If a slot is not specified, + * the production slot is used as the source slot. + * + * @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 {null} - 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. + * + * {null} [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. + */ + applySlotConfigurationSlot(resourceGroupName: string, name: string, slotSwapEntity: models.CsmSlotEntity, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + applySlotConfigurationSlot(resourceGroupName: string, name: string, slotSwapEntity: models.CsmSlotEntity, slot: string, callback: ServiceCallback): void; + applySlotConfigurationSlot(resourceGroupName: string, name: string, slotSwapEntity: models.CsmSlotEntity, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Creates a backup of an app. + * + * Creates a backup of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} request Backup configuration. You can use the JSON response + * from the POST action as input here. + * + * @param {string} [request.backupName] Name of the backup. + * + * @param {boolean} [request.enabled] True if the backup schedule is enabled + * (must be included in that case), false if the backup schedule should be + * disabled. + * + * @param {string} request.storageAccountUrl SAS URL to the container. + * + * @param {object} [request.backupSchedule] Schedule for the backup if it is + * executed periodically. + * + * @param {number} request.backupSchedule.frequencyInterval How often the + * backup should be executed (e.g. for weekly backup, this should be set to 7 + * and FrequencyUnit should be set to Day) + * + * @param {string} request.backupSchedule.frequencyUnit The unit of time for + * how often the backup should be executed (e.g. for weekly backup, this should + * be set to Day and FrequencyInterval should be set to 7). Possible values + * include: 'Day', 'Hour' + * + * @param {boolean} request.backupSchedule.keepAtLeastOneBackup True if the + * retention policy should always keep at least one backup in the storage + * account, regardless how old it is; false otherwise. + * + * @param {number} request.backupSchedule.retentionPeriodInDays After how many + * days backups should be deleted. + * + * @param {date} [request.backupSchedule.startTime] When the schedule should + * start working. + * + * @param {array} [request.databases] Databases included in the backup. + * + * @param {string} [request.kind] Kind of resource. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will create a backup for the production slot. + * + * @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. + */ + backupSlotWithHttpOperationResponse(resourceGroupName: string, name: string, request: models.BackupRequest, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Creates a backup of an app. + * + * Creates a backup of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} request Backup configuration. You can use the JSON response + * from the POST action as input here. + * + * @param {string} [request.backupName] Name of the backup. + * + * @param {boolean} [request.enabled] True if the backup schedule is enabled + * (must be included in that case), false if the backup schedule should be + * disabled. + * + * @param {string} request.storageAccountUrl SAS URL to the container. + * + * @param {object} [request.backupSchedule] Schedule for the backup if it is + * executed periodically. + * + * @param {number} request.backupSchedule.frequencyInterval How often the + * backup should be executed (e.g. for weekly backup, this should be set to 7 + * and FrequencyUnit should be set to Day) + * + * @param {string} request.backupSchedule.frequencyUnit The unit of time for + * how often the backup should be executed (e.g. for weekly backup, this should + * be set to Day and FrequencyInterval should be set to 7). Possible values + * include: 'Day', 'Hour' + * + * @param {boolean} request.backupSchedule.keepAtLeastOneBackup True if the + * retention policy should always keep at least one backup in the storage + * account, regardless how old it is; false otherwise. + * + * @param {number} request.backupSchedule.retentionPeriodInDays After how many + * days backups should be deleted. + * + * @param {date} [request.backupSchedule.startTime] When the schedule should + * start working. + * + * @param {array} [request.databases] Databases included in the backup. + * + * @param {string} [request.kind] Kind of resource. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will create a backup for the production slot. + * + * @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 {BackupItem} - 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. + * + * {BackupItem} [result] - The deserialized result object if an error did not occur. + * See {@link BackupItem} 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. + */ + backupSlot(resourceGroupName: string, name: string, request: models.BackupRequest, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + backupSlot(resourceGroupName: string, name: string, request: models.BackupRequest, slot: string, callback: ServiceCallback): void; + backupSlot(resourceGroupName: string, name: string, request: models.BackupRequest, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Gets existing backups of an app. + * + * Gets existing backups of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will get backups of the production slot. + * + * @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. + */ + listBackupsSlotWithHttpOperationResponse(resourceGroupName: string, name: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets existing backups of an app. + * + * Gets existing backups of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will get backups of the production slot. + * + * @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 {BackupItemCollection} - 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. + * + * {BackupItemCollection} [result] - The deserialized result object if an error did not occur. + * See {@link BackupItemCollection} 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. + */ + listBackupsSlot(resourceGroupName: string, name: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listBackupsSlot(resourceGroupName: string, name: string, slot: string, callback: ServiceCallback): void; + listBackupsSlot(resourceGroupName: string, name: string, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Gets a backup of an app by its ID. + * + * Gets a backup of an app by its ID. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} backupId ID of the backup. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will get a backup of the production slot. + * + * @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. + */ + getBackupStatusSlotWithHttpOperationResponse(resourceGroupName: string, name: string, backupId: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets a backup of an app by its ID. + * + * Gets a backup of an app by its ID. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} backupId ID of the backup. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will get a backup of the production slot. + * + * @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 {BackupItem} - 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. + * + * {BackupItem} [result] - The deserialized result object if an error did not occur. + * See {@link BackupItem} 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. + */ + getBackupStatusSlot(resourceGroupName: string, name: string, backupId: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getBackupStatusSlot(resourceGroupName: string, name: string, backupId: string, slot: string, callback: ServiceCallback): void; + getBackupStatusSlot(resourceGroupName: string, name: string, backupId: string, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Deletes a backup of an app by its ID. + * + * Deletes a backup of an app by its ID. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} backupId ID of the backup. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will delete a backup of the production slot. + * + * @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. + */ + deleteBackupSlotWithHttpOperationResponse(resourceGroupName: string, name: string, backupId: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Deletes a backup of an app by its ID. + * + * Deletes a backup of an app by its ID. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} backupId ID of the backup. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will delete a backup of the production slot. + * + * @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 {null} - 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. + * + * {null} [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. + */ + deleteBackupSlot(resourceGroupName: string, name: string, backupId: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteBackupSlot(resourceGroupName: string, name: string, backupId: string, slot: string, callback: ServiceCallback): void; + deleteBackupSlot(resourceGroupName: string, name: string, backupId: string, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Gets status of a web app backup that may be in progress, including + * secrets associated with the backup, such as the Azure Storage SAS URL. Also + * can be used to update the SAS URL for the backup if a new URL is passed in + * the request body. + * + * Gets status of a web app backup that may be in progress, including secrets + * associated with the backup, such as the Azure Storage SAS URL. Also can be + * used to update the SAS URL for the backup if a new URL is passed in the + * request body. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {string} backupId ID of backup. + * + * @param {object} request Information on backup request. + * + * @param {string} [request.backupName] Name of the backup. + * + * @param {boolean} [request.enabled] True if the backup schedule is enabled + * (must be included in that case), false if the backup schedule should be + * disabled. + * + * @param {string} request.storageAccountUrl SAS URL to the container. + * + * @param {object} [request.backupSchedule] Schedule for the backup if it is + * executed periodically. + * + * @param {number} request.backupSchedule.frequencyInterval How often the + * backup should be executed (e.g. for weekly backup, this should be set to 7 + * and FrequencyUnit should be set to Day) + * + * @param {string} request.backupSchedule.frequencyUnit The unit of time for + * how often the backup should be executed (e.g. for weekly backup, this should + * be set to Day and FrequencyInterval should be set to 7). Possible values + * include: 'Day', 'Hour' + * + * @param {boolean} request.backupSchedule.keepAtLeastOneBackup True if the + * retention policy should always keep at least one backup in the storage + * account, regardless how old it is; false otherwise. + * + * @param {number} request.backupSchedule.retentionPeriodInDays After how many + * days backups should be deleted. + * + * @param {date} [request.backupSchedule.startTime] When the schedule should + * start working. + * + * @param {array} [request.databases] Databases included in the backup. + * + * @param {string} [request.kind] Kind of resource. + * + * @param {string} slot Name of web app slot. If not specified then will + * default to production slot. + * + * @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. + */ + listBackupStatusSecretsSlotWithHttpOperationResponse(resourceGroupName: string, name: string, backupId: string, request: models.BackupRequest, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets status of a web app backup that may be in progress, including + * secrets associated with the backup, such as the Azure Storage SAS URL. Also + * can be used to update the SAS URL for the backup if a new URL is passed in + * the request body. + * + * Gets status of a web app backup that may be in progress, including secrets + * associated with the backup, such as the Azure Storage SAS URL. Also can be + * used to update the SAS URL for the backup if a new URL is passed in the + * request body. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {string} backupId ID of backup. + * + * @param {object} request Information on backup request. + * + * @param {string} [request.backupName] Name of the backup. + * + * @param {boolean} [request.enabled] True if the backup schedule is enabled + * (must be included in that case), false if the backup schedule should be + * disabled. + * + * @param {string} request.storageAccountUrl SAS URL to the container. + * + * @param {object} [request.backupSchedule] Schedule for the backup if it is + * executed periodically. + * + * @param {number} request.backupSchedule.frequencyInterval How often the + * backup should be executed (e.g. for weekly backup, this should be set to 7 + * and FrequencyUnit should be set to Day) + * + * @param {string} request.backupSchedule.frequencyUnit The unit of time for + * how often the backup should be executed (e.g. for weekly backup, this should + * be set to Day and FrequencyInterval should be set to 7). Possible values + * include: 'Day', 'Hour' + * + * @param {boolean} request.backupSchedule.keepAtLeastOneBackup True if the + * retention policy should always keep at least one backup in the storage + * account, regardless how old it is; false otherwise. + * + * @param {number} request.backupSchedule.retentionPeriodInDays After how many + * days backups should be deleted. + * + * @param {date} [request.backupSchedule.startTime] When the schedule should + * start working. + * + * @param {array} [request.databases] Databases included in the backup. + * + * @param {string} [request.kind] Kind of resource. + * + * @param {string} slot Name of web app slot. If not specified then will + * default to production slot. + * + * @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 {BackupItem} - 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. + * + * {BackupItem} [result] - The deserialized result object if an error did not occur. + * See {@link BackupItem} 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. + */ + listBackupStatusSecretsSlot(resourceGroupName: string, name: string, backupId: string, request: models.BackupRequest, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listBackupStatusSecretsSlot(resourceGroupName: string, name: string, backupId: string, request: models.BackupRequest, slot: string, callback: ServiceCallback): void; + listBackupStatusSecretsSlot(resourceGroupName: string, name: string, backupId: string, request: models.BackupRequest, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Restores a specific backup to another app (or deployment slot, if + * specified). + * + * Restores a specific backup to another app (or deployment slot, if + * specified). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} backupId ID of the backup. + * + * @param {object} request Information on restore request . + * + * @param {string} request.storageAccountUrl SAS URL to the container. + * + * @param {string} [request.blobName] Name of a blob which contains the backup. + * + * @param {boolean} request.overwrite true if the restore + * operation can overwrite target app; otherwise, false. + * true is needed if trying to restore over an existing app. + * + * @param {string} [request.siteName] Name of an app. + * + * @param {array} [request.databases] Collection of databases which should be + * restored. This list has to match the list of databases included in the + * backup. + * + * @param {boolean} [request.ignoreConflictingHostNames] Changes a logic when + * restoring an app with custom domains. true to remove custom + * domains automatically. If false, custom domains are added to + * the app's object when it is being restored, but that might fail due to + * conflicts during the operation. + * + * @param {boolean} [request.ignoreDatabases] Ignore the databases and only + * restore the site content + * + * @param {string} [request.appServicePlan] Specify app service plan that will + * own restored site. + * + * @param {string} [request.operationType] Operation type. Possible values + * include: 'Default', 'Clone', 'Relocation', 'Snapshot', 'CloudFS' + * + * @param {boolean} [request.adjustConnectionStrings] true if + * SiteConfig.ConnectionStrings should be set in new app; otherwise, + * false. + * + * @param {string} [request.hostingEnvironment] App Service Environment name, + * if needed (only when restoring an app to an App Service Environment). + * + * @param {string} [request.kind] Kind of resource. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will restore a backup of the production slot. + * + * @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. + */ + restoreSlotWithHttpOperationResponse(resourceGroupName: string, name: string, backupId: string, request: models.RestoreRequest, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Restores a specific backup to another app (or deployment slot, if + * specified). + * + * Restores a specific backup to another app (or deployment slot, if + * specified). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} backupId ID of the backup. + * + * @param {object} request Information on restore request . + * + * @param {string} request.storageAccountUrl SAS URL to the container. + * + * @param {string} [request.blobName] Name of a blob which contains the backup. + * + * @param {boolean} request.overwrite true if the restore + * operation can overwrite target app; otherwise, false. + * true is needed if trying to restore over an existing app. + * + * @param {string} [request.siteName] Name of an app. + * + * @param {array} [request.databases] Collection of databases which should be + * restored. This list has to match the list of databases included in the + * backup. + * + * @param {boolean} [request.ignoreConflictingHostNames] Changes a logic when + * restoring an app with custom domains. true to remove custom + * domains automatically. If false, custom domains are added to + * the app's object when it is being restored, but that might fail due to + * conflicts during the operation. + * + * @param {boolean} [request.ignoreDatabases] Ignore the databases and only + * restore the site content + * + * @param {string} [request.appServicePlan] Specify app service plan that will + * own restored site. + * + * @param {string} [request.operationType] Operation type. Possible values + * include: 'Default', 'Clone', 'Relocation', 'Snapshot', 'CloudFS' + * + * @param {boolean} [request.adjustConnectionStrings] true if + * SiteConfig.ConnectionStrings should be set in new app; otherwise, + * false. + * + * @param {string} [request.hostingEnvironment] App Service Environment name, + * if needed (only when restoring an app to an App Service Environment). + * + * @param {string} [request.kind] Kind of resource. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will restore a backup of the production slot. + * + * @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 {null} - 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. + * + * {null} [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. + */ + restoreSlot(resourceGroupName: string, name: string, backupId: string, request: models.RestoreRequest, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + restoreSlot(resourceGroupName: string, name: string, backupId: string, request: models.RestoreRequest, slot: string, callback: ServiceCallback): void; + restoreSlot(resourceGroupName: string, name: string, backupId: string, request: models.RestoreRequest, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary List the configurations of an app + * + * List the configurations of an app + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will return configuration for the production slot. + * + * @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. + */ + listConfigurationsSlotWithHttpOperationResponse(resourceGroupName: string, name: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary List the configurations of an app + * + * List the configurations of an app + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will return configuration for the production slot. + * + * @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 {SiteConfigResourceCollection} - 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. + * + * {SiteConfigResourceCollection} [result] - The deserialized result object if an error did not occur. + * See {@link SiteConfigResourceCollection} 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. + */ + listConfigurationsSlot(resourceGroupName: string, name: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listConfigurationsSlot(resourceGroupName: string, name: string, slot: string, callback: ServiceCallback): void; + listConfigurationsSlot(resourceGroupName: string, name: string, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Replaces the application settings of an app. + * + * Replaces the application settings of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} appSettings Application settings of the app. + * + * @param {object} [appSettings.properties] Settings. + * + * @param {string} [appSettings.kind] Kind of resource. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will update the application settings for the production + * slot. + * + * @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. + */ + updateApplicationSettingsSlotWithHttpOperationResponse(resourceGroupName: string, name: string, appSettings: models.StringDictionary, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Replaces the application settings of an app. + * + * Replaces the application settings of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} appSettings Application settings of the app. + * + * @param {object} [appSettings.properties] Settings. + * + * @param {string} [appSettings.kind] Kind of resource. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will update the application settings for the production + * slot. + * + * @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 {StringDictionary} - 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. + * + * {StringDictionary} [result] - The deserialized result object if an error did not occur. + * See {@link StringDictionary} 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. + */ + updateApplicationSettingsSlot(resourceGroupName: string, name: string, appSettings: models.StringDictionary, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + updateApplicationSettingsSlot(resourceGroupName: string, name: string, appSettings: models.StringDictionary, slot: string, callback: ServiceCallback): void; + updateApplicationSettingsSlot(resourceGroupName: string, name: string, appSettings: models.StringDictionary, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Gets the application settings of an app. + * + * Gets the application settings of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will get the application settings for the production + * slot. + * + * @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. + */ + listApplicationSettingsSlotWithHttpOperationResponse(resourceGroupName: string, name: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets the application settings of an app. + * + * Gets the application settings of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will get the application settings for the production + * slot. + * + * @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 {StringDictionary} - 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. + * + * {StringDictionary} [result] - The deserialized result object if an error did not occur. + * See {@link StringDictionary} 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. + */ + listApplicationSettingsSlot(resourceGroupName: string, name: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listApplicationSettingsSlot(resourceGroupName: string, name: string, slot: string, callback: ServiceCallback): void; + listApplicationSettingsSlot(resourceGroupName: string, name: string, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Updates the Authentication / Authorization settings associated with + * web app. + * + * Updates the Authentication / Authorization settings associated with web app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {object} siteAuthSettings Auth settings associated with web app. + * + * @param {boolean} [siteAuthSettings.enabled] true if the + * Authentication / Authorization feature is enabled for the current app; + * otherwise, false. + * + * @param {string} [siteAuthSettings.runtimeVersion] The RuntimeVersion of the + * Authentication / Authorization feature in use for the current app. + * The setting in this value can control the behavior of certain features in + * the Authentication / Authorization module. + * + * @param {string} [siteAuthSettings.unauthenticatedClientAction] The action to + * take when an unauthenticated client attempts to access the app. Possible + * values include: 'RedirectToLoginPage', 'AllowAnonymous' + * + * @param {boolean} [siteAuthSettings.tokenStoreEnabled] true to + * durably store platform-specific security tokens that are obtained during + * login flows; otherwise, false. + * The default is false. + * + * @param {array} [siteAuthSettings.allowedExternalRedirectUrls] External URLs + * that can be redirected to as part of logging in or logging out of the app. + * Note that the query string part of the URL is ignored. + * This is an advanced setting typically only needed by Windows Store + * application backends. + * Note that URLs within the current domain are always implicitly allowed. + * + * @param {string} [siteAuthSettings.defaultProvider] The default + * authentication provider to use when multiple providers are configured. + * This setting is only needed if multiple providers are configured and the + * unauthenticated client + * action is set to "RedirectToLoginPage". Possible values include: + * 'AzureActiveDirectory', 'Facebook', 'Google', 'MicrosoftAccount', 'Twitter' + * + * @param {number} [siteAuthSettings.tokenRefreshExtensionHours] The number of + * hours after session token expiration that a session token can be used to + * call the token refresh API. The default is 72 hours. + * + * @param {string} [siteAuthSettings.clientId] The Client ID of this relying + * party application, known as the client_id. + * This setting is required for enabling OpenID Connection authentication with + * Azure Active Directory or + * other 3rd party OpenID Connect providers. + * More information on OpenID Connect: + * http://openid.net/specs/openid-connect-core-1_0.html + * + * @param {string} [siteAuthSettings.clientSecret] The Client Secret of this + * relying party application (in Azure Active Directory, this is also referred + * to as the Key). + * This setting is optional. If no client secret is configured, the OpenID + * Connect implicit auth flow is used to authenticate end users. + * Otherwise, the OpenID Connect Authorization Code Flow is used to + * authenticate end users. + * More information on OpenID Connect: + * http://openid.net/specs/openid-connect-core-1_0.html + * + * @param {string} [siteAuthSettings.issuer] The OpenID Connect Issuer URI that + * represents the entity which issues access tokens for this application. + * When using Azure Active Directory, this value is the URI of the directory + * tenant, e.g. https://sts.windows.net/{tenant-guid}/. + * This URI is a case-sensitive identifier for the token issuer. + * More information on OpenID Connect Discovery: + * http://openid.net/specs/openid-connect-discovery-1_0.html + * + * @param {boolean} [siteAuthSettings.validateIssuer] Gets a value indicating + * whether the issuer should be a valid HTTPS url and be validated as such. + * + * @param {array} [siteAuthSettings.allowedAudiences] Allowed audience values + * to consider when validating JWTs issued by + * Azure Active Directory. Note that the ClientID value is always + * considered an + * allowed audience, regardless of this setting. + * + * @param {array} [siteAuthSettings.additionalLoginParams] Login parameters to + * send to the OpenID Connect authorization endpoint when + * a user logs in. Each parameter must be in the form "key=value". + * + * @param {string} [siteAuthSettings.googleClientId] The OpenID Connect Client + * ID for the Google web application. + * This setting is required for enabling Google Sign-In. + * Google Sign-In documentation: + * https://developers.google.com/identity/sign-in/web/ + * + * @param {string} [siteAuthSettings.googleClientSecret] The client secret + * associated with the Google web application. + * This setting is required for enabling Google Sign-In. + * Google Sign-In documentation: + * https://developers.google.com/identity/sign-in/web/ + * + * @param {array} [siteAuthSettings.googleOAuthScopes] The OAuth 2.0 scopes + * that will be requested as part of Google Sign-In authentication. + * This setting is optional. If not specified, "openid", "profile", and "email" + * are used as default scopes. + * Google Sign-In documentation: + * https://developers.google.com/identity/sign-in/web/ + * + * @param {string} [siteAuthSettings.facebookAppId] The App ID of the Facebook + * app used for login. + * This setting is required for enabling Facebook Login. + * Facebook Login documentation: + * https://developers.facebook.com/docs/facebook-login + * + * @param {string} [siteAuthSettings.facebookAppSecret] The App Secret of the + * Facebook app used for Facebook Login. + * This setting is required for enabling Facebook Login. + * Facebook Login documentation: + * https://developers.facebook.com/docs/facebook-login + * + * @param {array} [siteAuthSettings.facebookOAuthScopes] The OAuth 2.0 scopes + * that will be requested as part of Facebook Login authentication. + * This setting is optional. + * Facebook Login documentation: + * https://developers.facebook.com/docs/facebook-login + * + * @param {string} [siteAuthSettings.twitterConsumerKey] The OAuth 1.0a + * consumer key of the Twitter application used for sign-in. + * This setting is required for enabling Twitter Sign-In. + * Twitter Sign-In documentation: https://dev.twitter.com/web/sign-in + * + * @param {string} [siteAuthSettings.twitterConsumerSecret] The OAuth 1.0a + * consumer secret of the Twitter application used for sign-in. + * This setting is required for enabling Twitter Sign-In. + * Twitter Sign-In documentation: https://dev.twitter.com/web/sign-in + * + * @param {string} [siteAuthSettings.microsoftAccountClientId] The OAuth 2.0 + * client ID that was created for the app used for authentication. + * This setting is required for enabling Microsoft Account authentication. + * Microsoft Account OAuth documentation: + * https://dev.onedrive.com/auth/msa_oauth.htm + * + * @param {string} [siteAuthSettings.microsoftAccountClientSecret] The OAuth + * 2.0 client secret that was created for the app used for authentication. + * This setting is required for enabling Microsoft Account authentication. + * Microsoft Account OAuth documentation: + * https://dev.onedrive.com/auth/msa_oauth.htm + * + * @param {array} [siteAuthSettings.microsoftAccountOAuthScopes] The OAuth 2.0 + * scopes that will be requested as part of Microsoft Account authentication. + * This setting is optional. If not specified, "wl.basic" is used as the + * default scope. + * Microsoft Account Scopes and permissions documentation: + * https://msdn.microsoft.com/en-us/library/dn631845.aspx + * + * @param {string} [siteAuthSettings.kind] Kind of resource. + * + * @param {string} slot Name of web app slot. If not specified then will + * default to production slot. + * + * @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. + */ + updateAuthSettingsSlotWithHttpOperationResponse(resourceGroupName: string, name: string, siteAuthSettings: models.SiteAuthSettings, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Updates the Authentication / Authorization settings associated with + * web app. + * + * Updates the Authentication / Authorization settings associated with web app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {object} siteAuthSettings Auth settings associated with web app. + * + * @param {boolean} [siteAuthSettings.enabled] true if the + * Authentication / Authorization feature is enabled for the current app; + * otherwise, false. + * + * @param {string} [siteAuthSettings.runtimeVersion] The RuntimeVersion of the + * Authentication / Authorization feature in use for the current app. + * The setting in this value can control the behavior of certain features in + * the Authentication / Authorization module. + * + * @param {string} [siteAuthSettings.unauthenticatedClientAction] The action to + * take when an unauthenticated client attempts to access the app. Possible + * values include: 'RedirectToLoginPage', 'AllowAnonymous' + * + * @param {boolean} [siteAuthSettings.tokenStoreEnabled] true to + * durably store platform-specific security tokens that are obtained during + * login flows; otherwise, false. + * The default is false. + * + * @param {array} [siteAuthSettings.allowedExternalRedirectUrls] External URLs + * that can be redirected to as part of logging in or logging out of the app. + * Note that the query string part of the URL is ignored. + * This is an advanced setting typically only needed by Windows Store + * application backends. + * Note that URLs within the current domain are always implicitly allowed. + * + * @param {string} [siteAuthSettings.defaultProvider] The default + * authentication provider to use when multiple providers are configured. + * This setting is only needed if multiple providers are configured and the + * unauthenticated client + * action is set to "RedirectToLoginPage". Possible values include: + * 'AzureActiveDirectory', 'Facebook', 'Google', 'MicrosoftAccount', 'Twitter' + * + * @param {number} [siteAuthSettings.tokenRefreshExtensionHours] The number of + * hours after session token expiration that a session token can be used to + * call the token refresh API. The default is 72 hours. + * + * @param {string} [siteAuthSettings.clientId] The Client ID of this relying + * party application, known as the client_id. + * This setting is required for enabling OpenID Connection authentication with + * Azure Active Directory or + * other 3rd party OpenID Connect providers. + * More information on OpenID Connect: + * http://openid.net/specs/openid-connect-core-1_0.html + * + * @param {string} [siteAuthSettings.clientSecret] The Client Secret of this + * relying party application (in Azure Active Directory, this is also referred + * to as the Key). + * This setting is optional. If no client secret is configured, the OpenID + * Connect implicit auth flow is used to authenticate end users. + * Otherwise, the OpenID Connect Authorization Code Flow is used to + * authenticate end users. + * More information on OpenID Connect: + * http://openid.net/specs/openid-connect-core-1_0.html + * + * @param {string} [siteAuthSettings.issuer] The OpenID Connect Issuer URI that + * represents the entity which issues access tokens for this application. + * When using Azure Active Directory, this value is the URI of the directory + * tenant, e.g. https://sts.windows.net/{tenant-guid}/. + * This URI is a case-sensitive identifier for the token issuer. + * More information on OpenID Connect Discovery: + * http://openid.net/specs/openid-connect-discovery-1_0.html + * + * @param {boolean} [siteAuthSettings.validateIssuer] Gets a value indicating + * whether the issuer should be a valid HTTPS url and be validated as such. + * + * @param {array} [siteAuthSettings.allowedAudiences] Allowed audience values + * to consider when validating JWTs issued by + * Azure Active Directory. Note that the ClientID value is always + * considered an + * allowed audience, regardless of this setting. + * + * @param {array} [siteAuthSettings.additionalLoginParams] Login parameters to + * send to the OpenID Connect authorization endpoint when + * a user logs in. Each parameter must be in the form "key=value". + * + * @param {string} [siteAuthSettings.googleClientId] The OpenID Connect Client + * ID for the Google web application. + * This setting is required for enabling Google Sign-In. + * Google Sign-In documentation: + * https://developers.google.com/identity/sign-in/web/ + * + * @param {string} [siteAuthSettings.googleClientSecret] The client secret + * associated with the Google web application. + * This setting is required for enabling Google Sign-In. + * Google Sign-In documentation: + * https://developers.google.com/identity/sign-in/web/ + * + * @param {array} [siteAuthSettings.googleOAuthScopes] The OAuth 2.0 scopes + * that will be requested as part of Google Sign-In authentication. + * This setting is optional. If not specified, "openid", "profile", and "email" + * are used as default scopes. + * Google Sign-In documentation: + * https://developers.google.com/identity/sign-in/web/ + * + * @param {string} [siteAuthSettings.facebookAppId] The App ID of the Facebook + * app used for login. + * This setting is required for enabling Facebook Login. + * Facebook Login documentation: + * https://developers.facebook.com/docs/facebook-login + * + * @param {string} [siteAuthSettings.facebookAppSecret] The App Secret of the + * Facebook app used for Facebook Login. + * This setting is required for enabling Facebook Login. + * Facebook Login documentation: + * https://developers.facebook.com/docs/facebook-login + * + * @param {array} [siteAuthSettings.facebookOAuthScopes] The OAuth 2.0 scopes + * that will be requested as part of Facebook Login authentication. + * This setting is optional. + * Facebook Login documentation: + * https://developers.facebook.com/docs/facebook-login + * + * @param {string} [siteAuthSettings.twitterConsumerKey] The OAuth 1.0a + * consumer key of the Twitter application used for sign-in. + * This setting is required for enabling Twitter Sign-In. + * Twitter Sign-In documentation: https://dev.twitter.com/web/sign-in + * + * @param {string} [siteAuthSettings.twitterConsumerSecret] The OAuth 1.0a + * consumer secret of the Twitter application used for sign-in. + * This setting is required for enabling Twitter Sign-In. + * Twitter Sign-In documentation: https://dev.twitter.com/web/sign-in + * + * @param {string} [siteAuthSettings.microsoftAccountClientId] The OAuth 2.0 + * client ID that was created for the app used for authentication. + * This setting is required for enabling Microsoft Account authentication. + * Microsoft Account OAuth documentation: + * https://dev.onedrive.com/auth/msa_oauth.htm + * + * @param {string} [siteAuthSettings.microsoftAccountClientSecret] The OAuth + * 2.0 client secret that was created for the app used for authentication. + * This setting is required for enabling Microsoft Account authentication. + * Microsoft Account OAuth documentation: + * https://dev.onedrive.com/auth/msa_oauth.htm + * + * @param {array} [siteAuthSettings.microsoftAccountOAuthScopes] The OAuth 2.0 + * scopes that will be requested as part of Microsoft Account authentication. + * This setting is optional. If not specified, "wl.basic" is used as the + * default scope. + * Microsoft Account Scopes and permissions documentation: + * https://msdn.microsoft.com/en-us/library/dn631845.aspx + * + * @param {string} [siteAuthSettings.kind] Kind of resource. + * + * @param {string} slot Name of web app slot. If not specified then will + * default to production slot. + * + * @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 {SiteAuthSettings} - 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. + * + * {SiteAuthSettings} [result] - The deserialized result object if an error did not occur. + * See {@link SiteAuthSettings} 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. + */ + updateAuthSettingsSlot(resourceGroupName: string, name: string, siteAuthSettings: models.SiteAuthSettings, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + updateAuthSettingsSlot(resourceGroupName: string, name: string, siteAuthSettings: models.SiteAuthSettings, slot: string, callback: ServiceCallback): void; + updateAuthSettingsSlot(resourceGroupName: string, name: string, siteAuthSettings: models.SiteAuthSettings, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Gets the Authentication/Authorization settings of an app. + * + * Gets the Authentication/Authorization settings of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will get the settings for the production slot. + * + * @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. + */ + getAuthSettingsSlotWithHttpOperationResponse(resourceGroupName: string, name: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets the Authentication/Authorization settings of an app. + * + * Gets the Authentication/Authorization settings of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will get the settings for the production slot. + * + * @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 {SiteAuthSettings} - 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. + * + * {SiteAuthSettings} [result] - The deserialized result object if an error did not occur. + * See {@link SiteAuthSettings} 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. + */ + getAuthSettingsSlot(resourceGroupName: string, name: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getAuthSettingsSlot(resourceGroupName: string, name: string, slot: string, callback: ServiceCallback): void; + getAuthSettingsSlot(resourceGroupName: string, name: string, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Updates the Azure storage account configurations of an app. + * + * Updates the Azure storage account configurations of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} azureStorageAccounts Azure storage accounts of the app. + * + * @param {object} [azureStorageAccounts.properties] Azure storage accounts. + * + * @param {string} [azureStorageAccounts.kind] Kind of resource. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will update the Azure storage account configurations for + * the production slot. + * + * @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. + */ + updateAzureStorageAccountsSlotWithHttpOperationResponse(resourceGroupName: string, name: string, azureStorageAccounts: models.AzureStoragePropertyDictionaryResource, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Updates the Azure storage account configurations of an app. + * + * Updates the Azure storage account configurations of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} azureStorageAccounts Azure storage accounts of the app. + * + * @param {object} [azureStorageAccounts.properties] Azure storage accounts. + * + * @param {string} [azureStorageAccounts.kind] Kind of resource. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will update the Azure storage account configurations for + * the production slot. + * + * @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 {AzureStoragePropertyDictionaryResource} - 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. + * + * {AzureStoragePropertyDictionaryResource} [result] - The deserialized result object if an error did not occur. + * See {@link AzureStoragePropertyDictionaryResource} 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. + */ + updateAzureStorageAccountsSlot(resourceGroupName: string, name: string, azureStorageAccounts: models.AzureStoragePropertyDictionaryResource, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + updateAzureStorageAccountsSlot(resourceGroupName: string, name: string, azureStorageAccounts: models.AzureStoragePropertyDictionaryResource, slot: string, callback: ServiceCallback): void; + updateAzureStorageAccountsSlot(resourceGroupName: string, name: string, azureStorageAccounts: models.AzureStoragePropertyDictionaryResource, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Gets the Azure storage account configurations of an app. + * + * Gets the Azure storage account configurations of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will update the Azure storage account configurations for + * the production slot. + * + * @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. + */ + listAzureStorageAccountsSlotWithHttpOperationResponse(resourceGroupName: string, name: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets the Azure storage account configurations of an app. + * + * Gets the Azure storage account configurations of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will update the Azure storage account configurations for + * the production slot. + * + * @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 {AzureStoragePropertyDictionaryResource} - 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. + * + * {AzureStoragePropertyDictionaryResource} [result] - The deserialized result object if an error did not occur. + * See {@link AzureStoragePropertyDictionaryResource} 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. + */ + listAzureStorageAccountsSlot(resourceGroupName: string, name: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listAzureStorageAccountsSlot(resourceGroupName: string, name: string, slot: string, callback: ServiceCallback): void; + listAzureStorageAccountsSlot(resourceGroupName: string, name: string, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Updates the backup configuration of an app. + * + * Updates the backup configuration of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} request Edited backup configuration. + * + * @param {string} [request.backupName] Name of the backup. + * + * @param {boolean} [request.enabled] True if the backup schedule is enabled + * (must be included in that case), false if the backup schedule should be + * disabled. + * + * @param {string} request.storageAccountUrl SAS URL to the container. + * + * @param {object} [request.backupSchedule] Schedule for the backup if it is + * executed periodically. + * + * @param {number} request.backupSchedule.frequencyInterval How often the + * backup should be executed (e.g. for weekly backup, this should be set to 7 + * and FrequencyUnit should be set to Day) + * + * @param {string} request.backupSchedule.frequencyUnit The unit of time for + * how often the backup should be executed (e.g. for weekly backup, this should + * be set to Day and FrequencyInterval should be set to 7). Possible values + * include: 'Day', 'Hour' + * + * @param {boolean} request.backupSchedule.keepAtLeastOneBackup True if the + * retention policy should always keep at least one backup in the storage + * account, regardless how old it is; false otherwise. + * + * @param {number} request.backupSchedule.retentionPeriodInDays After how many + * days backups should be deleted. + * + * @param {date} [request.backupSchedule.startTime] When the schedule should + * start working. + * + * @param {array} [request.databases] Databases included in the backup. + * + * @param {string} [request.kind] Kind of resource. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will update the backup configuration for the production + * slot. + * + * @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. + */ + updateBackupConfigurationSlotWithHttpOperationResponse(resourceGroupName: string, name: string, request: models.BackupRequest, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Updates the backup configuration of an app. + * + * Updates the backup configuration of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} request Edited backup configuration. + * + * @param {string} [request.backupName] Name of the backup. + * + * @param {boolean} [request.enabled] True if the backup schedule is enabled + * (must be included in that case), false if the backup schedule should be + * disabled. + * + * @param {string} request.storageAccountUrl SAS URL to the container. + * + * @param {object} [request.backupSchedule] Schedule for the backup if it is + * executed periodically. + * + * @param {number} request.backupSchedule.frequencyInterval How often the + * backup should be executed (e.g. for weekly backup, this should be set to 7 + * and FrequencyUnit should be set to Day) + * + * @param {string} request.backupSchedule.frequencyUnit The unit of time for + * how often the backup should be executed (e.g. for weekly backup, this should + * be set to Day and FrequencyInterval should be set to 7). Possible values + * include: 'Day', 'Hour' + * + * @param {boolean} request.backupSchedule.keepAtLeastOneBackup True if the + * retention policy should always keep at least one backup in the storage + * account, regardless how old it is; false otherwise. + * + * @param {number} request.backupSchedule.retentionPeriodInDays After how many + * days backups should be deleted. + * + * @param {date} [request.backupSchedule.startTime] When the schedule should + * start working. + * + * @param {array} [request.databases] Databases included in the backup. + * + * @param {string} [request.kind] Kind of resource. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will update the backup configuration for the production + * slot. + * + * @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 {BackupRequest} - 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. + * + * {BackupRequest} [result] - The deserialized result object if an error did not occur. + * See {@link BackupRequest} 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. + */ + updateBackupConfigurationSlot(resourceGroupName: string, name: string, request: models.BackupRequest, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + updateBackupConfigurationSlot(resourceGroupName: string, name: string, request: models.BackupRequest, slot: string, callback: ServiceCallback): void; + updateBackupConfigurationSlot(resourceGroupName: string, name: string, request: models.BackupRequest, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Deletes the backup configuration of an app. + * + * Deletes the backup configuration of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will delete the backup configuration for the production + * slot. + * + * @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. + */ + deleteBackupConfigurationSlotWithHttpOperationResponse(resourceGroupName: string, name: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Deletes the backup configuration of an app. + * + * Deletes the backup configuration of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will delete the backup configuration for the production + * slot. + * + * @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 {null} - 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. + * + * {null} [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. + */ + deleteBackupConfigurationSlot(resourceGroupName: string, name: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteBackupConfigurationSlot(resourceGroupName: string, name: string, slot: string, callback: ServiceCallback): void; + deleteBackupConfigurationSlot(resourceGroupName: string, name: string, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Gets the backup configuration of an app. + * + * Gets the backup configuration of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will get the backup configuration for the production + * slot. + * + * @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. + */ + getBackupConfigurationSlotWithHttpOperationResponse(resourceGroupName: string, name: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets the backup configuration of an app. + * + * Gets the backup configuration of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will get the backup configuration for the production + * slot. + * + * @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 {BackupRequest} - 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. + * + * {BackupRequest} [result] - The deserialized result object if an error did not occur. + * See {@link BackupRequest} 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. + */ + getBackupConfigurationSlot(resourceGroupName: string, name: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getBackupConfigurationSlot(resourceGroupName: string, name: string, slot: string, callback: ServiceCallback): void; + getBackupConfigurationSlot(resourceGroupName: string, name: string, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Replaces the connection strings of an app. + * + * Replaces the connection strings of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} connectionStrings Connection strings of the app or + * deployment slot. See example. + * + * @param {object} [connectionStrings.properties] Connection strings. + * + * @param {string} [connectionStrings.kind] Kind of resource. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will update the connection settings for the production + * slot. + * + * @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. + */ + updateConnectionStringsSlotWithHttpOperationResponse(resourceGroupName: string, name: string, connectionStrings: models.ConnectionStringDictionary, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Replaces the connection strings of an app. + * + * Replaces the connection strings of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} connectionStrings Connection strings of the app or + * deployment slot. See example. + * + * @param {object} [connectionStrings.properties] Connection strings. + * + * @param {string} [connectionStrings.kind] Kind of resource. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will update the connection settings for the production + * slot. + * + * @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 {ConnectionStringDictionary} - 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. + * + * {ConnectionStringDictionary} [result] - The deserialized result object if an error did not occur. + * See {@link ConnectionStringDictionary} 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. + */ + updateConnectionStringsSlot(resourceGroupName: string, name: string, connectionStrings: models.ConnectionStringDictionary, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + updateConnectionStringsSlot(resourceGroupName: string, name: string, connectionStrings: models.ConnectionStringDictionary, slot: string, callback: ServiceCallback): void; + updateConnectionStringsSlot(resourceGroupName: string, name: string, connectionStrings: models.ConnectionStringDictionary, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Gets the connection strings of an app. + * + * Gets the connection strings of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will get the connection settings for the production slot. + * + * @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. + */ + listConnectionStringsSlotWithHttpOperationResponse(resourceGroupName: string, name: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets the connection strings of an app. + * + * Gets the connection strings of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will get the connection settings for the production slot. + * + * @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 {ConnectionStringDictionary} - 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. + * + * {ConnectionStringDictionary} [result] - The deserialized result object if an error did not occur. + * See {@link ConnectionStringDictionary} 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. + */ + listConnectionStringsSlot(resourceGroupName: string, name: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listConnectionStringsSlot(resourceGroupName: string, name: string, slot: string, callback: ServiceCallback): void; + listConnectionStringsSlot(resourceGroupName: string, name: string, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Gets the logging configuration of an app. + * + * Gets the logging configuration of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will get the logging configuration for the production + * slot. + * + * @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. + */ + getDiagnosticLogsConfigurationSlotWithHttpOperationResponse(resourceGroupName: string, name: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets the logging configuration of an app. + * + * Gets the logging configuration of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will get the logging configuration for the production + * slot. + * + * @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 {SiteLogsConfig} - 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. + * + * {SiteLogsConfig} [result] - The deserialized result object if an error did not occur. + * See {@link SiteLogsConfig} 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. + */ + getDiagnosticLogsConfigurationSlot(resourceGroupName: string, name: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getDiagnosticLogsConfigurationSlot(resourceGroupName: string, name: string, slot: string, callback: ServiceCallback): void; + getDiagnosticLogsConfigurationSlot(resourceGroupName: string, name: string, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Updates the logging configuration of an app. + * + * Updates the logging configuration of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} siteLogsConfig A SiteLogsConfig JSON object that contains + * the logging configuration to change in the "properties" property. + * + * @param {object} [siteLogsConfig.applicationLogs] Application logs + * configuration. + * + * @param {object} [siteLogsConfig.applicationLogs.fileSystem] Application logs + * to file system configuration. + * + * @param {string} [siteLogsConfig.applicationLogs.fileSystem.level] Log level. + * Possible values include: 'Off', 'Verbose', 'Information', 'Warning', 'Error' + * + * @param {object} [siteLogsConfig.applicationLogs.azureTableStorage] + * Application logs to azure table storage configuration. + * + * @param {string} [siteLogsConfig.applicationLogs.azureTableStorage.level] Log + * level. Possible values include: 'Off', 'Verbose', 'Information', 'Warning', + * 'Error' + * + * @param {string} siteLogsConfig.applicationLogs.azureTableStorage.sasUrl SAS + * URL to an Azure table with add/query/delete permissions. + * + * @param {object} [siteLogsConfig.applicationLogs.azureBlobStorage] + * Application logs to blob storage configuration. + * + * @param {string} [siteLogsConfig.applicationLogs.azureBlobStorage.level] Log + * level. Possible values include: 'Off', 'Verbose', 'Information', 'Warning', + * 'Error' + * + * @param {string} [siteLogsConfig.applicationLogs.azureBlobStorage.sasUrl] SAS + * url to a azure blob container with read/write/list/delete permissions. + * + * @param {number} + * [siteLogsConfig.applicationLogs.azureBlobStorage.retentionInDays] Retention + * in days. + * Remove blobs older than X days. + * 0 or lower means no retention. + * + * @param {object} [siteLogsConfig.httpLogs] HTTP logs configuration. + * + * @param {object} [siteLogsConfig.httpLogs.fileSystem] Http logs to file + * system configuration. + * + * @param {number} [siteLogsConfig.httpLogs.fileSystem.retentionInMb] Maximum + * size in megabytes that http log files can use. + * When reached old log files will be removed to make space for new ones. + * Value can range between 25 and 100. + * + * @param {number} [siteLogsConfig.httpLogs.fileSystem.retentionInDays] + * Retention in days. + * Remove files older than X days. + * 0 or lower means no retention. + * + * @param {boolean} [siteLogsConfig.httpLogs.fileSystem.enabled] True if + * configuration is enabled, false if it is disabled and null if configuration + * is not set. + * + * @param {object} [siteLogsConfig.httpLogs.azureBlobStorage] Http logs to + * azure blob storage configuration. + * + * @param {string} [siteLogsConfig.httpLogs.azureBlobStorage.sasUrl] SAS url to + * a azure blob container with read/write/list/delete permissions. + * + * @param {number} [siteLogsConfig.httpLogs.azureBlobStorage.retentionInDays] + * Retention in days. + * Remove blobs older than X days. + * 0 or lower means no retention. + * + * @param {boolean} [siteLogsConfig.httpLogs.azureBlobStorage.enabled] True if + * configuration is enabled, false if it is disabled and null if configuration + * is not set. + * + * @param {object} [siteLogsConfig.failedRequestsTracing] Failed requests + * tracing configuration. + * + * @param {object} [siteLogsConfig.detailedErrorMessages] Detailed error + * messages configuration. + * + * @param {boolean} [siteLogsConfig.detailedErrorMessages.enabled] True if + * configuration is enabled, false if it is disabled and null if configuration + * is not set. + * + * @param {string} [siteLogsConfig.kind] Kind of resource. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will update the logging configuration for the production + * slot. + * + * @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. + */ + updateDiagnosticLogsConfigSlotWithHttpOperationResponse(resourceGroupName: string, name: string, siteLogsConfig: models.SiteLogsConfig, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Updates the logging configuration of an app. + * + * Updates the logging configuration of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} siteLogsConfig A SiteLogsConfig JSON object that contains + * the logging configuration to change in the "properties" property. + * + * @param {object} [siteLogsConfig.applicationLogs] Application logs + * configuration. + * + * @param {object} [siteLogsConfig.applicationLogs.fileSystem] Application logs + * to file system configuration. + * + * @param {string} [siteLogsConfig.applicationLogs.fileSystem.level] Log level. + * Possible values include: 'Off', 'Verbose', 'Information', 'Warning', 'Error' + * + * @param {object} [siteLogsConfig.applicationLogs.azureTableStorage] + * Application logs to azure table storage configuration. + * + * @param {string} [siteLogsConfig.applicationLogs.azureTableStorage.level] Log + * level. Possible values include: 'Off', 'Verbose', 'Information', 'Warning', + * 'Error' + * + * @param {string} siteLogsConfig.applicationLogs.azureTableStorage.sasUrl SAS + * URL to an Azure table with add/query/delete permissions. + * + * @param {object} [siteLogsConfig.applicationLogs.azureBlobStorage] + * Application logs to blob storage configuration. + * + * @param {string} [siteLogsConfig.applicationLogs.azureBlobStorage.level] Log + * level. Possible values include: 'Off', 'Verbose', 'Information', 'Warning', + * 'Error' + * + * @param {string} [siteLogsConfig.applicationLogs.azureBlobStorage.sasUrl] SAS + * url to a azure blob container with read/write/list/delete permissions. + * + * @param {number} + * [siteLogsConfig.applicationLogs.azureBlobStorage.retentionInDays] Retention + * in days. + * Remove blobs older than X days. + * 0 or lower means no retention. + * + * @param {object} [siteLogsConfig.httpLogs] HTTP logs configuration. + * + * @param {object} [siteLogsConfig.httpLogs.fileSystem] Http logs to file + * system configuration. + * + * @param {number} [siteLogsConfig.httpLogs.fileSystem.retentionInMb] Maximum + * size in megabytes that http log files can use. + * When reached old log files will be removed to make space for new ones. + * Value can range between 25 and 100. + * + * @param {number} [siteLogsConfig.httpLogs.fileSystem.retentionInDays] + * Retention in days. + * Remove files older than X days. + * 0 or lower means no retention. + * + * @param {boolean} [siteLogsConfig.httpLogs.fileSystem.enabled] True if + * configuration is enabled, false if it is disabled and null if configuration + * is not set. + * + * @param {object} [siteLogsConfig.httpLogs.azureBlobStorage] Http logs to + * azure blob storage configuration. + * + * @param {string} [siteLogsConfig.httpLogs.azureBlobStorage.sasUrl] SAS url to + * a azure blob container with read/write/list/delete permissions. + * + * @param {number} [siteLogsConfig.httpLogs.azureBlobStorage.retentionInDays] + * Retention in days. + * Remove blobs older than X days. + * 0 or lower means no retention. + * + * @param {boolean} [siteLogsConfig.httpLogs.azureBlobStorage.enabled] True if + * configuration is enabled, false if it is disabled and null if configuration + * is not set. + * + * @param {object} [siteLogsConfig.failedRequestsTracing] Failed requests + * tracing configuration. + * + * @param {object} [siteLogsConfig.detailedErrorMessages] Detailed error + * messages configuration. + * + * @param {boolean} [siteLogsConfig.detailedErrorMessages.enabled] True if + * configuration is enabled, false if it is disabled and null if configuration + * is not set. + * + * @param {string} [siteLogsConfig.kind] Kind of resource. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will update the logging configuration for the production + * slot. + * + * @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 {SiteLogsConfig} - 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. + * + * {SiteLogsConfig} [result] - The deserialized result object if an error did not occur. + * See {@link SiteLogsConfig} 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. + */ + updateDiagnosticLogsConfigSlot(resourceGroupName: string, name: string, siteLogsConfig: models.SiteLogsConfig, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + updateDiagnosticLogsConfigSlot(resourceGroupName: string, name: string, siteLogsConfig: models.SiteLogsConfig, slot: string, callback: ServiceCallback): void; + updateDiagnosticLogsConfigSlot(resourceGroupName: string, name: string, siteLogsConfig: models.SiteLogsConfig, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Replaces the metadata of an app. + * + * Replaces the metadata of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} metadata Edited metadata of the app or deployment slot. See + * example. + * + * @param {object} [metadata.properties] Settings. + * + * @param {string} [metadata.kind] Kind of resource. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will update the metadata for the production slot. + * + * @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. + */ + updateMetadataSlotWithHttpOperationResponse(resourceGroupName: string, name: string, metadata: models.StringDictionary, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Replaces the metadata of an app. + * + * Replaces the metadata of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} metadata Edited metadata of the app or deployment slot. See + * example. + * + * @param {object} [metadata.properties] Settings. + * + * @param {string} [metadata.kind] Kind of resource. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will update the metadata for the production slot. + * + * @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 {StringDictionary} - 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. + * + * {StringDictionary} [result] - The deserialized result object if an error did not occur. + * See {@link StringDictionary} 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. + */ + updateMetadataSlot(resourceGroupName: string, name: string, metadata: models.StringDictionary, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + updateMetadataSlot(resourceGroupName: string, name: string, metadata: models.StringDictionary, slot: string, callback: ServiceCallback): void; + updateMetadataSlot(resourceGroupName: string, name: string, metadata: models.StringDictionary, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Gets the metadata of an app. + * + * Gets the metadata of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will get the metadata for the production slot. + * + * @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. + */ + listMetadataSlotWithHttpOperationResponse(resourceGroupName: string, name: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets the metadata of an app. + * + * Gets the metadata of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will get the metadata for the production slot. + * + * @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 {StringDictionary} - 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. + * + * {StringDictionary} [result] - The deserialized result object if an error did not occur. + * See {@link StringDictionary} 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. + */ + listMetadataSlot(resourceGroupName: string, name: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listMetadataSlot(resourceGroupName: string, name: string, slot: string, callback: ServiceCallback): void; + listMetadataSlot(resourceGroupName: string, name: string, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Gets the Git/FTP publishing credentials of an app. + * + * Gets the Git/FTP publishing credentials of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will get the publishing credentials for the production + * slot. + * + * @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. + */ + listPublishingCredentialsSlotWithHttpOperationResponse(resourceGroupName: string, name: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets the Git/FTP publishing credentials of an app. + * + * Gets the Git/FTP publishing credentials of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will get the publishing credentials for the production + * slot. + * + * @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 {User} - 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. + * + * {User} [result] - The deserialized result object if an error did not occur. + * See {@link User} 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. + */ + listPublishingCredentialsSlot(resourceGroupName: string, name: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listPublishingCredentialsSlot(resourceGroupName: string, name: string, slot: string, callback: ServiceCallback): void; + listPublishingCredentialsSlot(resourceGroupName: string, name: string, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Updates the Push settings associated with web app. + * + * Updates the Push settings associated with web app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {object} pushSettings Push settings associated with web app. + * + * @param {boolean} pushSettings.isPushEnabled Gets or sets a flag indicating + * whether the Push endpoint is enabled. + * + * @param {string} [pushSettings.tagWhitelistJson] Gets or sets a JSON string + * containing a list of tags that are whitelisted for use by the push + * registration endpoint. + * + * @param {string} [pushSettings.tagsRequiringAuth] Gets or sets a JSON string + * containing a list of tags that require user authentication to be used in the + * push registration endpoint. + * Tags can consist of alphanumeric characters and the following: + * '_', '@', '#', '.', ':', '-'. + * Validation should be performed at the PushRequestHandler. + * + * @param {string} [pushSettings.dynamicTagsJson] Gets or sets a JSON string + * containing a list of dynamic tags that will be evaluated from user claims in + * the push registration endpoint. + * + * @param {string} [pushSettings.kind] Kind of resource. + * + * @param {string} slot Name of web app slot. If not specified then will + * default to production slot. + * + * @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. + */ + updateSitePushSettingsSlotWithHttpOperationResponse(resourceGroupName: string, name: string, pushSettings: models.PushSettings, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Updates the Push settings associated with web app. + * + * Updates the Push settings associated with web app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {object} pushSettings Push settings associated with web app. + * + * @param {boolean} pushSettings.isPushEnabled Gets or sets a flag indicating + * whether the Push endpoint is enabled. + * + * @param {string} [pushSettings.tagWhitelistJson] Gets or sets a JSON string + * containing a list of tags that are whitelisted for use by the push + * registration endpoint. + * + * @param {string} [pushSettings.tagsRequiringAuth] Gets or sets a JSON string + * containing a list of tags that require user authentication to be used in the + * push registration endpoint. + * Tags can consist of alphanumeric characters and the following: + * '_', '@', '#', '.', ':', '-'. + * Validation should be performed at the PushRequestHandler. + * + * @param {string} [pushSettings.dynamicTagsJson] Gets or sets a JSON string + * containing a list of dynamic tags that will be evaluated from user claims in + * the push registration endpoint. + * + * @param {string} [pushSettings.kind] Kind of resource. + * + * @param {string} slot Name of web app slot. If not specified then will + * default to production slot. + * + * @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 {PushSettings} - 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. + * + * {PushSettings} [result] - The deserialized result object if an error did not occur. + * See {@link PushSettings} 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. + */ + updateSitePushSettingsSlot(resourceGroupName: string, name: string, pushSettings: models.PushSettings, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + updateSitePushSettingsSlot(resourceGroupName: string, name: string, pushSettings: models.PushSettings, slot: string, callback: ServiceCallback): void; + updateSitePushSettingsSlot(resourceGroupName: string, name: string, pushSettings: models.PushSettings, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Gets the Push settings associated with web app. + * + * Gets the Push settings associated with web app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {string} slot Name of web app slot. If not specified then will + * default to production slot. + * + * @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. + */ + listSitePushSettingsSlotWithHttpOperationResponse(resourceGroupName: string, name: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets the Push settings associated with web app. + * + * Gets the Push settings associated with web app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {string} slot Name of web app slot. If not specified then will + * default to production slot. + * + * @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 {PushSettings} - 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. + * + * {PushSettings} [result] - The deserialized result object if an error did not occur. + * See {@link PushSettings} 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. + */ + listSitePushSettingsSlot(resourceGroupName: string, name: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listSitePushSettingsSlot(resourceGroupName: string, name: string, slot: string, callback: ServiceCallback): void; + listSitePushSettingsSlot(resourceGroupName: string, name: string, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Gets a Swift Virtual Network connection. + * + * Gets a Swift Virtual Network connection. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will get a gateway for the production slot's Virtual + * Network. + * + * @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. + */ + getSwiftVirtualNetworkConnectionSlotWithHttpOperationResponse(resourceGroupName: string, name: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets a Swift Virtual Network connection. + * + * Gets a Swift Virtual Network connection. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will get a gateway for the production slot's Virtual + * Network. + * + * @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 {SwiftVirtualNetwork} - 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. + * + * {SwiftVirtualNetwork} [result] - The deserialized result object if an error did not occur. + * See {@link SwiftVirtualNetwork} 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. + */ + getSwiftVirtualNetworkConnectionSlot(resourceGroupName: string, name: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getSwiftVirtualNetworkConnectionSlot(resourceGroupName: string, name: string, slot: string, callback: ServiceCallback): void; + getSwiftVirtualNetworkConnectionSlot(resourceGroupName: string, name: string, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Integrates this Web App with a Virtual Network. This requires that + * 1) "swiftSupported" is true when doing a GET against this resource, and 2) + * that the target Subnet has already been delegated, and is not + * in use by another App Service Plan other than the one this App is in. + * + * Integrates this Web App with a Virtual Network. This requires that 1) + * "swiftSupported" is true when doing a GET against this resource, and 2) that + * the target Subnet has already been delegated, and is not + * in use by another App Service Plan other than the one this App is in. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} connectionEnvelope Properties of the Virtual Network + * connection. See example. + * + * @param {string} [connectionEnvelope.subnetResourceId] The Virtual Network + * subnet's resource ID. This is the subnet that this Web App will join. This + * subnet must have a delegation to Microsoft.Web/serverFarms defined first. + * + * @param {boolean} [connectionEnvelope.swiftSupported] A flag that specifies + * if the scale unit this Web App is on supports Swift integration. + * + * @param {string} [connectionEnvelope.kind] Kind of resource. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will add or update connections for the production slot. + * + * @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. + */ + createOrUpdateSwiftVirtualNetworkConnectionSlotWithHttpOperationResponse(resourceGroupName: string, name: string, connectionEnvelope: models.SwiftVirtualNetwork, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Integrates this Web App with a Virtual Network. This requires that + * 1) "swiftSupported" is true when doing a GET against this resource, and 2) + * that the target Subnet has already been delegated, and is not + * in use by another App Service Plan other than the one this App is in. + * + * Integrates this Web App with a Virtual Network. This requires that 1) + * "swiftSupported" is true when doing a GET against this resource, and 2) that + * the target Subnet has already been delegated, and is not + * in use by another App Service Plan other than the one this App is in. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} connectionEnvelope Properties of the Virtual Network + * connection. See example. + * + * @param {string} [connectionEnvelope.subnetResourceId] The Virtual Network + * subnet's resource ID. This is the subnet that this Web App will join. This + * subnet must have a delegation to Microsoft.Web/serverFarms defined first. + * + * @param {boolean} [connectionEnvelope.swiftSupported] A flag that specifies + * if the scale unit this Web App is on supports Swift integration. + * + * @param {string} [connectionEnvelope.kind] Kind of resource. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will add or update connections for the production slot. + * + * @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 {SwiftVirtualNetwork} - 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. + * + * {SwiftVirtualNetwork} [result] - The deserialized result object if an error did not occur. + * See {@link SwiftVirtualNetwork} 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. + */ + createOrUpdateSwiftVirtualNetworkConnectionSlot(resourceGroupName: string, name: string, connectionEnvelope: models.SwiftVirtualNetwork, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdateSwiftVirtualNetworkConnectionSlot(resourceGroupName: string, name: string, connectionEnvelope: models.SwiftVirtualNetwork, slot: string, callback: ServiceCallback): void; + createOrUpdateSwiftVirtualNetworkConnectionSlot(resourceGroupName: string, name: string, connectionEnvelope: models.SwiftVirtualNetwork, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Deletes a Swift Virtual Network connection from an app (or + * deployment slot). + * + * Deletes a Swift Virtual Network connection from an app (or deployment slot). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will delete the connection for the production slot. + * + * @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. + */ + deleteSwiftVirtualNetworkSlotWithHttpOperationResponse(resourceGroupName: string, name: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Deletes a Swift Virtual Network connection from an app (or + * deployment slot). + * + * Deletes a Swift Virtual Network connection from an app (or deployment slot). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will delete the connection for the production slot. + * + * @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 {null} - 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. + * + * {null} [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. + */ + deleteSwiftVirtualNetworkSlot(resourceGroupName: string, name: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteSwiftVirtualNetworkSlot(resourceGroupName: string, name: string, slot: string, callback: ServiceCallback): void; + deleteSwiftVirtualNetworkSlot(resourceGroupName: string, name: string, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Integrates this Web App with a Virtual Network. This requires that + * 1) "swiftSupported" is true when doing a GET against this resource, and 2) + * that the target Subnet has already been delegated, and is not + * in use by another App Service Plan other than the one this App is in. + * + * Integrates this Web App with a Virtual Network. This requires that 1) + * "swiftSupported" is true when doing a GET against this resource, and 2) that + * the target Subnet has already been delegated, and is not + * in use by another App Service Plan other than the one this App is in. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} connectionEnvelope Properties of the Virtual Network + * connection. See example. + * + * @param {string} [connectionEnvelope.subnetResourceId] The Virtual Network + * subnet's resource ID. This is the subnet that this Web App will join. This + * subnet must have a delegation to Microsoft.Web/serverFarms defined first. + * + * @param {boolean} [connectionEnvelope.swiftSupported] A flag that specifies + * if the scale unit this Web App is on supports Swift integration. + * + * @param {string} [connectionEnvelope.kind] Kind of resource. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will add or update connections for the production slot. + * + * @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. + */ + updateSwiftVirtualNetworkConnectionSlotWithHttpOperationResponse(resourceGroupName: string, name: string, connectionEnvelope: models.SwiftVirtualNetwork, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Integrates this Web App with a Virtual Network. This requires that + * 1) "swiftSupported" is true when doing a GET against this resource, and 2) + * that the target Subnet has already been delegated, and is not + * in use by another App Service Plan other than the one this App is in. + * + * Integrates this Web App with a Virtual Network. This requires that 1) + * "swiftSupported" is true when doing a GET against this resource, and 2) that + * the target Subnet has already been delegated, and is not + * in use by another App Service Plan other than the one this App is in. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} connectionEnvelope Properties of the Virtual Network + * connection. See example. + * + * @param {string} [connectionEnvelope.subnetResourceId] The Virtual Network + * subnet's resource ID. This is the subnet that this Web App will join. This + * subnet must have a delegation to Microsoft.Web/serverFarms defined first. + * + * @param {boolean} [connectionEnvelope.swiftSupported] A flag that specifies + * if the scale unit this Web App is on supports Swift integration. + * + * @param {string} [connectionEnvelope.kind] Kind of resource. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will add or update connections for the production slot. + * + * @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 {SwiftVirtualNetwork} - 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. + * + * {SwiftVirtualNetwork} [result] - The deserialized result object if an error did not occur. + * See {@link SwiftVirtualNetwork} 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. + */ + updateSwiftVirtualNetworkConnectionSlot(resourceGroupName: string, name: string, connectionEnvelope: models.SwiftVirtualNetwork, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + updateSwiftVirtualNetworkConnectionSlot(resourceGroupName: string, name: string, connectionEnvelope: models.SwiftVirtualNetwork, slot: string, callback: ServiceCallback): void; + updateSwiftVirtualNetworkConnectionSlot(resourceGroupName: string, name: string, connectionEnvelope: models.SwiftVirtualNetwork, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Gets the configuration of an app, such as platform version and + * bitness, default documents, virtual applications, Always On, etc. + * + * Gets the configuration of an app, such as platform version and bitness, + * default documents, virtual applications, Always On, etc. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will return configuration for the production slot. + * + * @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. + */ + getConfigurationSlotWithHttpOperationResponse(resourceGroupName: string, name: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets the configuration of an app, such as platform version and + * bitness, default documents, virtual applications, Always On, etc. + * + * Gets the configuration of an app, such as platform version and bitness, + * default documents, virtual applications, Always On, etc. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will return configuration for the production slot. + * + * @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 {SiteConfigResource} - 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. + * + * {SiteConfigResource} [result] - The deserialized result object if an error did not occur. + * See {@link SiteConfigResource} 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. + */ + getConfigurationSlot(resourceGroupName: string, name: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getConfigurationSlot(resourceGroupName: string, name: string, slot: string, callback: ServiceCallback): void; + getConfigurationSlot(resourceGroupName: string, name: string, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Updates the configuration of an app. + * + * Updates the configuration of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} siteConfig JSON representation of a SiteConfig object. See + * example. + * + * @param {number} [siteConfig.numberOfWorkers] Number of workers. + * + * @param {array} [siteConfig.defaultDocuments] Default documents. + * + * @param {string} [siteConfig.netFrameworkVersion] .NET Framework version. + * + * @param {string} [siteConfig.phpVersion] Version of PHP. + * + * @param {string} [siteConfig.pythonVersion] Version of Python. + * + * @param {string} [siteConfig.nodeVersion] Version of Node.js. + * + * @param {string} [siteConfig.linuxFxVersion] Linux App Framework and version + * + * @param {string} [siteConfig.windowsFxVersion] Xenon App Framework and + * version + * + * @param {boolean} [siteConfig.requestTracingEnabled] true if + * request tracing is enabled; otherwise, false. + * + * @param {date} [siteConfig.requestTracingExpirationTime] Request tracing + * expiration time. + * + * @param {boolean} [siteConfig.remoteDebuggingEnabled] true if + * remote debugging is enabled; otherwise, false. + * + * @param {string} [siteConfig.remoteDebuggingVersion] Remote debugging + * version. + * + * @param {boolean} [siteConfig.httpLoggingEnabled] true if HTTP + * logging is enabled; otherwise, false. + * + * @param {number} [siteConfig.logsDirectorySizeLimit] HTTP logs directory size + * limit. + * + * @param {boolean} [siteConfig.detailedErrorLoggingEnabled] true + * if detailed error logging is enabled; otherwise, false. + * + * @param {string} [siteConfig.publishingUsername] Publishing user name. + * + * @param {array} [siteConfig.appSettings] Application settings. + * + * @param {object} [siteConfig.azureStorageAccounts] User-provided Azure + * storage accounts. + * + * @param {array} [siteConfig.connectionStrings] Connection strings. + * + * @param {array} [siteConfig.handlerMappings] Handler mappings. + * + * @param {string} [siteConfig.documentRoot] Document root. + * + * @param {string} [siteConfig.scmType] SCM type. Possible values include: + * 'None', 'Dropbox', 'Tfs', 'LocalGit', 'GitHub', 'CodePlexGit', 'CodePlexHg', + * 'BitbucketGit', 'BitbucketHg', 'ExternalGit', 'ExternalHg', 'OneDrive', + * 'VSO' + * + * @param {boolean} [siteConfig.use32BitWorkerProcess] true to use + * 32-bit worker process; otherwise, false. + * + * @param {boolean} [siteConfig.webSocketsEnabled] true if + * WebSocket is enabled; otherwise, false. + * + * @param {boolean} [siteConfig.alwaysOn] true if Always On is + * enabled; otherwise, false. + * + * @param {string} [siteConfig.javaVersion] Java version. + * + * @param {string} [siteConfig.javaContainer] Java container. + * + * @param {string} [siteConfig.javaContainerVersion] Java container version. + * + * @param {string} [siteConfig.appCommandLine] App command line to launch. + * + * @param {string} [siteConfig.managedPipelineMode] Managed pipeline mode. + * Possible values include: 'Integrated', 'Classic' + * + * @param {array} [siteConfig.virtualApplications] Virtual applications. + * + * @param {string} [siteConfig.loadBalancing] Site load balancing. Possible + * values include: 'WeightedRoundRobin', 'LeastRequests', 'LeastResponseTime', + * 'WeightedTotalTraffic', 'RequestHash' + * + * @param {object} [siteConfig.experiments] This is work around for polymophic + * types. + * + * @param {array} [siteConfig.experiments.rampUpRules] List of ramp-up rules. + * + * @param {object} [siteConfig.limits] Site limits. + * + * @param {number} [siteConfig.limits.maxPercentageCpu] Maximum allowed CPU + * usage percentage. + * + * @param {number} [siteConfig.limits.maxMemoryInMb] Maximum allowed memory + * usage in MB. + * + * @param {number} [siteConfig.limits.maxDiskSizeInMb] Maximum allowed disk + * size usage in MB. + * + * @param {boolean} [siteConfig.autoHealEnabled] true if Auto Heal + * is enabled; otherwise, false. + * + * @param {object} [siteConfig.autoHealRules] Auto Heal rules. + * + * @param {object} [siteConfig.autoHealRules.triggers] Conditions that describe + * when to execute the auto-heal actions. + * + * @param {object} [siteConfig.autoHealRules.triggers.requests] A rule based on + * total requests. + * + * @param {number} [siteConfig.autoHealRules.triggers.requests.count] Request + * Count. + * + * @param {string} [siteConfig.autoHealRules.triggers.requests.timeInterval] + * Time interval. + * + * @param {number} [siteConfig.autoHealRules.triggers.privateBytesInKB] A rule + * based on private bytes. + * + * @param {array} [siteConfig.autoHealRules.triggers.statusCodes] A rule based + * on status codes. + * + * @param {object} [siteConfig.autoHealRules.triggers.slowRequests] A rule + * based on request execution time. + * + * @param {string} [siteConfig.autoHealRules.triggers.slowRequests.timeTaken] + * Time taken. + * + * @param {number} [siteConfig.autoHealRules.triggers.slowRequests.count] + * Request Count. + * + * @param {string} + * [siteConfig.autoHealRules.triggers.slowRequests.timeInterval] Time interval. + * + * @param {object} [siteConfig.autoHealRules.actions] Actions to be executed + * when a rule is triggered. + * + * @param {string} [siteConfig.autoHealRules.actions.actionType] Predefined + * action to be taken. Possible values include: 'Recycle', 'LogEvent', + * 'CustomAction' + * + * @param {object} [siteConfig.autoHealRules.actions.customAction] Custom + * action to be taken. + * + * @param {string} [siteConfig.autoHealRules.actions.customAction.exe] + * Executable to be run. + * + * @param {string} [siteConfig.autoHealRules.actions.customAction.parameters] + * Parameters for the executable. + * + * @param {string} [siteConfig.autoHealRules.actions.minProcessExecutionTime] + * Minimum time the process must execute + * before taking the action + * + * @param {string} [siteConfig.tracingOptions] Tracing options. + * + * @param {string} [siteConfig.vnetName] Virtual Network name. + * + * @param {object} [siteConfig.cors] Cross-Origin Resource Sharing (CORS) + * settings. + * + * @param {array} [siteConfig.cors.allowedOrigins] Gets or sets the list of + * origins that should be allowed to make cross-origin + * calls (for example: http://example.com:12345). Use "*" to allow all. + * + * @param {object} [siteConfig.push] Push endpoint settings. + * + * @param {boolean} siteConfig.push.isPushEnabled Gets or sets a flag + * indicating whether the Push endpoint is enabled. + * + * @param {string} [siteConfig.push.tagWhitelistJson] Gets or sets a JSON + * string containing a list of tags that are whitelisted for use by the push + * registration endpoint. + * + * @param {string} [siteConfig.push.tagsRequiringAuth] Gets or sets a JSON + * string containing a list of tags that require user authentication to be used + * in the push registration endpoint. + * Tags can consist of alphanumeric characters and the following: + * '_', '@', '#', '.', ':', '-'. + * Validation should be performed at the PushRequestHandler. + * + * @param {string} [siteConfig.push.dynamicTagsJson] Gets or sets a JSON string + * containing a list of dynamic tags that will be evaluated from user claims in + * the push registration endpoint. + * + * @param {string} [siteConfig.push.kind] Kind of resource. + * + * @param {object} [siteConfig.apiDefinition] Information about the formal API + * definition for the app. + * + * @param {string} [siteConfig.apiDefinition.url] The URL of the API + * definition. + * + * @param {string} [siteConfig.autoSwapSlotName] Auto-swap slot name. + * + * @param {boolean} [siteConfig.localMySqlEnabled] true to enable + * local MySQL; otherwise, false. + * + * @param {number} [siteConfig.managedServiceIdentityId] Managed Service + * Identity Id + * + * @param {number} [siteConfig.xManagedServiceIdentityId] Explicit Managed + * Service Identity Id + * + * @param {array} [siteConfig.ipSecurityRestrictions] IP security restrictions. + * + * @param {boolean} [siteConfig.http20Enabled] Http20Enabled: configures a web + * site to allow clients to connect over http2.0 + * + * @param {string} [siteConfig.minTlsVersion] MinTlsVersion: configures the + * minimum version of TLS required for SSL requests. Possible values include: + * '1.0', '1.1', '1.2' + * + * @param {string} [siteConfig.ftpsState] State of FTP / FTPS service. Possible + * values include: 'AllAllowed', 'FtpsOnly', 'Disabled' + * + * @param {number} [siteConfig.reservedInstanceCount] Number of reserved + * instances. + * This setting only applies to the Consumption Plan + * + * @param {string} [siteConfig.kind] Kind of resource. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will update configuration for the production slot. + * + * @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. + */ + createOrUpdateConfigurationSlotWithHttpOperationResponse(resourceGroupName: string, name: string, siteConfig: models.SiteConfigResource, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Updates the configuration of an app. + * + * Updates the configuration of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} siteConfig JSON representation of a SiteConfig object. See + * example. + * + * @param {number} [siteConfig.numberOfWorkers] Number of workers. + * + * @param {array} [siteConfig.defaultDocuments] Default documents. + * + * @param {string} [siteConfig.netFrameworkVersion] .NET Framework version. + * + * @param {string} [siteConfig.phpVersion] Version of PHP. + * + * @param {string} [siteConfig.pythonVersion] Version of Python. + * + * @param {string} [siteConfig.nodeVersion] Version of Node.js. + * + * @param {string} [siteConfig.linuxFxVersion] Linux App Framework and version + * + * @param {string} [siteConfig.windowsFxVersion] Xenon App Framework and + * version + * + * @param {boolean} [siteConfig.requestTracingEnabled] true if + * request tracing is enabled; otherwise, false. + * + * @param {date} [siteConfig.requestTracingExpirationTime] Request tracing + * expiration time. + * + * @param {boolean} [siteConfig.remoteDebuggingEnabled] true if + * remote debugging is enabled; otherwise, false. + * + * @param {string} [siteConfig.remoteDebuggingVersion] Remote debugging + * version. + * + * @param {boolean} [siteConfig.httpLoggingEnabled] true if HTTP + * logging is enabled; otherwise, false. + * + * @param {number} [siteConfig.logsDirectorySizeLimit] HTTP logs directory size + * limit. + * + * @param {boolean} [siteConfig.detailedErrorLoggingEnabled] true + * if detailed error logging is enabled; otherwise, false. + * + * @param {string} [siteConfig.publishingUsername] Publishing user name. + * + * @param {array} [siteConfig.appSettings] Application settings. + * + * @param {object} [siteConfig.azureStorageAccounts] User-provided Azure + * storage accounts. + * + * @param {array} [siteConfig.connectionStrings] Connection strings. + * + * @param {array} [siteConfig.handlerMappings] Handler mappings. + * + * @param {string} [siteConfig.documentRoot] Document root. + * + * @param {string} [siteConfig.scmType] SCM type. Possible values include: + * 'None', 'Dropbox', 'Tfs', 'LocalGit', 'GitHub', 'CodePlexGit', 'CodePlexHg', + * 'BitbucketGit', 'BitbucketHg', 'ExternalGit', 'ExternalHg', 'OneDrive', + * 'VSO' + * + * @param {boolean} [siteConfig.use32BitWorkerProcess] true to use + * 32-bit worker process; otherwise, false. + * + * @param {boolean} [siteConfig.webSocketsEnabled] true if + * WebSocket is enabled; otherwise, false. + * + * @param {boolean} [siteConfig.alwaysOn] true if Always On is + * enabled; otherwise, false. + * + * @param {string} [siteConfig.javaVersion] Java version. + * + * @param {string} [siteConfig.javaContainer] Java container. + * + * @param {string} [siteConfig.javaContainerVersion] Java container version. + * + * @param {string} [siteConfig.appCommandLine] App command line to launch. + * + * @param {string} [siteConfig.managedPipelineMode] Managed pipeline mode. + * Possible values include: 'Integrated', 'Classic' + * + * @param {array} [siteConfig.virtualApplications] Virtual applications. + * + * @param {string} [siteConfig.loadBalancing] Site load balancing. Possible + * values include: 'WeightedRoundRobin', 'LeastRequests', 'LeastResponseTime', + * 'WeightedTotalTraffic', 'RequestHash' + * + * @param {object} [siteConfig.experiments] This is work around for polymophic + * types. + * + * @param {array} [siteConfig.experiments.rampUpRules] List of ramp-up rules. + * + * @param {object} [siteConfig.limits] Site limits. + * + * @param {number} [siteConfig.limits.maxPercentageCpu] Maximum allowed CPU + * usage percentage. + * + * @param {number} [siteConfig.limits.maxMemoryInMb] Maximum allowed memory + * usage in MB. + * + * @param {number} [siteConfig.limits.maxDiskSizeInMb] Maximum allowed disk + * size usage in MB. + * + * @param {boolean} [siteConfig.autoHealEnabled] true if Auto Heal + * is enabled; otherwise, false. + * + * @param {object} [siteConfig.autoHealRules] Auto Heal rules. + * + * @param {object} [siteConfig.autoHealRules.triggers] Conditions that describe + * when to execute the auto-heal actions. + * + * @param {object} [siteConfig.autoHealRules.triggers.requests] A rule based on + * total requests. + * + * @param {number} [siteConfig.autoHealRules.triggers.requests.count] Request + * Count. + * + * @param {string} [siteConfig.autoHealRules.triggers.requests.timeInterval] + * Time interval. + * + * @param {number} [siteConfig.autoHealRules.triggers.privateBytesInKB] A rule + * based on private bytes. + * + * @param {array} [siteConfig.autoHealRules.triggers.statusCodes] A rule based + * on status codes. + * + * @param {object} [siteConfig.autoHealRules.triggers.slowRequests] A rule + * based on request execution time. + * + * @param {string} [siteConfig.autoHealRules.triggers.slowRequests.timeTaken] + * Time taken. + * + * @param {number} [siteConfig.autoHealRules.triggers.slowRequests.count] + * Request Count. + * + * @param {string} + * [siteConfig.autoHealRules.triggers.slowRequests.timeInterval] Time interval. + * + * @param {object} [siteConfig.autoHealRules.actions] Actions to be executed + * when a rule is triggered. + * + * @param {string} [siteConfig.autoHealRules.actions.actionType] Predefined + * action to be taken. Possible values include: 'Recycle', 'LogEvent', + * 'CustomAction' + * + * @param {object} [siteConfig.autoHealRules.actions.customAction] Custom + * action to be taken. + * + * @param {string} [siteConfig.autoHealRules.actions.customAction.exe] + * Executable to be run. + * + * @param {string} [siteConfig.autoHealRules.actions.customAction.parameters] + * Parameters for the executable. + * + * @param {string} [siteConfig.autoHealRules.actions.minProcessExecutionTime] + * Minimum time the process must execute + * before taking the action + * + * @param {string} [siteConfig.tracingOptions] Tracing options. + * + * @param {string} [siteConfig.vnetName] Virtual Network name. + * + * @param {object} [siteConfig.cors] Cross-Origin Resource Sharing (CORS) + * settings. + * + * @param {array} [siteConfig.cors.allowedOrigins] Gets or sets the list of + * origins that should be allowed to make cross-origin + * calls (for example: http://example.com:12345). Use "*" to allow all. + * + * @param {object} [siteConfig.push] Push endpoint settings. + * + * @param {boolean} siteConfig.push.isPushEnabled Gets or sets a flag + * indicating whether the Push endpoint is enabled. + * + * @param {string} [siteConfig.push.tagWhitelistJson] Gets or sets a JSON + * string containing a list of tags that are whitelisted for use by the push + * registration endpoint. + * + * @param {string} [siteConfig.push.tagsRequiringAuth] Gets or sets a JSON + * string containing a list of tags that require user authentication to be used + * in the push registration endpoint. + * Tags can consist of alphanumeric characters and the following: + * '_', '@', '#', '.', ':', '-'. + * Validation should be performed at the PushRequestHandler. + * + * @param {string} [siteConfig.push.dynamicTagsJson] Gets or sets a JSON string + * containing a list of dynamic tags that will be evaluated from user claims in + * the push registration endpoint. + * + * @param {string} [siteConfig.push.kind] Kind of resource. + * + * @param {object} [siteConfig.apiDefinition] Information about the formal API + * definition for the app. + * + * @param {string} [siteConfig.apiDefinition.url] The URL of the API + * definition. + * + * @param {string} [siteConfig.autoSwapSlotName] Auto-swap slot name. + * + * @param {boolean} [siteConfig.localMySqlEnabled] true to enable + * local MySQL; otherwise, false. + * + * @param {number} [siteConfig.managedServiceIdentityId] Managed Service + * Identity Id + * + * @param {number} [siteConfig.xManagedServiceIdentityId] Explicit Managed + * Service Identity Id + * + * @param {array} [siteConfig.ipSecurityRestrictions] IP security restrictions. + * + * @param {boolean} [siteConfig.http20Enabled] Http20Enabled: configures a web + * site to allow clients to connect over http2.0 + * + * @param {string} [siteConfig.minTlsVersion] MinTlsVersion: configures the + * minimum version of TLS required for SSL requests. Possible values include: + * '1.0', '1.1', '1.2' + * + * @param {string} [siteConfig.ftpsState] State of FTP / FTPS service. Possible + * values include: 'AllAllowed', 'FtpsOnly', 'Disabled' + * + * @param {number} [siteConfig.reservedInstanceCount] Number of reserved + * instances. + * This setting only applies to the Consumption Plan + * + * @param {string} [siteConfig.kind] Kind of resource. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will update configuration for the production slot. + * + * @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 {SiteConfigResource} - 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. + * + * {SiteConfigResource} [result] - The deserialized result object if an error did not occur. + * See {@link SiteConfigResource} 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. + */ + createOrUpdateConfigurationSlot(resourceGroupName: string, name: string, siteConfig: models.SiteConfigResource, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdateConfigurationSlot(resourceGroupName: string, name: string, siteConfig: models.SiteConfigResource, slot: string, callback: ServiceCallback): void; + createOrUpdateConfigurationSlot(resourceGroupName: string, name: string, siteConfig: models.SiteConfigResource, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Updates the configuration of an app. + * + * Updates the configuration of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} siteConfig JSON representation of a SiteConfig object. See + * example. + * + * @param {number} [siteConfig.numberOfWorkers] Number of workers. + * + * @param {array} [siteConfig.defaultDocuments] Default documents. + * + * @param {string} [siteConfig.netFrameworkVersion] .NET Framework version. + * + * @param {string} [siteConfig.phpVersion] Version of PHP. + * + * @param {string} [siteConfig.pythonVersion] Version of Python. + * + * @param {string} [siteConfig.nodeVersion] Version of Node.js. + * + * @param {string} [siteConfig.linuxFxVersion] Linux App Framework and version + * + * @param {string} [siteConfig.windowsFxVersion] Xenon App Framework and + * version + * + * @param {boolean} [siteConfig.requestTracingEnabled] true if + * request tracing is enabled; otherwise, false. + * + * @param {date} [siteConfig.requestTracingExpirationTime] Request tracing + * expiration time. + * + * @param {boolean} [siteConfig.remoteDebuggingEnabled] true if + * remote debugging is enabled; otherwise, false. + * + * @param {string} [siteConfig.remoteDebuggingVersion] Remote debugging + * version. + * + * @param {boolean} [siteConfig.httpLoggingEnabled] true if HTTP + * logging is enabled; otherwise, false. + * + * @param {number} [siteConfig.logsDirectorySizeLimit] HTTP logs directory size + * limit. + * + * @param {boolean} [siteConfig.detailedErrorLoggingEnabled] true + * if detailed error logging is enabled; otherwise, false. + * + * @param {string} [siteConfig.publishingUsername] Publishing user name. + * + * @param {array} [siteConfig.appSettings] Application settings. + * + * @param {object} [siteConfig.azureStorageAccounts] User-provided Azure + * storage accounts. + * + * @param {array} [siteConfig.connectionStrings] Connection strings. + * + * @param {array} [siteConfig.handlerMappings] Handler mappings. + * + * @param {string} [siteConfig.documentRoot] Document root. + * + * @param {string} [siteConfig.scmType] SCM type. Possible values include: + * 'None', 'Dropbox', 'Tfs', 'LocalGit', 'GitHub', 'CodePlexGit', 'CodePlexHg', + * 'BitbucketGit', 'BitbucketHg', 'ExternalGit', 'ExternalHg', 'OneDrive', + * 'VSO' + * + * @param {boolean} [siteConfig.use32BitWorkerProcess] true to use + * 32-bit worker process; otherwise, false. + * + * @param {boolean} [siteConfig.webSocketsEnabled] true if + * WebSocket is enabled; otherwise, false. + * + * @param {boolean} [siteConfig.alwaysOn] true if Always On is + * enabled; otherwise, false. + * + * @param {string} [siteConfig.javaVersion] Java version. + * + * @param {string} [siteConfig.javaContainer] Java container. + * + * @param {string} [siteConfig.javaContainerVersion] Java container version. + * + * @param {string} [siteConfig.appCommandLine] App command line to launch. + * + * @param {string} [siteConfig.managedPipelineMode] Managed pipeline mode. + * Possible values include: 'Integrated', 'Classic' + * + * @param {array} [siteConfig.virtualApplications] Virtual applications. + * + * @param {string} [siteConfig.loadBalancing] Site load balancing. Possible + * values include: 'WeightedRoundRobin', 'LeastRequests', 'LeastResponseTime', + * 'WeightedTotalTraffic', 'RequestHash' + * + * @param {object} [siteConfig.experiments] This is work around for polymophic + * types. + * + * @param {array} [siteConfig.experiments.rampUpRules] List of ramp-up rules. + * + * @param {object} [siteConfig.limits] Site limits. + * + * @param {number} [siteConfig.limits.maxPercentageCpu] Maximum allowed CPU + * usage percentage. + * + * @param {number} [siteConfig.limits.maxMemoryInMb] Maximum allowed memory + * usage in MB. + * + * @param {number} [siteConfig.limits.maxDiskSizeInMb] Maximum allowed disk + * size usage in MB. + * + * @param {boolean} [siteConfig.autoHealEnabled] true if Auto Heal + * is enabled; otherwise, false. + * + * @param {object} [siteConfig.autoHealRules] Auto Heal rules. + * + * @param {object} [siteConfig.autoHealRules.triggers] Conditions that describe + * when to execute the auto-heal actions. + * + * @param {object} [siteConfig.autoHealRules.triggers.requests] A rule based on + * total requests. + * + * @param {number} [siteConfig.autoHealRules.triggers.requests.count] Request + * Count. + * + * @param {string} [siteConfig.autoHealRules.triggers.requests.timeInterval] + * Time interval. + * + * @param {number} [siteConfig.autoHealRules.triggers.privateBytesInKB] A rule + * based on private bytes. + * + * @param {array} [siteConfig.autoHealRules.triggers.statusCodes] A rule based + * on status codes. + * + * @param {object} [siteConfig.autoHealRules.triggers.slowRequests] A rule + * based on request execution time. + * + * @param {string} [siteConfig.autoHealRules.triggers.slowRequests.timeTaken] + * Time taken. + * + * @param {number} [siteConfig.autoHealRules.triggers.slowRequests.count] + * Request Count. + * + * @param {string} + * [siteConfig.autoHealRules.triggers.slowRequests.timeInterval] Time interval. + * + * @param {object} [siteConfig.autoHealRules.actions] Actions to be executed + * when a rule is triggered. + * + * @param {string} [siteConfig.autoHealRules.actions.actionType] Predefined + * action to be taken. Possible values include: 'Recycle', 'LogEvent', + * 'CustomAction' + * + * @param {object} [siteConfig.autoHealRules.actions.customAction] Custom + * action to be taken. + * + * @param {string} [siteConfig.autoHealRules.actions.customAction.exe] + * Executable to be run. + * + * @param {string} [siteConfig.autoHealRules.actions.customAction.parameters] + * Parameters for the executable. + * + * @param {string} [siteConfig.autoHealRules.actions.minProcessExecutionTime] + * Minimum time the process must execute + * before taking the action + * + * @param {string} [siteConfig.tracingOptions] Tracing options. + * + * @param {string} [siteConfig.vnetName] Virtual Network name. + * + * @param {object} [siteConfig.cors] Cross-Origin Resource Sharing (CORS) + * settings. + * + * @param {array} [siteConfig.cors.allowedOrigins] Gets or sets the list of + * origins that should be allowed to make cross-origin + * calls (for example: http://example.com:12345). Use "*" to allow all. + * + * @param {object} [siteConfig.push] Push endpoint settings. + * + * @param {boolean} siteConfig.push.isPushEnabled Gets or sets a flag + * indicating whether the Push endpoint is enabled. + * + * @param {string} [siteConfig.push.tagWhitelistJson] Gets or sets a JSON + * string containing a list of tags that are whitelisted for use by the push + * registration endpoint. + * + * @param {string} [siteConfig.push.tagsRequiringAuth] Gets or sets a JSON + * string containing a list of tags that require user authentication to be used + * in the push registration endpoint. + * Tags can consist of alphanumeric characters and the following: + * '_', '@', '#', '.', ':', '-'. + * Validation should be performed at the PushRequestHandler. + * + * @param {string} [siteConfig.push.dynamicTagsJson] Gets or sets a JSON string + * containing a list of dynamic tags that will be evaluated from user claims in + * the push registration endpoint. + * + * @param {string} [siteConfig.push.kind] Kind of resource. + * + * @param {object} [siteConfig.apiDefinition] Information about the formal API + * definition for the app. + * + * @param {string} [siteConfig.apiDefinition.url] The URL of the API + * definition. + * + * @param {string} [siteConfig.autoSwapSlotName] Auto-swap slot name. + * + * @param {boolean} [siteConfig.localMySqlEnabled] true to enable + * local MySQL; otherwise, false. + * + * @param {number} [siteConfig.managedServiceIdentityId] Managed Service + * Identity Id + * + * @param {number} [siteConfig.xManagedServiceIdentityId] Explicit Managed + * Service Identity Id + * + * @param {array} [siteConfig.ipSecurityRestrictions] IP security restrictions. + * + * @param {boolean} [siteConfig.http20Enabled] Http20Enabled: configures a web + * site to allow clients to connect over http2.0 + * + * @param {string} [siteConfig.minTlsVersion] MinTlsVersion: configures the + * minimum version of TLS required for SSL requests. Possible values include: + * '1.0', '1.1', '1.2' + * + * @param {string} [siteConfig.ftpsState] State of FTP / FTPS service. Possible + * values include: 'AllAllowed', 'FtpsOnly', 'Disabled' + * + * @param {number} [siteConfig.reservedInstanceCount] Number of reserved + * instances. + * This setting only applies to the Consumption Plan + * + * @param {string} [siteConfig.kind] Kind of resource. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will update configuration for the production slot. + * + * @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. + */ + updateConfigurationSlotWithHttpOperationResponse(resourceGroupName: string, name: string, siteConfig: models.SiteConfigResource, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Updates the configuration of an app. + * + * Updates the configuration of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} siteConfig JSON representation of a SiteConfig object. See + * example. + * + * @param {number} [siteConfig.numberOfWorkers] Number of workers. + * + * @param {array} [siteConfig.defaultDocuments] Default documents. + * + * @param {string} [siteConfig.netFrameworkVersion] .NET Framework version. + * + * @param {string} [siteConfig.phpVersion] Version of PHP. + * + * @param {string} [siteConfig.pythonVersion] Version of Python. + * + * @param {string} [siteConfig.nodeVersion] Version of Node.js. + * + * @param {string} [siteConfig.linuxFxVersion] Linux App Framework and version + * + * @param {string} [siteConfig.windowsFxVersion] Xenon App Framework and + * version + * + * @param {boolean} [siteConfig.requestTracingEnabled] true if + * request tracing is enabled; otherwise, false. + * + * @param {date} [siteConfig.requestTracingExpirationTime] Request tracing + * expiration time. + * + * @param {boolean} [siteConfig.remoteDebuggingEnabled] true if + * remote debugging is enabled; otherwise, false. + * + * @param {string} [siteConfig.remoteDebuggingVersion] Remote debugging + * version. + * + * @param {boolean} [siteConfig.httpLoggingEnabled] true if HTTP + * logging is enabled; otherwise, false. + * + * @param {number} [siteConfig.logsDirectorySizeLimit] HTTP logs directory size + * limit. + * + * @param {boolean} [siteConfig.detailedErrorLoggingEnabled] true + * if detailed error logging is enabled; otherwise, false. + * + * @param {string} [siteConfig.publishingUsername] Publishing user name. + * + * @param {array} [siteConfig.appSettings] Application settings. + * + * @param {object} [siteConfig.azureStorageAccounts] User-provided Azure + * storage accounts. + * + * @param {array} [siteConfig.connectionStrings] Connection strings. + * + * @param {array} [siteConfig.handlerMappings] Handler mappings. + * + * @param {string} [siteConfig.documentRoot] Document root. + * + * @param {string} [siteConfig.scmType] SCM type. Possible values include: + * 'None', 'Dropbox', 'Tfs', 'LocalGit', 'GitHub', 'CodePlexGit', 'CodePlexHg', + * 'BitbucketGit', 'BitbucketHg', 'ExternalGit', 'ExternalHg', 'OneDrive', + * 'VSO' + * + * @param {boolean} [siteConfig.use32BitWorkerProcess] true to use + * 32-bit worker process; otherwise, false. + * + * @param {boolean} [siteConfig.webSocketsEnabled] true if + * WebSocket is enabled; otherwise, false. + * + * @param {boolean} [siteConfig.alwaysOn] true if Always On is + * enabled; otherwise, false. + * + * @param {string} [siteConfig.javaVersion] Java version. + * + * @param {string} [siteConfig.javaContainer] Java container. + * + * @param {string} [siteConfig.javaContainerVersion] Java container version. + * + * @param {string} [siteConfig.appCommandLine] App command line to launch. + * + * @param {string} [siteConfig.managedPipelineMode] Managed pipeline mode. + * Possible values include: 'Integrated', 'Classic' + * + * @param {array} [siteConfig.virtualApplications] Virtual applications. + * + * @param {string} [siteConfig.loadBalancing] Site load balancing. Possible + * values include: 'WeightedRoundRobin', 'LeastRequests', 'LeastResponseTime', + * 'WeightedTotalTraffic', 'RequestHash' + * + * @param {object} [siteConfig.experiments] This is work around for polymophic + * types. + * + * @param {array} [siteConfig.experiments.rampUpRules] List of ramp-up rules. + * + * @param {object} [siteConfig.limits] Site limits. + * + * @param {number} [siteConfig.limits.maxPercentageCpu] Maximum allowed CPU + * usage percentage. + * + * @param {number} [siteConfig.limits.maxMemoryInMb] Maximum allowed memory + * usage in MB. + * + * @param {number} [siteConfig.limits.maxDiskSizeInMb] Maximum allowed disk + * size usage in MB. + * + * @param {boolean} [siteConfig.autoHealEnabled] true if Auto Heal + * is enabled; otherwise, false. + * + * @param {object} [siteConfig.autoHealRules] Auto Heal rules. + * + * @param {object} [siteConfig.autoHealRules.triggers] Conditions that describe + * when to execute the auto-heal actions. + * + * @param {object} [siteConfig.autoHealRules.triggers.requests] A rule based on + * total requests. + * + * @param {number} [siteConfig.autoHealRules.triggers.requests.count] Request + * Count. + * + * @param {string} [siteConfig.autoHealRules.triggers.requests.timeInterval] + * Time interval. + * + * @param {number} [siteConfig.autoHealRules.triggers.privateBytesInKB] A rule + * based on private bytes. + * + * @param {array} [siteConfig.autoHealRules.triggers.statusCodes] A rule based + * on status codes. + * + * @param {object} [siteConfig.autoHealRules.triggers.slowRequests] A rule + * based on request execution time. + * + * @param {string} [siteConfig.autoHealRules.triggers.slowRequests.timeTaken] + * Time taken. + * + * @param {number} [siteConfig.autoHealRules.triggers.slowRequests.count] + * Request Count. + * + * @param {string} + * [siteConfig.autoHealRules.triggers.slowRequests.timeInterval] Time interval. + * + * @param {object} [siteConfig.autoHealRules.actions] Actions to be executed + * when a rule is triggered. + * + * @param {string} [siteConfig.autoHealRules.actions.actionType] Predefined + * action to be taken. Possible values include: 'Recycle', 'LogEvent', + * 'CustomAction' + * + * @param {object} [siteConfig.autoHealRules.actions.customAction] Custom + * action to be taken. + * + * @param {string} [siteConfig.autoHealRules.actions.customAction.exe] + * Executable to be run. + * + * @param {string} [siteConfig.autoHealRules.actions.customAction.parameters] + * Parameters for the executable. + * + * @param {string} [siteConfig.autoHealRules.actions.minProcessExecutionTime] + * Minimum time the process must execute + * before taking the action + * + * @param {string} [siteConfig.tracingOptions] Tracing options. + * + * @param {string} [siteConfig.vnetName] Virtual Network name. + * + * @param {object} [siteConfig.cors] Cross-Origin Resource Sharing (CORS) + * settings. + * + * @param {array} [siteConfig.cors.allowedOrigins] Gets or sets the list of + * origins that should be allowed to make cross-origin + * calls (for example: http://example.com:12345). Use "*" to allow all. + * + * @param {object} [siteConfig.push] Push endpoint settings. + * + * @param {boolean} siteConfig.push.isPushEnabled Gets or sets a flag + * indicating whether the Push endpoint is enabled. + * + * @param {string} [siteConfig.push.tagWhitelistJson] Gets or sets a JSON + * string containing a list of tags that are whitelisted for use by the push + * registration endpoint. + * + * @param {string} [siteConfig.push.tagsRequiringAuth] Gets or sets a JSON + * string containing a list of tags that require user authentication to be used + * in the push registration endpoint. + * Tags can consist of alphanumeric characters and the following: + * '_', '@', '#', '.', ':', '-'. + * Validation should be performed at the PushRequestHandler. + * + * @param {string} [siteConfig.push.dynamicTagsJson] Gets or sets a JSON string + * containing a list of dynamic tags that will be evaluated from user claims in + * the push registration endpoint. + * + * @param {string} [siteConfig.push.kind] Kind of resource. + * + * @param {object} [siteConfig.apiDefinition] Information about the formal API + * definition for the app. + * + * @param {string} [siteConfig.apiDefinition.url] The URL of the API + * definition. + * + * @param {string} [siteConfig.autoSwapSlotName] Auto-swap slot name. + * + * @param {boolean} [siteConfig.localMySqlEnabled] true to enable + * local MySQL; otherwise, false. + * + * @param {number} [siteConfig.managedServiceIdentityId] Managed Service + * Identity Id + * + * @param {number} [siteConfig.xManagedServiceIdentityId] Explicit Managed + * Service Identity Id + * + * @param {array} [siteConfig.ipSecurityRestrictions] IP security restrictions. + * + * @param {boolean} [siteConfig.http20Enabled] Http20Enabled: configures a web + * site to allow clients to connect over http2.0 + * + * @param {string} [siteConfig.minTlsVersion] MinTlsVersion: configures the + * minimum version of TLS required for SSL requests. Possible values include: + * '1.0', '1.1', '1.2' + * + * @param {string} [siteConfig.ftpsState] State of FTP / FTPS service. Possible + * values include: 'AllAllowed', 'FtpsOnly', 'Disabled' + * + * @param {number} [siteConfig.reservedInstanceCount] Number of reserved + * instances. + * This setting only applies to the Consumption Plan + * + * @param {string} [siteConfig.kind] Kind of resource. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will update configuration for the production slot. + * + * @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 {SiteConfigResource} - 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. + * + * {SiteConfigResource} [result] - The deserialized result object if an error did not occur. + * See {@link SiteConfigResource} 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. + */ + updateConfigurationSlot(resourceGroupName: string, name: string, siteConfig: models.SiteConfigResource, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + updateConfigurationSlot(resourceGroupName: string, name: string, siteConfig: models.SiteConfigResource, slot: string, callback: ServiceCallback): void; + updateConfigurationSlot(resourceGroupName: string, name: string, siteConfig: models.SiteConfigResource, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Gets a list of web app configuration snapshots identifiers. Each + * element of the list contains a timestamp and the ID of the snapshot. + * + * Gets a list of web app configuration snapshots identifiers. Each element of + * the list contains a timestamp and the ID of the snapshot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will return configuration for the production slot. + * + * @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. + */ + listConfigurationSnapshotInfoSlotWithHttpOperationResponse(resourceGroupName: string, name: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets a list of web app configuration snapshots identifiers. Each + * element of the list contains a timestamp and the ID of the snapshot. + * + * Gets a list of web app configuration snapshots identifiers. Each element of + * the list contains a timestamp and the ID of the snapshot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will return configuration for the production slot. + * + * @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 {SiteConfigurationSnapshotInfoCollection} - 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. + * + * {SiteConfigurationSnapshotInfoCollection} [result] - The deserialized result object if an error did not occur. + * See {@link SiteConfigurationSnapshotInfoCollection} 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. + */ + listConfigurationSnapshotInfoSlot(resourceGroupName: string, name: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listConfigurationSnapshotInfoSlot(resourceGroupName: string, name: string, slot: string, callback: ServiceCallback): void; + listConfigurationSnapshotInfoSlot(resourceGroupName: string, name: string, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Gets a snapshot of the configuration of an app at a previous point + * in time. + * + * Gets a snapshot of the configuration of an app at a previous point in time. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} snapshotId The ID of the snapshot to read. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will return configuration for the production slot. + * + * @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. + */ + getConfigurationSnapshotSlotWithHttpOperationResponse(resourceGroupName: string, name: string, snapshotId: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets a snapshot of the configuration of an app at a previous point + * in time. + * + * Gets a snapshot of the configuration of an app at a previous point in time. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} snapshotId The ID of the snapshot to read. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will return configuration for the production slot. + * + * @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 {SiteConfigResource} - 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. + * + * {SiteConfigResource} [result] - The deserialized result object if an error did not occur. + * See {@link SiteConfigResource} 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. + */ + getConfigurationSnapshotSlot(resourceGroupName: string, name: string, snapshotId: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getConfigurationSnapshotSlot(resourceGroupName: string, name: string, snapshotId: string, slot: string, callback: ServiceCallback): void; + getConfigurationSnapshotSlot(resourceGroupName: string, name: string, snapshotId: string, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Reverts the configuration of an app to a previous snapshot. + * + * Reverts the configuration of an app to a previous snapshot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} snapshotId The ID of the snapshot to read. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will return configuration for the production slot. + * + * @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. + */ + recoverSiteConfigurationSnapshotSlotWithHttpOperationResponse(resourceGroupName: string, name: string, snapshotId: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Reverts the configuration of an app to a previous snapshot. + * + * Reverts the configuration of an app to a previous snapshot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} snapshotId The ID of the snapshot to read. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will return configuration for the production slot. + * + * @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 {null} - 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. + * + * {null} [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. + */ + recoverSiteConfigurationSnapshotSlot(resourceGroupName: string, name: string, snapshotId: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + recoverSiteConfigurationSnapshotSlot(resourceGroupName: string, name: string, snapshotId: string, slot: string, callback: ServiceCallback): void; + recoverSiteConfigurationSnapshotSlot(resourceGroupName: string, name: string, snapshotId: string, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Gets the last lines of docker logs for the given site + * + * Gets the last lines of docker logs for the given site + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {string} slot Name of web app slot. If not specified then will + * default to production slot. + * + * @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. + */ + getWebSiteContainerLogsSlotWithHttpOperationResponse(resourceGroupName: string, name: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets the last lines of docker logs for the given site + * + * Gets the last lines of docker logs for the given site + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {string} slot Name of web app slot. If not specified then will + * default to production slot. + * + * @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 {Object} - 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. + * + * {Object} [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. + */ + getWebSiteContainerLogsSlot(resourceGroupName: string, name: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getWebSiteContainerLogsSlot(resourceGroupName: string, name: string, slot: string, callback: ServiceCallback): void; + getWebSiteContainerLogsSlot(resourceGroupName: string, name: string, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Gets the ZIP archived docker log files for the given site + * + * Gets the ZIP archived docker log files for the given site + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {string} slot Name of web app slot. If not specified then will + * default to production slot. + * + * @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. + */ + getContainerLogsZipSlotWithHttpOperationResponse(resourceGroupName: string, name: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets the ZIP archived docker log files for the given site + * + * Gets the ZIP archived docker log files for the given site + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {string} slot Name of web app slot. If not specified then will + * default to production slot. + * + * @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 {Object} - 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. + * + * {Object} [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. + */ + getContainerLogsZipSlot(resourceGroupName: string, name: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getContainerLogsZipSlot(resourceGroupName: string, name: string, slot: string, callback: ServiceCallback): void; + getContainerLogsZipSlot(resourceGroupName: string, name: string, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary List continuous web jobs for an app, or a deployment slot. + * + * List continuous web jobs for an app, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API deletes a deployment for the production slot. + * + * @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. + */ + listContinuousWebJobsSlotWithHttpOperationResponse(resourceGroupName: string, name: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary List continuous web jobs for an app, or a deployment slot. + * + * List continuous web jobs for an app, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API deletes a deployment for the production slot. + * + * @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 {ContinuousWebJobCollection} - 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. + * + * {ContinuousWebJobCollection} [result] - The deserialized result object if an error did not occur. + * See {@link ContinuousWebJobCollection} 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. + */ + listContinuousWebJobsSlot(resourceGroupName: string, name: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listContinuousWebJobsSlot(resourceGroupName: string, name: string, slot: string, callback: ServiceCallback): void; + listContinuousWebJobsSlot(resourceGroupName: string, name: string, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Gets a continuous web job by its ID for an app, or a deployment + * slot. + * + * Gets a continuous web job by its ID for an app, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} webJobName Name of Web Job. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API deletes a deployment for the production slot. + * + * @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. + */ + getContinuousWebJobSlotWithHttpOperationResponse(resourceGroupName: string, name: string, webJobName: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets a continuous web job by its ID for an app, or a deployment + * slot. + * + * Gets a continuous web job by its ID for an app, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} webJobName Name of Web Job. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API deletes a deployment for the production slot. + * + * @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 {ContinuousWebJob} - 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. + * + * {ContinuousWebJob} [result] - The deserialized result object if an error did not occur. + * See {@link ContinuousWebJob} 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. + */ + getContinuousWebJobSlot(resourceGroupName: string, name: string, webJobName: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getContinuousWebJobSlot(resourceGroupName: string, name: string, webJobName: string, slot: string, callback: ServiceCallback): void; + getContinuousWebJobSlot(resourceGroupName: string, name: string, webJobName: string, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Delete a continuous web job by its ID for an app, or a deployment + * slot. + * + * Delete a continuous web job by its ID for an app, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} webJobName Name of Web Job. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API deletes a deployment for the production slot. + * + * @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. + */ + deleteContinuousWebJobSlotWithHttpOperationResponse(resourceGroupName: string, name: string, webJobName: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Delete a continuous web job by its ID for an app, or a deployment + * slot. + * + * Delete a continuous web job by its ID for an app, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} webJobName Name of Web Job. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API deletes a deployment for the production slot. + * + * @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 {null} - 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. + * + * {null} [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. + */ + deleteContinuousWebJobSlot(resourceGroupName: string, name: string, webJobName: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteContinuousWebJobSlot(resourceGroupName: string, name: string, webJobName: string, slot: string, callback: ServiceCallback): void; + deleteContinuousWebJobSlot(resourceGroupName: string, name: string, webJobName: string, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Start a continuous web job for an app, or a deployment slot. + * + * Start a continuous web job for an app, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} webJobName Name of Web Job. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API deletes a deployment for the production slot. + * + * @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. + */ + startContinuousWebJobSlotWithHttpOperationResponse(resourceGroupName: string, name: string, webJobName: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Start a continuous web job for an app, or a deployment slot. + * + * Start a continuous web job for an app, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} webJobName Name of Web Job. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API deletes a deployment for the production slot. + * + * @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 {null} - 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. + * + * {null} [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. + */ + startContinuousWebJobSlot(resourceGroupName: string, name: string, webJobName: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + startContinuousWebJobSlot(resourceGroupName: string, name: string, webJobName: string, slot: string, callback: ServiceCallback): void; + startContinuousWebJobSlot(resourceGroupName: string, name: string, webJobName: string, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Stop a continuous web job for an app, or a deployment slot. + * + * Stop a continuous web job for an app, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} webJobName Name of Web Job. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API deletes a deployment for the production slot. + * + * @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. + */ + stopContinuousWebJobSlotWithHttpOperationResponse(resourceGroupName: string, name: string, webJobName: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Stop a continuous web job for an app, or a deployment slot. + * + * Stop a continuous web job for an app, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} webJobName Name of Web Job. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API deletes a deployment for the production slot. + * + * @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 {null} - 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. + * + * {null} [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. + */ + stopContinuousWebJobSlot(resourceGroupName: string, name: string, webJobName: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + stopContinuousWebJobSlot(resourceGroupName: string, name: string, webJobName: string, slot: string, callback: ServiceCallback): void; + stopContinuousWebJobSlot(resourceGroupName: string, name: string, webJobName: string, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary List deployments for an app, or a deployment slot. + * + * List deployments for an app, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API returns deployments for the production slot. + * + * @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. + */ + listDeploymentsSlotWithHttpOperationResponse(resourceGroupName: string, name: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary List deployments for an app, or a deployment slot. + * + * List deployments for an app, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API returns deployments for the production slot. + * + * @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 {DeploymentCollection} - 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. + * + * {DeploymentCollection} [result] - The deserialized result object if an error did not occur. + * See {@link DeploymentCollection} 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. + */ + listDeploymentsSlot(resourceGroupName: string, name: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listDeploymentsSlot(resourceGroupName: string, name: string, slot: string, callback: ServiceCallback): void; + listDeploymentsSlot(resourceGroupName: string, name: string, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Get a deployment by its ID for an app, or a deployment slot. + * + * Get a deployment by its ID for an app, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} id Deployment ID. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API gets a deployment for the production slot. + * + * @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. + */ + getDeploymentSlotWithHttpOperationResponse(resourceGroupName: string, name: string, id: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get a deployment by its ID for an app, or a deployment slot. + * + * Get a deployment by its ID for an app, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} id Deployment ID. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API gets a deployment for the production slot. + * + * @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 {Deployment} - 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. + * + * {Deployment} [result] - The deserialized result object if an error did not occur. + * See {@link Deployment} 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. + */ + getDeploymentSlot(resourceGroupName: string, name: string, id: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getDeploymentSlot(resourceGroupName: string, name: string, id: string, slot: string, callback: ServiceCallback): void; + getDeploymentSlot(resourceGroupName: string, name: string, id: string, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Create a deployment for an app, or a deployment slot. + * + * Create a deployment for an app, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} id ID of an existing deployment. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API creates a deployment for the production slot. + * + * @param {object} deployment Deployment details. + * + * @param {number} [deployment.status] Deployment status. + * + * @param {string} [deployment.message] Details about deployment status. + * + * @param {string} [deployment.author] Who authored the deployment. + * + * @param {string} [deployment.deployer] Who performed the deployment. + * + * @param {string} [deployment.authorEmail] Author email. + * + * @param {date} [deployment.startTime] Start time. + * + * @param {date} [deployment.endTime] End time. + * + * @param {boolean} [deployment.active] True if deployment is currently active, + * false if completed and null if not started. + * + * @param {string} [deployment.details] Details on deployment. + * + * @param {string} [deployment.kind] Kind of resource. + * + * @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. + */ + createDeploymentSlotWithHttpOperationResponse(resourceGroupName: string, name: string, id: string, slot: string, deployment: models.Deployment, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Create a deployment for an app, or a deployment slot. + * + * Create a deployment for an app, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} id ID of an existing deployment. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API creates a deployment for the production slot. + * + * @param {object} deployment Deployment details. + * + * @param {number} [deployment.status] Deployment status. + * + * @param {string} [deployment.message] Details about deployment status. + * + * @param {string} [deployment.author] Who authored the deployment. + * + * @param {string} [deployment.deployer] Who performed the deployment. + * + * @param {string} [deployment.authorEmail] Author email. + * + * @param {date} [deployment.startTime] Start time. + * + * @param {date} [deployment.endTime] End time. + * + * @param {boolean} [deployment.active] True if deployment is currently active, + * false if completed and null if not started. + * + * @param {string} [deployment.details] Details on deployment. + * + * @param {string} [deployment.kind] Kind of resource. + * + * @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 {Deployment} - 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. + * + * {Deployment} [result] - The deserialized result object if an error did not occur. + * See {@link Deployment} 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. + */ + createDeploymentSlot(resourceGroupName: string, name: string, id: string, slot: string, deployment: models.Deployment, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createDeploymentSlot(resourceGroupName: string, name: string, id: string, slot: string, deployment: models.Deployment, callback: ServiceCallback): void; + createDeploymentSlot(resourceGroupName: string, name: string, id: string, slot: string, deployment: models.Deployment, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Delete a deployment by its ID for an app, or a deployment slot. + * + * Delete a deployment by its ID for an app, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} id Deployment ID. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API deletes a deployment for the production slot. + * + * @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. + */ + deleteDeploymentSlotWithHttpOperationResponse(resourceGroupName: string, name: string, id: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Delete a deployment by its ID for an app, or a deployment slot. + * + * Delete a deployment by its ID for an app, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} id Deployment ID. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API deletes a deployment for the production slot. + * + * @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 {null} - 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. + * + * {null} [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. + */ + deleteDeploymentSlot(resourceGroupName: string, name: string, id: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteDeploymentSlot(resourceGroupName: string, name: string, id: string, slot: string, callback: ServiceCallback): void; + deleteDeploymentSlot(resourceGroupName: string, name: string, id: string, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary List deployment log for specific deployment for an app, or a + * deployment slot. + * + * List deployment log for specific deployment for an app, or a deployment + * slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} id The ID of a specific deployment. This is the value of the + * name property in the JSON response from "GET + * /api/sites/{siteName}/deployments". + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API returns deployments for the production slot. + * + * @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. + */ + listDeploymentLogSlotWithHttpOperationResponse(resourceGroupName: string, name: string, id: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary List deployment log for specific deployment for an app, or a + * deployment slot. + * + * List deployment log for specific deployment for an app, or a deployment + * slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} id The ID of a specific deployment. This is the value of the + * name property in the JSON response from "GET + * /api/sites/{siteName}/deployments". + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API returns deployments for the production slot. + * + * @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 {Deployment} - 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. + * + * {Deployment} [result] - The deserialized result object if an error did not occur. + * See {@link Deployment} 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. + */ + listDeploymentLogSlot(resourceGroupName: string, name: string, id: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listDeploymentLogSlot(resourceGroupName: string, name: string, id: string, slot: string, callback: ServiceCallback): void; + listDeploymentLogSlot(resourceGroupName: string, name: string, id: string, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Discovers an existing app backup that can be restored from a blob + * in Azure storage. Use this to get information about the databases stored in + * a backup. + * + * Discovers an existing app backup that can be restored from a blob in Azure + * storage. Use this to get information about the databases stored in a backup. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} request A RestoreRequest object that includes Azure storage + * URL and blog name for discovery of backup. + * + * @param {string} request.storageAccountUrl SAS URL to the container. + * + * @param {string} [request.blobName] Name of a blob which contains the backup. + * + * @param {boolean} request.overwrite true if the restore + * operation can overwrite target app; otherwise, false. + * true is needed if trying to restore over an existing app. + * + * @param {string} [request.siteName] Name of an app. + * + * @param {array} [request.databases] Collection of databases which should be + * restored. This list has to match the list of databases included in the + * backup. + * + * @param {boolean} [request.ignoreConflictingHostNames] Changes a logic when + * restoring an app with custom domains. true to remove custom + * domains automatically. If false, custom domains are added to + * the app's object when it is being restored, but that might fail due to + * conflicts during the operation. + * + * @param {boolean} [request.ignoreDatabases] Ignore the databases and only + * restore the site content + * + * @param {string} [request.appServicePlan] Specify app service plan that will + * own restored site. + * + * @param {string} [request.operationType] Operation type. Possible values + * include: 'Default', 'Clone', 'Relocation', 'Snapshot', 'CloudFS' + * + * @param {boolean} [request.adjustConnectionStrings] true if + * SiteConfig.ConnectionStrings should be set in new app; otherwise, + * false. + * + * @param {string} [request.hostingEnvironment] App Service Environment name, + * if needed (only when restoring an app to an App Service Environment). + * + * @param {string} [request.kind] Kind of resource. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will perform discovery for the production slot. + * + * @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. + */ + discoverBackupSlotWithHttpOperationResponse(resourceGroupName: string, name: string, request: models.RestoreRequest, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Discovers an existing app backup that can be restored from a blob + * in Azure storage. Use this to get information about the databases stored in + * a backup. + * + * Discovers an existing app backup that can be restored from a blob in Azure + * storage. Use this to get information about the databases stored in a backup. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} request A RestoreRequest object that includes Azure storage + * URL and blog name for discovery of backup. + * + * @param {string} request.storageAccountUrl SAS URL to the container. + * + * @param {string} [request.blobName] Name of a blob which contains the backup. + * + * @param {boolean} request.overwrite true if the restore + * operation can overwrite target app; otherwise, false. + * true is needed if trying to restore over an existing app. + * + * @param {string} [request.siteName] Name of an app. + * + * @param {array} [request.databases] Collection of databases which should be + * restored. This list has to match the list of databases included in the + * backup. + * + * @param {boolean} [request.ignoreConflictingHostNames] Changes a logic when + * restoring an app with custom domains. true to remove custom + * domains automatically. If false, custom domains are added to + * the app's object when it is being restored, but that might fail due to + * conflicts during the operation. + * + * @param {boolean} [request.ignoreDatabases] Ignore the databases and only + * restore the site content + * + * @param {string} [request.appServicePlan] Specify app service plan that will + * own restored site. + * + * @param {string} [request.operationType] Operation type. Possible values + * include: 'Default', 'Clone', 'Relocation', 'Snapshot', 'CloudFS' + * + * @param {boolean} [request.adjustConnectionStrings] true if + * SiteConfig.ConnectionStrings should be set in new app; otherwise, + * false. + * + * @param {string} [request.hostingEnvironment] App Service Environment name, + * if needed (only when restoring an app to an App Service Environment). + * + * @param {string} [request.kind] Kind of resource. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will perform discovery for the production slot. + * + * @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 {RestoreRequest} - 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. + * + * {RestoreRequest} [result] - The deserialized result object if an error did not occur. + * See {@link RestoreRequest} 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. + */ + discoverBackupSlot(resourceGroupName: string, name: string, request: models.RestoreRequest, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + discoverBackupSlot(resourceGroupName: string, name: string, request: models.RestoreRequest, slot: string, callback: ServiceCallback): void; + discoverBackupSlot(resourceGroupName: string, name: string, request: models.RestoreRequest, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Lists ownership identifiers for domain associated with web app. + * + * Lists ownership identifiers for domain associated with web app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will delete the binding for the production slot. + * + * @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. + */ + listDomainOwnershipIdentifiersSlotWithHttpOperationResponse(resourceGroupName: string, name: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Lists ownership identifiers for domain associated with web app. + * + * Lists ownership identifiers for domain associated with web app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will delete the binding for the production slot. + * + * @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 {IdentifierCollection} - 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. + * + * {IdentifierCollection} [result] - The deserialized result object if an error did not occur. + * See {@link IdentifierCollection} 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. + */ + listDomainOwnershipIdentifiersSlot(resourceGroupName: string, name: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listDomainOwnershipIdentifiersSlot(resourceGroupName: string, name: string, slot: string, callback: ServiceCallback): void; + listDomainOwnershipIdentifiersSlot(resourceGroupName: string, name: string, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Get domain ownership identifier for web app. + * + * Get domain ownership identifier for web app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} domainOwnershipIdentifierName Name of domain ownership + * identifier. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will delete the binding for the production slot. + * + * @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. + */ + getDomainOwnershipIdentifierSlotWithHttpOperationResponse(resourceGroupName: string, name: string, domainOwnershipIdentifierName: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get domain ownership identifier for web app. + * + * Get domain ownership identifier for web app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} domainOwnershipIdentifierName Name of domain ownership + * identifier. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will delete the binding for the production slot. + * + * @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 {Identifier} - 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. + * + * {Identifier} [result] - The deserialized result object if an error did not occur. + * See {@link Identifier} 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. + */ + getDomainOwnershipIdentifierSlot(resourceGroupName: string, name: string, domainOwnershipIdentifierName: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getDomainOwnershipIdentifierSlot(resourceGroupName: string, name: string, domainOwnershipIdentifierName: string, slot: string, callback: ServiceCallback): void; + getDomainOwnershipIdentifierSlot(resourceGroupName: string, name: string, domainOwnershipIdentifierName: string, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Creates a domain ownership identifier for web app, or updates an + * existing ownership identifier. + * + * Creates a domain ownership identifier for web app, or updates an existing + * ownership identifier. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} domainOwnershipIdentifierName Name of domain ownership + * identifier. + * + * @param {object} domainOwnershipIdentifier A JSON representation of the + * domain ownership properties. + * + * @param {string} [domainOwnershipIdentifier.identifierId] String + * representation of the identity. + * + * @param {string} [domainOwnershipIdentifier.kind] Kind of resource. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will delete the binding for the production slot. + * + * @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. + */ + createOrUpdateDomainOwnershipIdentifierSlotWithHttpOperationResponse(resourceGroupName: string, name: string, domainOwnershipIdentifierName: string, domainOwnershipIdentifier: models.Identifier, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Creates a domain ownership identifier for web app, or updates an + * existing ownership identifier. + * + * Creates a domain ownership identifier for web app, or updates an existing + * ownership identifier. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} domainOwnershipIdentifierName Name of domain ownership + * identifier. + * + * @param {object} domainOwnershipIdentifier A JSON representation of the + * domain ownership properties. + * + * @param {string} [domainOwnershipIdentifier.identifierId] String + * representation of the identity. + * + * @param {string} [domainOwnershipIdentifier.kind] Kind of resource. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will delete the binding for the production slot. + * + * @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 {Identifier} - 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. + * + * {Identifier} [result] - The deserialized result object if an error did not occur. + * See {@link Identifier} 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. + */ + createOrUpdateDomainOwnershipIdentifierSlot(resourceGroupName: string, name: string, domainOwnershipIdentifierName: string, domainOwnershipIdentifier: models.Identifier, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdateDomainOwnershipIdentifierSlot(resourceGroupName: string, name: string, domainOwnershipIdentifierName: string, domainOwnershipIdentifier: models.Identifier, slot: string, callback: ServiceCallback): void; + createOrUpdateDomainOwnershipIdentifierSlot(resourceGroupName: string, name: string, domainOwnershipIdentifierName: string, domainOwnershipIdentifier: models.Identifier, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Deletes a domain ownership identifier for a web app. + * + * Deletes a domain ownership identifier for a web app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} domainOwnershipIdentifierName Name of domain ownership + * identifier. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will delete the binding for the production slot. + * + * @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. + */ + deleteDomainOwnershipIdentifierSlotWithHttpOperationResponse(resourceGroupName: string, name: string, domainOwnershipIdentifierName: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Deletes a domain ownership identifier for a web app. + * + * Deletes a domain ownership identifier for a web app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} domainOwnershipIdentifierName Name of domain ownership + * identifier. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will delete the binding for the production slot. + * + * @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 {null} - 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. + * + * {null} [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. + */ + deleteDomainOwnershipIdentifierSlot(resourceGroupName: string, name: string, domainOwnershipIdentifierName: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteDomainOwnershipIdentifierSlot(resourceGroupName: string, name: string, domainOwnershipIdentifierName: string, slot: string, callback: ServiceCallback): void; + deleteDomainOwnershipIdentifierSlot(resourceGroupName: string, name: string, domainOwnershipIdentifierName: string, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Creates a domain ownership identifier for web app, or updates an + * existing ownership identifier. + * + * Creates a domain ownership identifier for web app, or updates an existing + * ownership identifier. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} domainOwnershipIdentifierName Name of domain ownership + * identifier. + * + * @param {object} domainOwnershipIdentifier A JSON representation of the + * domain ownership properties. + * + * @param {string} [domainOwnershipIdentifier.identifierId] String + * representation of the identity. + * + * @param {string} [domainOwnershipIdentifier.kind] Kind of resource. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will delete the binding for the production slot. + * + * @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. + */ + updateDomainOwnershipIdentifierSlotWithHttpOperationResponse(resourceGroupName: string, name: string, domainOwnershipIdentifierName: string, domainOwnershipIdentifier: models.Identifier, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Creates a domain ownership identifier for web app, or updates an + * existing ownership identifier. + * + * Creates a domain ownership identifier for web app, or updates an existing + * ownership identifier. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} domainOwnershipIdentifierName Name of domain ownership + * identifier. + * + * @param {object} domainOwnershipIdentifier A JSON representation of the + * domain ownership properties. + * + * @param {string} [domainOwnershipIdentifier.identifierId] String + * representation of the identity. + * + * @param {string} [domainOwnershipIdentifier.kind] Kind of resource. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will delete the binding for the production slot. + * + * @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 {Identifier} - 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. + * + * {Identifier} [result] - The deserialized result object if an error did not occur. + * See {@link Identifier} 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. + */ + updateDomainOwnershipIdentifierSlot(resourceGroupName: string, name: string, domainOwnershipIdentifierName: string, domainOwnershipIdentifier: models.Identifier, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + updateDomainOwnershipIdentifierSlot(resourceGroupName: string, name: string, domainOwnershipIdentifierName: string, domainOwnershipIdentifier: models.Identifier, slot: string, callback: ServiceCallback): void; + updateDomainOwnershipIdentifierSlot(resourceGroupName: string, name: string, domainOwnershipIdentifierName: string, domainOwnershipIdentifier: models.Identifier, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Get the status of the last MSDeploy operation. + * + * Get the status of the last MSDeploy operation. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {string} slot Name of web app slot. If not specified then will + * default to production slot. + * + * @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. + */ + getMSDeployStatusSlotWithHttpOperationResponse(resourceGroupName: string, name: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get the status of the last MSDeploy operation. + * + * Get the status of the last MSDeploy operation. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {string} slot Name of web app slot. If not specified then will + * default to production slot. + * + * @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 {MSDeployStatus} - 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. + * + * {MSDeployStatus} [result] - The deserialized result object if an error did not occur. + * See {@link MSDeployStatus} 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. + */ + getMSDeployStatusSlot(resourceGroupName: string, name: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getMSDeployStatusSlot(resourceGroupName: string, name: string, slot: string, callback: ServiceCallback): void; + getMSDeployStatusSlot(resourceGroupName: string, name: string, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Invoke the MSDeploy web app extension. + * + * Invoke the MSDeploy web app extension. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {string} slot Name of web app slot. If not specified then will + * default to production slot. + * + * @param {object} mSDeploy Details of MSDeploy operation + * + * @param {string} [mSDeploy.packageUri] Package URI + * + * @param {string} [mSDeploy.connectionString] SQL Connection String + * + * @param {string} [mSDeploy.dbType] Database Type + * + * @param {string} [mSDeploy.setParametersXmlFileUri] URI of MSDeploy + * Parameters file. Must not be set if SetParameters is used. + * + * @param {object} [mSDeploy.setParameters] MSDeploy Parameters. Must not be + * set if SetParametersXmlFileUri is used. + * + * @param {boolean} [mSDeploy.skipAppData] Controls whether the MSDeploy + * operation skips the App_Data directory. + * If set to true, the existing App_Data directory on the + * destination + * will not be deleted, and any App_Data directory in the source will be + * ignored. + * Setting is false by default. + * + * @param {boolean} [mSDeploy.appOffline] Sets the AppOffline rule while the + * MSDeploy operation executes. + * Setting is false by default. + * + * @param {string} [mSDeploy.kind] Kind of resource. + * + * @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. + */ + createMSDeployOperationSlotWithHttpOperationResponse(resourceGroupName: string, name: string, slot: string, mSDeploy: models.MSDeploy, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Invoke the MSDeploy web app extension. + * + * Invoke the MSDeploy web app extension. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {string} slot Name of web app slot. If not specified then will + * default to production slot. + * + * @param {object} mSDeploy Details of MSDeploy operation + * + * @param {string} [mSDeploy.packageUri] Package URI + * + * @param {string} [mSDeploy.connectionString] SQL Connection String + * + * @param {string} [mSDeploy.dbType] Database Type + * + * @param {string} [mSDeploy.setParametersXmlFileUri] URI of MSDeploy + * Parameters file. Must not be set if SetParameters is used. + * + * @param {object} [mSDeploy.setParameters] MSDeploy Parameters. Must not be + * set if SetParametersXmlFileUri is used. + * + * @param {boolean} [mSDeploy.skipAppData] Controls whether the MSDeploy + * operation skips the App_Data directory. + * If set to true, the existing App_Data directory on the + * destination + * will not be deleted, and any App_Data directory in the source will be + * ignored. + * Setting is false by default. + * + * @param {boolean} [mSDeploy.appOffline] Sets the AppOffline rule while the + * MSDeploy operation executes. + * Setting is false by default. + * + * @param {string} [mSDeploy.kind] Kind of resource. + * + * @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 {MSDeployStatus} - 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. + * + * {MSDeployStatus} [result] - The deserialized result object if an error did not occur. + * See {@link MSDeployStatus} 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. + */ + createMSDeployOperationSlot(resourceGroupName: string, name: string, slot: string, mSDeploy: models.MSDeploy, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createMSDeployOperationSlot(resourceGroupName: string, name: string, slot: string, mSDeploy: models.MSDeploy, callback: ServiceCallback): void; + createMSDeployOperationSlot(resourceGroupName: string, name: string, slot: string, mSDeploy: models.MSDeploy, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Get the MSDeploy Log for the last MSDeploy operation. + * + * Get the MSDeploy Log for the last MSDeploy operation. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {string} slot Name of web app slot. If not specified then will + * default to production slot. + * + * @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. + */ + getMSDeployLogSlotWithHttpOperationResponse(resourceGroupName: string, name: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get the MSDeploy Log for the last MSDeploy operation. + * + * Get the MSDeploy Log for the last MSDeploy operation. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {string} slot Name of web app slot. If not specified then will + * default to production slot. + * + * @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 {MSDeployLog} - 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. + * + * {MSDeployLog} [result] - The deserialized result object if an error did not occur. + * See {@link MSDeployLog} 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. + */ + getMSDeployLogSlot(resourceGroupName: string, name: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getMSDeployLogSlot(resourceGroupName: string, name: string, slot: string, callback: ServiceCallback): void; + getMSDeployLogSlot(resourceGroupName: string, name: string, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary List the functions for a web site, or a deployment slot. + * + * List the functions for a web site, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API deletes a deployment for the production slot. + * + * @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. + */ + listInstanceFunctionsSlotWithHttpOperationResponse(resourceGroupName: string, name: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary List the functions for a web site, or a deployment slot. + * + * List the functions for a web site, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API deletes a deployment for the production slot. + * + * @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 {FunctionEnvelopeCollection} - 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. + * + * {FunctionEnvelopeCollection} [result] - The deserialized result object if an error did not occur. + * See {@link FunctionEnvelopeCollection} 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. + */ + listInstanceFunctionsSlot(resourceGroupName: string, name: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listInstanceFunctionsSlot(resourceGroupName: string, name: string, slot: string, callback: ServiceCallback): void; + listInstanceFunctionsSlot(resourceGroupName: string, name: string, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Fetch a short lived token that can be exchanged for a master key. + * + * Fetch a short lived token that can be exchanged for a master key. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {string} slot Name of web app slot. If not specified then will + * default to production slot. + * + * @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. + */ + getFunctionsAdminTokenSlotWithHttpOperationResponse(resourceGroupName: string, name: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Fetch a short lived token that can be exchanged for a master key. + * + * Fetch a short lived token that can be exchanged for a master key. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {string} slot Name of web app slot. If not specified then will + * default to production slot. + * + * @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 {String} - 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. + * + * {String} [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. + */ + getFunctionsAdminTokenSlot(resourceGroupName: string, name: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getFunctionsAdminTokenSlot(resourceGroupName: string, name: string, slot: string, callback: ServiceCallback): void; + getFunctionsAdminTokenSlot(resourceGroupName: string, name: string, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Get function information by its ID for web site, or a deployment + * slot. + * + * Get function information by its ID for web site, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} functionName Function name. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API deletes a deployment for the production slot. + * + * @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. + */ + getInstanceFunctionSlotWithHttpOperationResponse(resourceGroupName: string, name: string, functionName: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get function information by its ID for web site, or a deployment + * slot. + * + * Get function information by its ID for web site, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} functionName Function name. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API deletes a deployment for the production slot. + * + * @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 {FunctionEnvelope} - 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. + * + * {FunctionEnvelope} [result] - The deserialized result object if an error did not occur. + * See {@link FunctionEnvelope} 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. + */ + getInstanceFunctionSlot(resourceGroupName: string, name: string, functionName: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getInstanceFunctionSlot(resourceGroupName: string, name: string, functionName: string, slot: string, callback: ServiceCallback): void; + getInstanceFunctionSlot(resourceGroupName: string, name: string, functionName: string, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Create function for web site, or a deployment slot. + * + * Create function for web site, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} functionName Function name. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API deletes a deployment for the production slot. + * + * @param {object} functionEnvelope Function details. + * + * @param {string} [functionEnvelope.functionAppId] Function App ID. + * + * @param {string} [functionEnvelope.scriptRootPathHref] Script root path URI. + * + * @param {string} [functionEnvelope.scriptHref] Script URI. + * + * @param {string} [functionEnvelope.configHref] Config URI. + * + * @param {string} [functionEnvelope.secretsFileHref] Secrets file URI. + * + * @param {string} [functionEnvelope.href] Function URI. + * + * @param {object} [functionEnvelope.config] Config information. + * + * @param {object} [functionEnvelope.files] File list. + * + * @param {string} [functionEnvelope.testData] Test data used when testing via + * the Azure Portal. + * + * @param {string} [functionEnvelope.kind] Kind of resource. + * + * @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. + */ + createInstanceFunctionSlotWithHttpOperationResponse(resourceGroupName: string, name: string, functionName: string, slot: string, functionEnvelope: models.FunctionEnvelope, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Create function for web site, or a deployment slot. + * + * Create function for web site, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} functionName Function name. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API deletes a deployment for the production slot. + * + * @param {object} functionEnvelope Function details. + * + * @param {string} [functionEnvelope.functionAppId] Function App ID. + * + * @param {string} [functionEnvelope.scriptRootPathHref] Script root path URI. + * + * @param {string} [functionEnvelope.scriptHref] Script URI. + * + * @param {string} [functionEnvelope.configHref] Config URI. + * + * @param {string} [functionEnvelope.secretsFileHref] Secrets file URI. + * + * @param {string} [functionEnvelope.href] Function URI. + * + * @param {object} [functionEnvelope.config] Config information. + * + * @param {object} [functionEnvelope.files] File list. + * + * @param {string} [functionEnvelope.testData] Test data used when testing via + * the Azure Portal. + * + * @param {string} [functionEnvelope.kind] Kind of resource. + * + * @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 {FunctionEnvelope} - 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. + * + * {FunctionEnvelope} [result] - The deserialized result object if an error did not occur. + * See {@link FunctionEnvelope} 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. + */ + createInstanceFunctionSlot(resourceGroupName: string, name: string, functionName: string, slot: string, functionEnvelope: models.FunctionEnvelope, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createInstanceFunctionSlot(resourceGroupName: string, name: string, functionName: string, slot: string, functionEnvelope: models.FunctionEnvelope, callback: ServiceCallback): void; + createInstanceFunctionSlot(resourceGroupName: string, name: string, functionName: string, slot: string, functionEnvelope: models.FunctionEnvelope, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Delete a function for web site, or a deployment slot. + * + * Delete a function for web site, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} functionName Function name. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API deletes a deployment for the production slot. + * + * @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. + */ + deleteInstanceFunctionSlotWithHttpOperationResponse(resourceGroupName: string, name: string, functionName: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Delete a function for web site, or a deployment slot. + * + * Delete a function for web site, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} functionName Function name. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API deletes a deployment for the production slot. + * + * @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 {null} - 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. + * + * {null} [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. + */ + deleteInstanceFunctionSlot(resourceGroupName: string, name: string, functionName: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteInstanceFunctionSlot(resourceGroupName: string, name: string, functionName: string, slot: string, callback: ServiceCallback): void; + deleteInstanceFunctionSlot(resourceGroupName: string, name: string, functionName: string, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Get function secrets for a function in a web site, or a deployment + * slot. + * + * Get function secrets for a function in a web site, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} functionName Function name. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API deletes a deployment for the production slot. + * + * @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. + */ + listFunctionSecretsSlotWithHttpOperationResponse(resourceGroupName: string, name: string, functionName: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get function secrets for a function in a web site, or a deployment + * slot. + * + * Get function secrets for a function in a web site, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} functionName Function name. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API deletes a deployment for the production slot. + * + * @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 {FunctionSecrets} - 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. + * + * {FunctionSecrets} [result] - The deserialized result object if an error did not occur. + * See {@link FunctionSecrets} 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. + */ + listFunctionSecretsSlot(resourceGroupName: string, name: string, functionName: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listFunctionSecretsSlot(resourceGroupName: string, name: string, functionName: string, slot: string, callback: ServiceCallback): void; + listFunctionSecretsSlot(resourceGroupName: string, name: string, functionName: string, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Get hostname bindings for an app or a deployment slot. + * + * Get hostname bindings for an app or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API gets hostname bindings for the production slot. + * + * @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. + */ + listHostNameBindingsSlotWithHttpOperationResponse(resourceGroupName: string, name: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get hostname bindings for an app or a deployment slot. + * + * Get hostname bindings for an app or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API gets hostname bindings for the production slot. + * + * @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 {HostNameBindingCollection} - 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. + * + * {HostNameBindingCollection} [result] - The deserialized result object if an error did not occur. + * See {@link HostNameBindingCollection} 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. + */ + listHostNameBindingsSlot(resourceGroupName: string, name: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listHostNameBindingsSlot(resourceGroupName: string, name: string, slot: string, callback: ServiceCallback): void; + listHostNameBindingsSlot(resourceGroupName: string, name: string, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Get the named hostname binding for an app (or deployment slot, if + * specified). + * + * Get the named hostname binding for an app (or deployment slot, if + * specified). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API the named binding for the production slot. + * + * @param {string} hostName Hostname in the hostname binding. + * + * @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. + */ + getHostNameBindingSlotWithHttpOperationResponse(resourceGroupName: string, name: string, slot: string, hostName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get the named hostname binding for an app (or deployment slot, if + * specified). + * + * Get the named hostname binding for an app (or deployment slot, if + * specified). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API the named binding for the production slot. + * + * @param {string} hostName Hostname in the hostname binding. + * + * @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 {HostNameBinding} - 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. + * + * {HostNameBinding} [result] - The deserialized result object if an error did not occur. + * See {@link HostNameBinding} 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. + */ + getHostNameBindingSlot(resourceGroupName: string, name: string, slot: string, hostName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getHostNameBindingSlot(resourceGroupName: string, name: string, slot: string, hostName: string, callback: ServiceCallback): void; + getHostNameBindingSlot(resourceGroupName: string, name: string, slot: string, hostName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Creates a hostname binding for an app. + * + * Creates a hostname binding for an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} hostName Hostname in the hostname binding. + * + * @param {object} hostNameBinding Binding details. This is the JSON + * representation of a HostNameBinding object. + * + * @param {string} [hostNameBinding.siteName] App Service app name. + * + * @param {string} [hostNameBinding.domainId] Fully qualified ARM domain + * resource URI. + * + * @param {string} [hostNameBinding.azureResourceName] Azure resource name. + * + * @param {string} [hostNameBinding.azureResourceType] Azure resource type. + * Possible values include: 'Website', 'TrafficManager' + * + * @param {string} [hostNameBinding.customHostNameDnsRecordType] Custom DNS + * record type. Possible values include: 'CName', 'A' + * + * @param {string} [hostNameBinding.hostNameType] Hostname type. Possible + * values include: 'Verified', 'Managed' + * + * @param {string} [hostNameBinding.sslState] SSL type. Possible values + * include: 'Disabled', 'SniEnabled', 'IpBasedEnabled' + * + * @param {string} [hostNameBinding.thumbprint] SSL certificate thumbprint + * + * @param {string} [hostNameBinding.kind] Kind of resource. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will create a binding for the production slot. + * + * @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. + */ + createOrUpdateHostNameBindingSlotWithHttpOperationResponse(resourceGroupName: string, name: string, hostName: string, hostNameBinding: models.HostNameBinding, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Creates a hostname binding for an app. + * + * Creates a hostname binding for an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} hostName Hostname in the hostname binding. + * + * @param {object} hostNameBinding Binding details. This is the JSON + * representation of a HostNameBinding object. + * + * @param {string} [hostNameBinding.siteName] App Service app name. + * + * @param {string} [hostNameBinding.domainId] Fully qualified ARM domain + * resource URI. + * + * @param {string} [hostNameBinding.azureResourceName] Azure resource name. + * + * @param {string} [hostNameBinding.azureResourceType] Azure resource type. + * Possible values include: 'Website', 'TrafficManager' + * + * @param {string} [hostNameBinding.customHostNameDnsRecordType] Custom DNS + * record type. Possible values include: 'CName', 'A' + * + * @param {string} [hostNameBinding.hostNameType] Hostname type. Possible + * values include: 'Verified', 'Managed' + * + * @param {string} [hostNameBinding.sslState] SSL type. Possible values + * include: 'Disabled', 'SniEnabled', 'IpBasedEnabled' + * + * @param {string} [hostNameBinding.thumbprint] SSL certificate thumbprint + * + * @param {string} [hostNameBinding.kind] Kind of resource. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will create a binding for the production slot. + * + * @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 {HostNameBinding} - 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. + * + * {HostNameBinding} [result] - The deserialized result object if an error did not occur. + * See {@link HostNameBinding} 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. + */ + createOrUpdateHostNameBindingSlot(resourceGroupName: string, name: string, hostName: string, hostNameBinding: models.HostNameBinding, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdateHostNameBindingSlot(resourceGroupName: string, name: string, hostName: string, hostNameBinding: models.HostNameBinding, slot: string, callback: ServiceCallback): void; + createOrUpdateHostNameBindingSlot(resourceGroupName: string, name: string, hostName: string, hostNameBinding: models.HostNameBinding, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Deletes a hostname binding for an app. + * + * Deletes a hostname binding for an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will delete the binding for the production slot. + * + * @param {string} hostName Hostname in the hostname binding. + * + * @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. + */ + deleteHostNameBindingSlotWithHttpOperationResponse(resourceGroupName: string, name: string, slot: string, hostName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Deletes a hostname binding for an app. + * + * Deletes a hostname binding for an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will delete the binding for the production slot. + * + * @param {string} hostName Hostname in the hostname binding. + * + * @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 {null} - 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. + * + * {null} [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. + */ + deleteHostNameBindingSlot(resourceGroupName: string, name: string, slot: string, hostName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteHostNameBindingSlot(resourceGroupName: string, name: string, slot: string, hostName: string, callback: ServiceCallback): void; + deleteHostNameBindingSlot(resourceGroupName: string, name: string, slot: string, hostName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Retrieves a specific Service Bus Hybrid Connection used by this Web + * App. + * + * Retrieves a specific Service Bus Hybrid Connection used by this Web App. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @param {string} namespaceName The namespace for this hybrid connection. + * + * @param {string} relayName The relay name for this hybrid connection. + * + * @param {string} slot The name of the slot for the web app. + * + * @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. + */ + getHybridConnectionSlotWithHttpOperationResponse(resourceGroupName: string, name: string, namespaceName: string, relayName: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Retrieves a specific Service Bus Hybrid Connection used by this Web + * App. + * + * Retrieves a specific Service Bus Hybrid Connection used by this Web App. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @param {string} namespaceName The namespace for this hybrid connection. + * + * @param {string} relayName The relay name for this hybrid connection. + * + * @param {string} slot The name of the slot for the web app. + * + * @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 {HybridConnection} - 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. + * + * {HybridConnection} [result] - The deserialized result object if an error did not occur. + * See {@link HybridConnection} 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. + */ + getHybridConnectionSlot(resourceGroupName: string, name: string, namespaceName: string, relayName: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getHybridConnectionSlot(resourceGroupName: string, name: string, namespaceName: string, relayName: string, slot: string, callback: ServiceCallback): void; + getHybridConnectionSlot(resourceGroupName: string, name: string, namespaceName: string, relayName: string, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Creates a new Hybrid Connection using a Service Bus relay. + * + * Creates a new Hybrid Connection using a Service Bus relay. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @param {string} namespaceName The namespace for this hybrid connection. + * + * @param {string} relayName The relay name for this hybrid connection. + * + * @param {object} connectionEnvelope The details of the hybrid connection. + * + * @param {string} [connectionEnvelope.serviceBusNamespace] The name of the + * Service Bus namespace. + * + * @param {string} [connectionEnvelope.relayName] The name of the Service Bus + * relay. + * + * @param {string} [connectionEnvelope.relayArmUri] The ARM URI to the Service + * Bus relay. + * + * @param {string} [connectionEnvelope.hostname] The hostname of the endpoint. + * + * @param {number} [connectionEnvelope.port] The port of the endpoint. + * + * @param {string} [connectionEnvelope.sendKeyName] The name of the Service Bus + * key which has Send permissions. This is used to authenticate to Service Bus. + * + * @param {string} [connectionEnvelope.sendKeyValue] The value of the Service + * Bus key. This is used to authenticate to Service Bus. In ARM this key will + * not be returned + * normally, use the POST /listKeys API instead. + * + * @param {string} [connectionEnvelope.serviceBusSuffix] The suffix for the + * service bus endpoint. By default this is .servicebus.windows.net + * + * @param {string} [connectionEnvelope.kind] Kind of resource. + * + * @param {string} slot The name of the slot for the web app. + * + * @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. + */ + createOrUpdateHybridConnectionSlotWithHttpOperationResponse(resourceGroupName: string, name: string, namespaceName: string, relayName: string, connectionEnvelope: models.HybridConnection, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Creates a new Hybrid Connection using a Service Bus relay. + * + * Creates a new Hybrid Connection using a Service Bus relay. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @param {string} namespaceName The namespace for this hybrid connection. + * + * @param {string} relayName The relay name for this hybrid connection. + * + * @param {object} connectionEnvelope The details of the hybrid connection. + * + * @param {string} [connectionEnvelope.serviceBusNamespace] The name of the + * Service Bus namespace. + * + * @param {string} [connectionEnvelope.relayName] The name of the Service Bus + * relay. + * + * @param {string} [connectionEnvelope.relayArmUri] The ARM URI to the Service + * Bus relay. + * + * @param {string} [connectionEnvelope.hostname] The hostname of the endpoint. + * + * @param {number} [connectionEnvelope.port] The port of the endpoint. + * + * @param {string} [connectionEnvelope.sendKeyName] The name of the Service Bus + * key which has Send permissions. This is used to authenticate to Service Bus. + * + * @param {string} [connectionEnvelope.sendKeyValue] The value of the Service + * Bus key. This is used to authenticate to Service Bus. In ARM this key will + * not be returned + * normally, use the POST /listKeys API instead. + * + * @param {string} [connectionEnvelope.serviceBusSuffix] The suffix for the + * service bus endpoint. By default this is .servicebus.windows.net + * + * @param {string} [connectionEnvelope.kind] Kind of resource. + * + * @param {string} slot The name of the slot for the web app. + * + * @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 {HybridConnection} - 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. + * + * {HybridConnection} [result] - The deserialized result object if an error did not occur. + * See {@link HybridConnection} 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. + */ + createOrUpdateHybridConnectionSlot(resourceGroupName: string, name: string, namespaceName: string, relayName: string, connectionEnvelope: models.HybridConnection, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdateHybridConnectionSlot(resourceGroupName: string, name: string, namespaceName: string, relayName: string, connectionEnvelope: models.HybridConnection, slot: string, callback: ServiceCallback): void; + createOrUpdateHybridConnectionSlot(resourceGroupName: string, name: string, namespaceName: string, relayName: string, connectionEnvelope: models.HybridConnection, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Removes a Hybrid Connection from this site. + * + * Removes a Hybrid Connection from this site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @param {string} namespaceName The namespace for this hybrid connection. + * + * @param {string} relayName The relay name for this hybrid connection. + * + * @param {string} slot The name of the slot for the web app. + * + * @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. + */ + deleteHybridConnectionSlotWithHttpOperationResponse(resourceGroupName: string, name: string, namespaceName: string, relayName: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Removes a Hybrid Connection from this site. + * + * Removes a Hybrid Connection from this site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @param {string} namespaceName The namespace for this hybrid connection. + * + * @param {string} relayName The relay name for this hybrid connection. + * + * @param {string} slot The name of the slot for the web app. + * + * @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 {null} - 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. + * + * {null} [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. + */ + deleteHybridConnectionSlot(resourceGroupName: string, name: string, namespaceName: string, relayName: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteHybridConnectionSlot(resourceGroupName: string, name: string, namespaceName: string, relayName: string, slot: string, callback: ServiceCallback): void; + deleteHybridConnectionSlot(resourceGroupName: string, name: string, namespaceName: string, relayName: string, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Creates a new Hybrid Connection using a Service Bus relay. + * + * Creates a new Hybrid Connection using a Service Bus relay. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @param {string} namespaceName The namespace for this hybrid connection. + * + * @param {string} relayName The relay name for this hybrid connection. + * + * @param {object} connectionEnvelope The details of the hybrid connection. + * + * @param {string} [connectionEnvelope.serviceBusNamespace] The name of the + * Service Bus namespace. + * + * @param {string} [connectionEnvelope.relayName] The name of the Service Bus + * relay. + * + * @param {string} [connectionEnvelope.relayArmUri] The ARM URI to the Service + * Bus relay. + * + * @param {string} [connectionEnvelope.hostname] The hostname of the endpoint. + * + * @param {number} [connectionEnvelope.port] The port of the endpoint. + * + * @param {string} [connectionEnvelope.sendKeyName] The name of the Service Bus + * key which has Send permissions. This is used to authenticate to Service Bus. + * + * @param {string} [connectionEnvelope.sendKeyValue] The value of the Service + * Bus key. This is used to authenticate to Service Bus. In ARM this key will + * not be returned + * normally, use the POST /listKeys API instead. + * + * @param {string} [connectionEnvelope.serviceBusSuffix] The suffix for the + * service bus endpoint. By default this is .servicebus.windows.net + * + * @param {string} [connectionEnvelope.kind] Kind of resource. + * + * @param {string} slot The name of the slot for the web app. + * + * @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. + */ + updateHybridConnectionSlotWithHttpOperationResponse(resourceGroupName: string, name: string, namespaceName: string, relayName: string, connectionEnvelope: models.HybridConnection, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Creates a new Hybrid Connection using a Service Bus relay. + * + * Creates a new Hybrid Connection using a Service Bus relay. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @param {string} namespaceName The namespace for this hybrid connection. + * + * @param {string} relayName The relay name for this hybrid connection. + * + * @param {object} connectionEnvelope The details of the hybrid connection. + * + * @param {string} [connectionEnvelope.serviceBusNamespace] The name of the + * Service Bus namespace. + * + * @param {string} [connectionEnvelope.relayName] The name of the Service Bus + * relay. + * + * @param {string} [connectionEnvelope.relayArmUri] The ARM URI to the Service + * Bus relay. + * + * @param {string} [connectionEnvelope.hostname] The hostname of the endpoint. + * + * @param {number} [connectionEnvelope.port] The port of the endpoint. + * + * @param {string} [connectionEnvelope.sendKeyName] The name of the Service Bus + * key which has Send permissions. This is used to authenticate to Service Bus. + * + * @param {string} [connectionEnvelope.sendKeyValue] The value of the Service + * Bus key. This is used to authenticate to Service Bus. In ARM this key will + * not be returned + * normally, use the POST /listKeys API instead. + * + * @param {string} [connectionEnvelope.serviceBusSuffix] The suffix for the + * service bus endpoint. By default this is .servicebus.windows.net + * + * @param {string} [connectionEnvelope.kind] Kind of resource. + * + * @param {string} slot The name of the slot for the web app. + * + * @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 {HybridConnection} - 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. + * + * {HybridConnection} [result] - The deserialized result object if an error did not occur. + * See {@link HybridConnection} 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. + */ + updateHybridConnectionSlot(resourceGroupName: string, name: string, namespaceName: string, relayName: string, connectionEnvelope: models.HybridConnection, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + updateHybridConnectionSlot(resourceGroupName: string, name: string, namespaceName: string, relayName: string, connectionEnvelope: models.HybridConnection, slot: string, callback: ServiceCallback): void; + updateHybridConnectionSlot(resourceGroupName: string, name: string, namespaceName: string, relayName: string, connectionEnvelope: models.HybridConnection, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Gets the send key name and value for a Hybrid Connection. + * + * Gets the send key name and value for a Hybrid Connection. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @param {string} namespaceName The namespace for this hybrid connection. + * + * @param {string} relayName The relay name for this hybrid connection. + * + * @param {string} slot The name of the slot for the web app. + * + * @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. + */ + listHybridConnectionKeysSlotWithHttpOperationResponse(resourceGroupName: string, name: string, namespaceName: string, relayName: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets the send key name and value for a Hybrid Connection. + * + * Gets the send key name and value for a Hybrid Connection. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @param {string} namespaceName The namespace for this hybrid connection. + * + * @param {string} relayName The relay name for this hybrid connection. + * + * @param {string} slot The name of the slot for the web app. + * + * @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 {HybridConnectionKey} - 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. + * + * {HybridConnectionKey} [result] - The deserialized result object if an error did not occur. + * See {@link HybridConnectionKey} 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. + */ + listHybridConnectionKeysSlot(resourceGroupName: string, name: string, namespaceName: string, relayName: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listHybridConnectionKeysSlot(resourceGroupName: string, name: string, namespaceName: string, relayName: string, slot: string, callback: ServiceCallback): void; + listHybridConnectionKeysSlot(resourceGroupName: string, name: string, namespaceName: string, relayName: string, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Retrieves all Service Bus Hybrid Connections used by this Web App. + * + * Retrieves all Service Bus Hybrid Connections used by this Web App. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @param {string} slot The name of the slot for the web app. + * + * @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. + */ + listHybridConnectionsSlotWithHttpOperationResponse(resourceGroupName: string, name: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Retrieves all Service Bus Hybrid Connections used by this Web App. + * + * Retrieves all Service Bus Hybrid Connections used by this Web App. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @param {string} slot The name of the slot for the web app. + * + * @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 {HybridConnection} - 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. + * + * {HybridConnection} [result] - The deserialized result object if an error did not occur. + * See {@link HybridConnection} 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. + */ + listHybridConnectionsSlot(resourceGroupName: string, name: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listHybridConnectionsSlot(resourceGroupName: string, name: string, slot: string, callback: ServiceCallback): void; + listHybridConnectionsSlot(resourceGroupName: string, name: string, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Gets hybrid connections configured for an app (or deployment slot, + * if specified). + * + * Gets hybrid connections configured for an app (or deployment slot, if + * specified). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will get hybrid connections for the production slot. + * + * @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. + */ + listRelayServiceConnectionsSlotWithHttpOperationResponse(resourceGroupName: string, name: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets hybrid connections configured for an app (or deployment slot, + * if specified). + * + * Gets hybrid connections configured for an app (or deployment slot, if + * specified). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will get hybrid connections for the production slot. + * + * @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 {RelayServiceConnectionEntity} - 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. + * + * {RelayServiceConnectionEntity} [result] - The deserialized result object if an error did not occur. + * See {@link RelayServiceConnectionEntity} 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. + */ + listRelayServiceConnectionsSlot(resourceGroupName: string, name: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listRelayServiceConnectionsSlot(resourceGroupName: string, name: string, slot: string, callback: ServiceCallback): void; + listRelayServiceConnectionsSlot(resourceGroupName: string, name: string, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Gets a hybrid connection configuration by its name. + * + * Gets a hybrid connection configuration by its name. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} entityName Name of the hybrid connection. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will get a hybrid connection for the production slot. + * + * @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. + */ + getRelayServiceConnectionSlotWithHttpOperationResponse(resourceGroupName: string, name: string, entityName: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets a hybrid connection configuration by its name. + * + * Gets a hybrid connection configuration by its name. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} entityName Name of the hybrid connection. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will get a hybrid connection for the production slot. + * + * @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 {RelayServiceConnectionEntity} - 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. + * + * {RelayServiceConnectionEntity} [result] - The deserialized result object if an error did not occur. + * See {@link RelayServiceConnectionEntity} 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. + */ + getRelayServiceConnectionSlot(resourceGroupName: string, name: string, entityName: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getRelayServiceConnectionSlot(resourceGroupName: string, name: string, entityName: string, slot: string, callback: ServiceCallback): void; + getRelayServiceConnectionSlot(resourceGroupName: string, name: string, entityName: string, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Creates a new hybrid connection configuration (PUT), or updates an + * existing one (PATCH). + * + * Creates a new hybrid connection configuration (PUT), or updates an existing + * one (PATCH). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} entityName Name of the hybrid connection configuration. + * + * @param {object} connectionEnvelope Details of the hybrid connection + * configuration. + * + * @param {string} [connectionEnvelope.entityName] + * + * @param {string} [connectionEnvelope.entityConnectionString] + * + * @param {string} [connectionEnvelope.resourceType] + * + * @param {string} [connectionEnvelope.resourceConnectionString] + * + * @param {string} [connectionEnvelope.hostname] + * + * @param {number} [connectionEnvelope.port] + * + * @param {string} [connectionEnvelope.biztalkUri] + * + * @param {string} [connectionEnvelope.kind] Kind of resource. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will create or update a hybrid connection for the + * production slot. + * + * @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. + */ + createOrUpdateRelayServiceConnectionSlotWithHttpOperationResponse(resourceGroupName: string, name: string, entityName: string, connectionEnvelope: models.RelayServiceConnectionEntity, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Creates a new hybrid connection configuration (PUT), or updates an + * existing one (PATCH). + * + * Creates a new hybrid connection configuration (PUT), or updates an existing + * one (PATCH). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} entityName Name of the hybrid connection configuration. + * + * @param {object} connectionEnvelope Details of the hybrid connection + * configuration. + * + * @param {string} [connectionEnvelope.entityName] + * + * @param {string} [connectionEnvelope.entityConnectionString] + * + * @param {string} [connectionEnvelope.resourceType] + * + * @param {string} [connectionEnvelope.resourceConnectionString] + * + * @param {string} [connectionEnvelope.hostname] + * + * @param {number} [connectionEnvelope.port] + * + * @param {string} [connectionEnvelope.biztalkUri] + * + * @param {string} [connectionEnvelope.kind] Kind of resource. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will create or update a hybrid connection for the + * production slot. + * + * @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 {RelayServiceConnectionEntity} - 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. + * + * {RelayServiceConnectionEntity} [result] - The deserialized result object if an error did not occur. + * See {@link RelayServiceConnectionEntity} 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. + */ + createOrUpdateRelayServiceConnectionSlot(resourceGroupName: string, name: string, entityName: string, connectionEnvelope: models.RelayServiceConnectionEntity, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdateRelayServiceConnectionSlot(resourceGroupName: string, name: string, entityName: string, connectionEnvelope: models.RelayServiceConnectionEntity, slot: string, callback: ServiceCallback): void; + createOrUpdateRelayServiceConnectionSlot(resourceGroupName: string, name: string, entityName: string, connectionEnvelope: models.RelayServiceConnectionEntity, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Deletes a relay service connection by its name. + * + * Deletes a relay service connection by its name. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} entityName Name of the hybrid connection configuration. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will delete a hybrid connection for the production slot. + * + * @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. + */ + deleteRelayServiceConnectionSlotWithHttpOperationResponse(resourceGroupName: string, name: string, entityName: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Deletes a relay service connection by its name. + * + * Deletes a relay service connection by its name. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} entityName Name of the hybrid connection configuration. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will delete a hybrid connection for the production slot. + * + * @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 {null} - 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. + * + * {null} [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. + */ + deleteRelayServiceConnectionSlot(resourceGroupName: string, name: string, entityName: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteRelayServiceConnectionSlot(resourceGroupName: string, name: string, entityName: string, slot: string, callback: ServiceCallback): void; + deleteRelayServiceConnectionSlot(resourceGroupName: string, name: string, entityName: string, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Creates a new hybrid connection configuration (PUT), or updates an + * existing one (PATCH). + * + * Creates a new hybrid connection configuration (PUT), or updates an existing + * one (PATCH). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} entityName Name of the hybrid connection configuration. + * + * @param {object} connectionEnvelope Details of the hybrid connection + * configuration. + * + * @param {string} [connectionEnvelope.entityName] + * + * @param {string} [connectionEnvelope.entityConnectionString] + * + * @param {string} [connectionEnvelope.resourceType] + * + * @param {string} [connectionEnvelope.resourceConnectionString] + * + * @param {string} [connectionEnvelope.hostname] + * + * @param {number} [connectionEnvelope.port] + * + * @param {string} [connectionEnvelope.biztalkUri] + * + * @param {string} [connectionEnvelope.kind] Kind of resource. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will create or update a hybrid connection for the + * production slot. + * + * @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. + */ + updateRelayServiceConnectionSlotWithHttpOperationResponse(resourceGroupName: string, name: string, entityName: string, connectionEnvelope: models.RelayServiceConnectionEntity, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Creates a new hybrid connection configuration (PUT), or updates an + * existing one (PATCH). + * + * Creates a new hybrid connection configuration (PUT), or updates an existing + * one (PATCH). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} entityName Name of the hybrid connection configuration. + * + * @param {object} connectionEnvelope Details of the hybrid connection + * configuration. + * + * @param {string} [connectionEnvelope.entityName] + * + * @param {string} [connectionEnvelope.entityConnectionString] + * + * @param {string} [connectionEnvelope.resourceType] + * + * @param {string} [connectionEnvelope.resourceConnectionString] + * + * @param {string} [connectionEnvelope.hostname] + * + * @param {number} [connectionEnvelope.port] + * + * @param {string} [connectionEnvelope.biztalkUri] + * + * @param {string} [connectionEnvelope.kind] Kind of resource. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will create or update a hybrid connection for the + * production slot. + * + * @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 {RelayServiceConnectionEntity} - 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. + * + * {RelayServiceConnectionEntity} [result] - The deserialized result object if an error did not occur. + * See {@link RelayServiceConnectionEntity} 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. + */ + updateRelayServiceConnectionSlot(resourceGroupName: string, name: string, entityName: string, connectionEnvelope: models.RelayServiceConnectionEntity, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + updateRelayServiceConnectionSlot(resourceGroupName: string, name: string, entityName: string, connectionEnvelope: models.RelayServiceConnectionEntity, slot: string, callback: ServiceCallback): void; + updateRelayServiceConnectionSlot(resourceGroupName: string, name: string, entityName: string, connectionEnvelope: models.RelayServiceConnectionEntity, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Gets all scale-out instances of an app. + * + * Gets all scale-out instances of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API gets the production slot instances. + * + * @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. + */ + listInstanceIdentifiersSlotWithHttpOperationResponse(resourceGroupName: string, name: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets all scale-out instances of an app. + * + * Gets all scale-out instances of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API gets the production slot instances. + * + * @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 {WebAppInstanceCollection} - 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. + * + * {WebAppInstanceCollection} [result] - The deserialized result object if an error did not occur. + * See {@link WebAppInstanceCollection} 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. + */ + listInstanceIdentifiersSlot(resourceGroupName: string, name: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listInstanceIdentifiersSlot(resourceGroupName: string, name: string, slot: string, callback: ServiceCallback): void; + listInstanceIdentifiersSlot(resourceGroupName: string, name: string, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Get the status of the last MSDeploy operation. + * + * Get the status of the last MSDeploy operation. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {string} slot Name of web app slot. If not specified then will + * default to production slot. + * + * @param {string} instanceId ID of web app instance. + * + * @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. + */ + getInstanceMsDeployStatusSlotWithHttpOperationResponse(resourceGroupName: string, name: string, slot: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get the status of the last MSDeploy operation. + * + * Get the status of the last MSDeploy operation. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {string} slot Name of web app slot. If not specified then will + * default to production slot. + * + * @param {string} instanceId ID of web app instance. + * + * @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 {MSDeployStatus} - 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. + * + * {MSDeployStatus} [result] - The deserialized result object if an error did not occur. + * See {@link MSDeployStatus} 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. + */ + getInstanceMsDeployStatusSlot(resourceGroupName: string, name: string, slot: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getInstanceMsDeployStatusSlot(resourceGroupName: string, name: string, slot: string, instanceId: string, callback: ServiceCallback): void; + getInstanceMsDeployStatusSlot(resourceGroupName: string, name: string, slot: string, instanceId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Invoke the MSDeploy web app extension. + * + * Invoke the MSDeploy web app extension. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {string} slot Name of web app slot. If not specified then will + * default to production slot. + * + * @param {string} instanceId ID of web app instance. + * + * @param {object} mSDeploy Details of MSDeploy operation + * + * @param {string} [mSDeploy.packageUri] Package URI + * + * @param {string} [mSDeploy.connectionString] SQL Connection String + * + * @param {string} [mSDeploy.dbType] Database Type + * + * @param {string} [mSDeploy.setParametersXmlFileUri] URI of MSDeploy + * Parameters file. Must not be set if SetParameters is used. + * + * @param {object} [mSDeploy.setParameters] MSDeploy Parameters. Must not be + * set if SetParametersXmlFileUri is used. + * + * @param {boolean} [mSDeploy.skipAppData] Controls whether the MSDeploy + * operation skips the App_Data directory. + * If set to true, the existing App_Data directory on the + * destination + * will not be deleted, and any App_Data directory in the source will be + * ignored. + * Setting is false by default. + * + * @param {boolean} [mSDeploy.appOffline] Sets the AppOffline rule while the + * MSDeploy operation executes. + * Setting is false by default. + * + * @param {string} [mSDeploy.kind] Kind of resource. + * + * @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. + */ + createInstanceMSDeployOperationSlotWithHttpOperationResponse(resourceGroupName: string, name: string, slot: string, instanceId: string, mSDeploy: models.MSDeploy, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Invoke the MSDeploy web app extension. + * + * Invoke the MSDeploy web app extension. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {string} slot Name of web app slot. If not specified then will + * default to production slot. + * + * @param {string} instanceId ID of web app instance. + * + * @param {object} mSDeploy Details of MSDeploy operation + * + * @param {string} [mSDeploy.packageUri] Package URI + * + * @param {string} [mSDeploy.connectionString] SQL Connection String + * + * @param {string} [mSDeploy.dbType] Database Type + * + * @param {string} [mSDeploy.setParametersXmlFileUri] URI of MSDeploy + * Parameters file. Must not be set if SetParameters is used. + * + * @param {object} [mSDeploy.setParameters] MSDeploy Parameters. Must not be + * set if SetParametersXmlFileUri is used. + * + * @param {boolean} [mSDeploy.skipAppData] Controls whether the MSDeploy + * operation skips the App_Data directory. + * If set to true, the existing App_Data directory on the + * destination + * will not be deleted, and any App_Data directory in the source will be + * ignored. + * Setting is false by default. + * + * @param {boolean} [mSDeploy.appOffline] Sets the AppOffline rule while the + * MSDeploy operation executes. + * Setting is false by default. + * + * @param {string} [mSDeploy.kind] Kind of resource. + * + * @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 {MSDeployStatus} - 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. + * + * {MSDeployStatus} [result] - The deserialized result object if an error did not occur. + * See {@link MSDeployStatus} 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. + */ + createInstanceMSDeployOperationSlot(resourceGroupName: string, name: string, slot: string, instanceId: string, mSDeploy: models.MSDeploy, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createInstanceMSDeployOperationSlot(resourceGroupName: string, name: string, slot: string, instanceId: string, mSDeploy: models.MSDeploy, callback: ServiceCallback): void; + createInstanceMSDeployOperationSlot(resourceGroupName: string, name: string, slot: string, instanceId: string, mSDeploy: models.MSDeploy, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Get the MSDeploy Log for the last MSDeploy operation. + * + * Get the MSDeploy Log for the last MSDeploy operation. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {string} slot Name of web app slot. If not specified then will + * default to production slot. + * + * @param {string} instanceId ID of web app instance. + * + * @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. + */ + getInstanceMSDeployLogSlotWithHttpOperationResponse(resourceGroupName: string, name: string, slot: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get the MSDeploy Log for the last MSDeploy operation. + * + * Get the MSDeploy Log for the last MSDeploy operation. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {string} slot Name of web app slot. If not specified then will + * default to production slot. + * + * @param {string} instanceId ID of web app instance. + * + * @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 {MSDeployLog} - 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. + * + * {MSDeployLog} [result] - The deserialized result object if an error did not occur. + * See {@link MSDeployLog} 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. + */ + getInstanceMSDeployLogSlot(resourceGroupName: string, name: string, slot: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getInstanceMSDeployLogSlot(resourceGroupName: string, name: string, slot: string, instanceId: string, callback: ServiceCallback): void; + getInstanceMSDeployLogSlot(resourceGroupName: string, name: string, slot: string, instanceId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Get list of processes for a web site, or a deployment slot, or for + * a specific scaled-out instance in a web site. + * + * Get list of processes for a web site, or a deployment slot, or for a + * specific scaled-out instance in a web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API returns deployments for the production slot. + * + * @param {string} instanceId ID of a specific scaled-out instance. This is the + * value of the name property in the JSON response from "GET + * api/sites/{siteName}/instances". + * + * @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. + */ + listInstanceProcessesSlotWithHttpOperationResponse(resourceGroupName: string, name: string, slot: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get list of processes for a web site, or a deployment slot, or for + * a specific scaled-out instance in a web site. + * + * Get list of processes for a web site, or a deployment slot, or for a + * specific scaled-out instance in a web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API returns deployments for the production slot. + * + * @param {string} instanceId ID of a specific scaled-out instance. This is the + * value of the name property in the JSON response from "GET + * api/sites/{siteName}/instances". + * + * @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 {ProcessInfoCollection} - 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. + * + * {ProcessInfoCollection} [result] - The deserialized result object if an error did not occur. + * See {@link ProcessInfoCollection} 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. + */ + listInstanceProcessesSlot(resourceGroupName: string, name: string, slot: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listInstanceProcessesSlot(resourceGroupName: string, name: string, slot: string, instanceId: string, callback: ServiceCallback): void; + listInstanceProcessesSlot(resourceGroupName: string, name: string, slot: string, instanceId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Get process information by its ID for a specific scaled-out + * instance in a web site. + * + * Get process information by its ID for a specific scaled-out instance in a + * web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API returns deployments for the production slot. + * + * @param {string} instanceId ID of a specific scaled-out instance. This is the + * value of the name property in the JSON response from "GET + * api/sites/{siteName}/instances". + * + * @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. + */ + getInstanceProcessSlotWithHttpOperationResponse(resourceGroupName: string, name: string, processId: string, slot: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get process information by its ID for a specific scaled-out + * instance in a web site. + * + * Get process information by its ID for a specific scaled-out instance in a + * web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API returns deployments for the production slot. + * + * @param {string} instanceId ID of a specific scaled-out instance. This is the + * value of the name property in the JSON response from "GET + * api/sites/{siteName}/instances". + * + * @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 {ProcessInfo} - 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. + * + * {ProcessInfo} [result] - The deserialized result object if an error did not occur. + * See {@link ProcessInfo} 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. + */ + getInstanceProcessSlot(resourceGroupName: string, name: string, processId: string, slot: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getInstanceProcessSlot(resourceGroupName: string, name: string, processId: string, slot: string, instanceId: string, callback: ServiceCallback): void; + getInstanceProcessSlot(resourceGroupName: string, name: string, processId: string, slot: string, instanceId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Terminate a process by its ID for a web site, or a deployment slot, + * or specific scaled-out instance in a web site. + * + * Terminate a process by its ID for a web site, or a deployment slot, or + * specific scaled-out instance in a web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API returns deployments for the production slot. + * + * @param {string} instanceId ID of a specific scaled-out instance. This is the + * value of the name property in the JSON response from "GET + * api/sites/{siteName}/instances". + * + * @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. + */ + deleteInstanceProcessSlotWithHttpOperationResponse(resourceGroupName: string, name: string, processId: string, slot: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Terminate a process by its ID for a web site, or a deployment slot, + * or specific scaled-out instance in a web site. + * + * Terminate a process by its ID for a web site, or a deployment slot, or + * specific scaled-out instance in a web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API returns deployments for the production slot. + * + * @param {string} instanceId ID of a specific scaled-out instance. This is the + * value of the name property in the JSON response from "GET + * api/sites/{siteName}/instances". + * + * @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 {null} - 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. + * + * {null} [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. + */ + deleteInstanceProcessSlot(resourceGroupName: string, name: string, processId: string, slot: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteInstanceProcessSlot(resourceGroupName: string, name: string, processId: string, slot: string, instanceId: string, callback: ServiceCallback): void; + deleteInstanceProcessSlot(resourceGroupName: string, name: string, processId: string, slot: string, instanceId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Get a memory dump of a process by its ID for a specific scaled-out + * instance in a web site. + * + * Get a memory dump of a process by its ID for a specific scaled-out instance + * in a web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API returns deployments for the production slot. + * + * @param {string} instanceId ID of a specific scaled-out instance. This is the + * value of the name property in the JSON response from "GET + * api/sites/{siteName}/instances". + * + * @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. + */ + getInstanceProcessDumpSlotWithHttpOperationResponse(resourceGroupName: string, name: string, processId: string, slot: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get a memory dump of a process by its ID for a specific scaled-out + * instance in a web site. + * + * Get a memory dump of a process by its ID for a specific scaled-out instance + * in a web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API returns deployments for the production slot. + * + * @param {string} instanceId ID of a specific scaled-out instance. This is the + * value of the name property in the JSON response from "GET + * api/sites/{siteName}/instances". + * + * @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 {Object} - 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. + * + * {Object} [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. + */ + getInstanceProcessDumpSlot(resourceGroupName: string, name: string, processId: string, slot: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getInstanceProcessDumpSlot(resourceGroupName: string, name: string, processId: string, slot: string, instanceId: string, callback: ServiceCallback): void; + getInstanceProcessDumpSlot(resourceGroupName: string, name: string, processId: string, slot: string, instanceId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary List module information for a process by its ID for a specific + * scaled-out instance in a web site. + * + * List module information for a process by its ID for a specific scaled-out + * instance in a web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API returns deployments for the production slot. + * + * @param {string} instanceId ID of a specific scaled-out instance. This is the + * value of the name property in the JSON response from "GET + * api/sites/{siteName}/instances". + * + * @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. + */ + listInstanceProcessModulesSlotWithHttpOperationResponse(resourceGroupName: string, name: string, processId: string, slot: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary List module information for a process by its ID for a specific + * scaled-out instance in a web site. + * + * List module information for a process by its ID for a specific scaled-out + * instance in a web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API returns deployments for the production slot. + * + * @param {string} instanceId ID of a specific scaled-out instance. This is the + * value of the name property in the JSON response from "GET + * api/sites/{siteName}/instances". + * + * @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 {ProcessModuleInfoCollection} - 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. + * + * {ProcessModuleInfoCollection} [result] - The deserialized result object if an error did not occur. + * See {@link ProcessModuleInfoCollection} 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. + */ + listInstanceProcessModulesSlot(resourceGroupName: string, name: string, processId: string, slot: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listInstanceProcessModulesSlot(resourceGroupName: string, name: string, processId: string, slot: string, instanceId: string, callback: ServiceCallback): void; + listInstanceProcessModulesSlot(resourceGroupName: string, name: string, processId: string, slot: string, instanceId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Get process information by its ID for a specific scaled-out + * instance in a web site. + * + * Get process information by its ID for a specific scaled-out instance in a + * web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @param {string} baseAddress Module base address. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API returns deployments for the production slot. + * + * @param {string} instanceId ID of a specific scaled-out instance. This is the + * value of the name property in the JSON response from "GET + * api/sites/{siteName}/instances". + * + * @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. + */ + getInstanceProcessModuleSlotWithHttpOperationResponse(resourceGroupName: string, name: string, processId: string, baseAddress: string, slot: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get process information by its ID for a specific scaled-out + * instance in a web site. + * + * Get process information by its ID for a specific scaled-out instance in a + * web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @param {string} baseAddress Module base address. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API returns deployments for the production slot. + * + * @param {string} instanceId ID of a specific scaled-out instance. This is the + * value of the name property in the JSON response from "GET + * api/sites/{siteName}/instances". + * + * @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 {ProcessModuleInfo} - 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. + * + * {ProcessModuleInfo} [result] - The deserialized result object if an error did not occur. + * See {@link ProcessModuleInfo} 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. + */ + getInstanceProcessModuleSlot(resourceGroupName: string, name: string, processId: string, baseAddress: string, slot: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getInstanceProcessModuleSlot(resourceGroupName: string, name: string, processId: string, baseAddress: string, slot: string, instanceId: string, callback: ServiceCallback): void; + getInstanceProcessModuleSlot(resourceGroupName: string, name: string, processId: string, baseAddress: string, slot: string, instanceId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary List the threads in a process by its ID for a specific scaled-out + * instance in a web site. + * + * List the threads in a process by its ID for a specific scaled-out instance + * in a web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API returns deployments for the production slot. + * + * @param {string} instanceId ID of a specific scaled-out instance. This is the + * value of the name property in the JSON response from "GET + * api/sites/{siteName}/instances". + * + * @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. + */ + listInstanceProcessThreadsSlotWithHttpOperationResponse(resourceGroupName: string, name: string, processId: string, slot: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary List the threads in a process by its ID for a specific scaled-out + * instance in a web site. + * + * List the threads in a process by its ID for a specific scaled-out instance + * in a web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API returns deployments for the production slot. + * + * @param {string} instanceId ID of a specific scaled-out instance. This is the + * value of the name property in the JSON response from "GET + * api/sites/{siteName}/instances". + * + * @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 {ProcessThreadInfoCollection} - 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. + * + * {ProcessThreadInfoCollection} [result] - The deserialized result object if an error did not occur. + * See {@link ProcessThreadInfoCollection} 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. + */ + listInstanceProcessThreadsSlot(resourceGroupName: string, name: string, processId: string, slot: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listInstanceProcessThreadsSlot(resourceGroupName: string, name: string, processId: string, slot: string, instanceId: string, callback: ServiceCallback): void; + listInstanceProcessThreadsSlot(resourceGroupName: string, name: string, processId: string, slot: string, instanceId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Get thread information by Thread ID for a specific process, in a + * specific scaled-out instance in a web site. + * + * Get thread information by Thread ID for a specific process, in a specific + * scaled-out instance in a web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @param {string} threadId TID. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API returns deployments for the production slot. + * + * @param {string} instanceId ID of a specific scaled-out instance. This is the + * value of the name property in the JSON response from "GET + * api/sites/{siteName}/instances". + * + * @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. + */ + getInstanceProcessThreadSlotWithHttpOperationResponse(resourceGroupName: string, name: string, processId: string, threadId: string, slot: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get thread information by Thread ID for a specific process, in a + * specific scaled-out instance in a web site. + * + * Get thread information by Thread ID for a specific process, in a specific + * scaled-out instance in a web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @param {string} threadId TID. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API returns deployments for the production slot. + * + * @param {string} instanceId ID of a specific scaled-out instance. This is the + * value of the name property in the JSON response from "GET + * api/sites/{siteName}/instances". + * + * @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 {ProcessThreadInfo} - 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. + * + * {ProcessThreadInfo} [result] - The deserialized result object if an error did not occur. + * See {@link ProcessThreadInfo} 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. + */ + getInstanceProcessThreadSlot(resourceGroupName: string, name: string, processId: string, threadId: string, slot: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getInstanceProcessThreadSlot(resourceGroupName: string, name: string, processId: string, threadId: string, slot: string, instanceId: string, callback: ServiceCallback): void; + getInstanceProcessThreadSlot(resourceGroupName: string, name: string, processId: string, threadId: string, slot: string, instanceId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Shows whether an app can be cloned to another resource group or + * subscription. + * + * Shows whether an app can be cloned to another resource group or + * subscription. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. By default, this API + * returns information on the production slot. + * + * @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. + */ + isCloneableSlotWithHttpOperationResponse(resourceGroupName: string, name: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Shows whether an app can be cloned to another resource group or + * subscription. + * + * Shows whether an app can be cloned to another resource group or + * subscription. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. By default, this API + * returns information on the production slot. + * + * @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 {SiteCloneability} - 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. + * + * {SiteCloneability} [result] - The deserialized result object if an error did not occur. + * See {@link SiteCloneability} 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. + */ + isCloneableSlot(resourceGroupName: string, name: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + isCloneableSlot(resourceGroupName: string, name: string, slot: string, callback: ServiceCallback): void; + isCloneableSlot(resourceGroupName: string, name: string, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary This is to allow calling via powershell and ARM template. + * + * This is to allow calling via powershell and ARM template. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will restore a backup of the production slot. + * + * @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. + */ + listSyncFunctionTriggersSlotWithHttpOperationResponse(resourceGroupName: string, name: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary This is to allow calling via powershell and ARM template. + * + * This is to allow calling via powershell and ARM template. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will restore a backup of the production slot. + * + * @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 {FunctionSecrets} - 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. + * + * {FunctionSecrets} [result] - The deserialized result object if an error did not occur. + * See {@link FunctionSecrets} 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. + */ + listSyncFunctionTriggersSlot(resourceGroupName: string, name: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listSyncFunctionTriggersSlot(resourceGroupName: string, name: string, slot: string, callback: ServiceCallback): void; + listSyncFunctionTriggersSlot(resourceGroupName: string, name: string, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Gets all metric definitions of an app (or deployment slot, if + * specified). + * + * Gets all metric definitions of an app (or deployment slot, if specified). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will get metric definitions of the production slot. + * + * @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. + */ + listMetricDefinitionsSlotWithHttpOperationResponse(resourceGroupName: string, name: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets all metric definitions of an app (or deployment slot, if + * specified). + * + * Gets all metric definitions of an app (or deployment slot, if specified). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will get metric definitions of the production slot. + * + * @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 {ResourceMetricDefinitionCollection} - 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. + * + * {ResourceMetricDefinitionCollection} [result] - The deserialized result object if an error did not occur. + * See {@link ResourceMetricDefinitionCollection} 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. + */ + listMetricDefinitionsSlot(resourceGroupName: string, name: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listMetricDefinitionsSlot(resourceGroupName: string, name: string, slot: string, callback: ServiceCallback): void; + listMetricDefinitionsSlot(resourceGroupName: string, name: string, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Gets performance metrics of an app (or deployment slot, if + * specified). + * + * Gets performance metrics of an app (or deployment slot, if specified). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will get metrics of the production slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {boolean} [options.details] Specify "true" to include metric details + * in the response. It is "false" by default. + * + * @param {string} [options.filter] Return only metrics specified in the filter + * (using OData syntax). For example: $filter=(name.value eq 'Metric1' or + * name.value eq 'Metric2') and startTime eq 2014-01-01T00:00:00Z and endTime + * eq 2014-12-31T23:59:59Z and timeGrain eq duration'[Hour|Minute|Day]'. + * + * @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. + */ + listMetricsSlotWithHttpOperationResponse(resourceGroupName: string, name: string, slot: string, options?: { details? : boolean, filter? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets performance metrics of an app (or deployment slot, if + * specified). + * + * Gets performance metrics of an app (or deployment slot, if specified). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will get metrics of the production slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {boolean} [options.details] Specify "true" to include metric details + * in the response. It is "false" by default. + * + * @param {string} [options.filter] Return only metrics specified in the filter + * (using OData syntax). For example: $filter=(name.value eq 'Metric1' or + * name.value eq 'Metric2') and startTime eq 2014-01-01T00:00:00Z and endTime + * eq 2014-12-31T23:59:59Z and timeGrain eq duration'[Hour|Minute|Day]'. + * + * @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 {ResourceMetricCollection} - 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. + * + * {ResourceMetricCollection} [result] - The deserialized result object if an error did not occur. + * See {@link ResourceMetricCollection} 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. + */ + listMetricsSlot(resourceGroupName: string, name: string, slot: string, options?: { details? : boolean, filter? : string, customHeaders? : { [headerName: string]: string; } }): Promise; + listMetricsSlot(resourceGroupName: string, name: string, slot: string, callback: ServiceCallback): void; + listMetricsSlot(resourceGroupName: string, name: string, slot: string, options: { details? : boolean, filter? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Returns the status of MySql in app migration, if one is active, and + * whether or not MySql in app is enabled + * + * Returns the status of MySql in app migration, if one is active, and whether + * or not MySql in app is enabled + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {string} slot Name of the deployment slot. + * + * @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. + */ + getMigrateMySqlStatusSlotWithHttpOperationResponse(resourceGroupName: string, name: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Returns the status of MySql in app migration, if one is active, and + * whether or not MySql in app is enabled + * + * Returns the status of MySql in app migration, if one is active, and whether + * or not MySql in app is enabled + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {string} slot Name of the deployment slot. + * + * @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 {MigrateMySqlStatus} - 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. + * + * {MigrateMySqlStatus} [result] - The deserialized result object if an error did not occur. + * See {@link MigrateMySqlStatus} 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. + */ + getMigrateMySqlStatusSlot(resourceGroupName: string, name: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getMigrateMySqlStatusSlot(resourceGroupName: string, name: string, slot: string, callback: ServiceCallback): void; + getMigrateMySqlStatusSlot(resourceGroupName: string, name: string, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Gets all network features used by the app (or deployment slot, if + * specified). + * + * Gets all network features used by the app (or deployment slot, if + * specified). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} view The type of view. This can either be "summary" or + * "detailed". + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will get network features for the production slot. + * + * @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. + */ + listNetworkFeaturesSlotWithHttpOperationResponse(resourceGroupName: string, name: string, view: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets all network features used by the app (or deployment slot, if + * specified). + * + * Gets all network features used by the app (or deployment slot, if + * specified). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} view The type of view. This can either be "summary" or + * "detailed". + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will get network features for the production slot. + * + * @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 {NetworkFeatures} - 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. + * + * {NetworkFeatures} [result] - The deserialized result object if an error did not occur. + * See {@link NetworkFeatures} 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. + */ + listNetworkFeaturesSlot(resourceGroupName: string, name: string, view: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listNetworkFeaturesSlot(resourceGroupName: string, name: string, view: string, slot: string, callback: ServiceCallback): void; + listNetworkFeaturesSlot(resourceGroupName: string, name: string, view: string, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Start capturing network packets for the site. + * + * Start capturing network packets for the site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @param {string} slot The name of the slot for this web app. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.durationInSeconds] The duration to keep capturing + * in seconds. + * + * @param {number} [options.maxFrameLength] The maximum frame length in bytes + * (Optional). + * + * @param {string} [options.sasUrl] The Blob URL to store capture file. + * + * @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. + */ + startWebSiteNetworkTraceSlotWithHttpOperationResponse(resourceGroupName: string, name: string, slot: string, options?: { durationInSeconds? : number, maxFrameLength? : number, sasUrl? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Start capturing network packets for the site. + * + * Start capturing network packets for the site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @param {string} slot The name of the slot for this web app. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.durationInSeconds] The duration to keep capturing + * in seconds. + * + * @param {number} [options.maxFrameLength] The maximum frame length in bytes + * (Optional). + * + * @param {string} [options.sasUrl] The Blob URL to store capture file. + * + * @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 {String} - 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. + * + * {String} [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. + */ + startWebSiteNetworkTraceSlot(resourceGroupName: string, name: string, slot: string, options?: { durationInSeconds? : number, maxFrameLength? : number, sasUrl? : string, customHeaders? : { [headerName: string]: string; } }): Promise; + startWebSiteNetworkTraceSlot(resourceGroupName: string, name: string, slot: string, callback: ServiceCallback): void; + startWebSiteNetworkTraceSlot(resourceGroupName: string, name: string, slot: string, options: { durationInSeconds? : number, maxFrameLength? : number, sasUrl? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Stop ongoing capturing network packets for the site. + * + * Stop ongoing capturing network packets for the site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @param {string} slot The name of the slot for this web app. + * + * @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. + */ + stopWebSiteNetworkTraceSlotWithHttpOperationResponse(resourceGroupName: string, name: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Stop ongoing capturing network packets for the site. + * + * Stop ongoing capturing network packets for the site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @param {string} slot The name of the slot for this web app. + * + * @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 {String} - 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. + * + * {String} [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. + */ + stopWebSiteNetworkTraceSlot(resourceGroupName: string, name: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + stopWebSiteNetworkTraceSlot(resourceGroupName: string, name: string, slot: string, callback: ServiceCallback): void; + stopWebSiteNetworkTraceSlot(resourceGroupName: string, name: string, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Generates a new publishing password for an app (or deployment slot, + * if specified). + * + * Generates a new publishing password for an app (or deployment slot, if + * specified). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API generate a new publishing password for the production + * slot. + * + * @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. + */ + generateNewSitePublishingPasswordSlotWithHttpOperationResponse(resourceGroupName: string, name: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Generates a new publishing password for an app (or deployment slot, + * if specified). + * + * Generates a new publishing password for an app (or deployment slot, if + * specified). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API generate a new publishing password for the production + * slot. + * + * @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 {null} - 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. + * + * {null} [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. + */ + generateNewSitePublishingPasswordSlot(resourceGroupName: string, name: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + generateNewSitePublishingPasswordSlot(resourceGroupName: string, name: string, slot: string, callback: ServiceCallback): void; + generateNewSitePublishingPasswordSlot(resourceGroupName: string, name: string, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Gets perfmon counters for web app. + * + * Gets perfmon counters for web app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {string} slot Name of web app slot. If not specified then will + * default to production slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.filter] Return only usages/metrics specified in the + * filter. Filter conforms to odata syntax. Example: $filter=(startTime eq + * 2014-01-01T00:00:00Z and endTime eq 2014-12-31T23:59:59Z and timeGrain eq + * duration'[Hour|Minute|Day]'. + * + * @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. + */ + listPerfMonCountersSlotWithHttpOperationResponse(resourceGroupName: string, name: string, slot: string, options?: { filter? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets perfmon counters for web app. + * + * Gets perfmon counters for web app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {string} slot Name of web app slot. If not specified then will + * default to production slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.filter] Return only usages/metrics specified in the + * filter. Filter conforms to odata syntax. Example: $filter=(startTime eq + * 2014-01-01T00:00:00Z and endTime eq 2014-12-31T23:59:59Z and timeGrain eq + * duration'[Hour|Minute|Day]'. + * + * @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 {PerfMonCounterCollection} - 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. + * + * {PerfMonCounterCollection} [result] - The deserialized result object if an error did not occur. + * See {@link PerfMonCounterCollection} 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. + */ + listPerfMonCountersSlot(resourceGroupName: string, name: string, slot: string, options?: { filter? : string, customHeaders? : { [headerName: string]: string; } }): Promise; + listPerfMonCountersSlot(resourceGroupName: string, name: string, slot: string, callback: ServiceCallback): void; + listPerfMonCountersSlot(resourceGroupName: string, name: string, slot: string, options: { filter? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Gets web app's event logs. + * + * Gets web app's event logs. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {string} slot Name of web app slot. If not specified then will + * default to production slot. + * + * @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. + */ + getSitePhpErrorLogFlagSlotWithHttpOperationResponse(resourceGroupName: string, name: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets web app's event logs. + * + * Gets web app's event logs. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {string} slot Name of web app slot. If not specified then will + * default to production slot. + * + * @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 {SitePhpErrorLogFlag} - 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. + * + * {SitePhpErrorLogFlag} [result] - The deserialized result object if an error did not occur. + * See {@link SitePhpErrorLogFlag} 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. + */ + getSitePhpErrorLogFlagSlot(resourceGroupName: string, name: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getSitePhpErrorLogFlagSlot(resourceGroupName: string, name: string, slot: string, callback: ServiceCallback): void; + getSitePhpErrorLogFlagSlot(resourceGroupName: string, name: string, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Gets the premier add-ons of an app. + * + * Gets the premier add-ons of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will get the premier add-ons for the production slot. + * + * @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. + */ + listPremierAddOnsSlotWithHttpOperationResponse(resourceGroupName: string, name: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets the premier add-ons of an app. + * + * Gets the premier add-ons of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will get the premier add-ons for the production slot. + * + * @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 {PremierAddOn} - 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. + * + * {PremierAddOn} [result] - The deserialized result object if an error did not occur. + * See {@link PremierAddOn} 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. + */ + listPremierAddOnsSlot(resourceGroupName: string, name: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listPremierAddOnsSlot(resourceGroupName: string, name: string, slot: string, callback: ServiceCallback): void; + listPremierAddOnsSlot(resourceGroupName: string, name: string, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Gets a named add-on of an app. + * + * Gets a named add-on of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} premierAddOnName Add-on name. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will get the named add-on for the production slot. + * + * @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. + */ + getPremierAddOnSlotWithHttpOperationResponse(resourceGroupName: string, name: string, premierAddOnName: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets a named add-on of an app. + * + * Gets a named add-on of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} premierAddOnName Add-on name. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will get the named add-on for the production slot. + * + * @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 {PremierAddOn} - 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. + * + * {PremierAddOn} [result] - The deserialized result object if an error did not occur. + * See {@link PremierAddOn} 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. + */ + getPremierAddOnSlot(resourceGroupName: string, name: string, premierAddOnName: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getPremierAddOnSlot(resourceGroupName: string, name: string, premierAddOnName: string, slot: string, callback: ServiceCallback): void; + getPremierAddOnSlot(resourceGroupName: string, name: string, premierAddOnName: string, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Updates a named add-on of an app. + * + * Updates a named add-on of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} premierAddOnName Add-on name. + * + * @param {object} premierAddOn A JSON representation of the edited premier + * add-on. + * + * @param {string} [premierAddOn.sku] Premier add on SKU. + * + * @param {string} [premierAddOn.product] Premier add on Product. + * + * @param {string} [premierAddOn.vendor] Premier add on Vendor. + * + * @param {string} [premierAddOn.marketplacePublisher] Premier add on + * Marketplace publisher. + * + * @param {string} [premierAddOn.marketplaceOffer] Premier add on Marketplace + * offer. + * + * @param {string} [premierAddOn.kind] Kind of resource. + * + * @param {string} premierAddOn.location Resource Location. + * + * @param {object} [premierAddOn.tags] Resource tags. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will update the named add-on for the production slot. + * + * @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. + */ + addPremierAddOnSlotWithHttpOperationResponse(resourceGroupName: string, name: string, premierAddOnName: string, premierAddOn: models.PremierAddOn, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Updates a named add-on of an app. + * + * Updates a named add-on of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} premierAddOnName Add-on name. + * + * @param {object} premierAddOn A JSON representation of the edited premier + * add-on. + * + * @param {string} [premierAddOn.sku] Premier add on SKU. + * + * @param {string} [premierAddOn.product] Premier add on Product. + * + * @param {string} [premierAddOn.vendor] Premier add on Vendor. + * + * @param {string} [premierAddOn.marketplacePublisher] Premier add on + * Marketplace publisher. + * + * @param {string} [premierAddOn.marketplaceOffer] Premier add on Marketplace + * offer. + * + * @param {string} [premierAddOn.kind] Kind of resource. + * + * @param {string} premierAddOn.location Resource Location. + * + * @param {object} [premierAddOn.tags] Resource tags. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will update the named add-on for the production slot. + * + * @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 {PremierAddOn} - 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. + * + * {PremierAddOn} [result] - The deserialized result object if an error did not occur. + * See {@link PremierAddOn} 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. + */ + addPremierAddOnSlot(resourceGroupName: string, name: string, premierAddOnName: string, premierAddOn: models.PremierAddOn, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + addPremierAddOnSlot(resourceGroupName: string, name: string, premierAddOnName: string, premierAddOn: models.PremierAddOn, slot: string, callback: ServiceCallback): void; + addPremierAddOnSlot(resourceGroupName: string, name: string, premierAddOnName: string, premierAddOn: models.PremierAddOn, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Delete a premier add-on from an app. + * + * Delete a premier add-on from an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} premierAddOnName Add-on name. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will delete the named add-on for the production slot. + * + * @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. + */ + deletePremierAddOnSlotWithHttpOperationResponse(resourceGroupName: string, name: string, premierAddOnName: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Delete a premier add-on from an app. + * + * Delete a premier add-on from an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} premierAddOnName Add-on name. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will delete the named add-on for the production slot. + * + * @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 {null} - 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. + * + * {null} [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. + */ + deletePremierAddOnSlot(resourceGroupName: string, name: string, premierAddOnName: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deletePremierAddOnSlot(resourceGroupName: string, name: string, premierAddOnName: string, slot: string, callback: ServiceCallback): void; + deletePremierAddOnSlot(resourceGroupName: string, name: string, premierAddOnName: string, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Updates a named add-on of an app. + * + * Updates a named add-on of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} premierAddOnName Add-on name. + * + * @param {object} premierAddOn A JSON representation of the edited premier + * add-on. + * + * @param {string} [premierAddOn.sku] Premier add on SKU. + * + * @param {string} [premierAddOn.product] Premier add on Product. + * + * @param {string} [premierAddOn.vendor] Premier add on Vendor. + * + * @param {string} [premierAddOn.marketplacePublisher] Premier add on + * Marketplace publisher. + * + * @param {string} [premierAddOn.marketplaceOffer] Premier add on Marketplace + * offer. + * + * @param {string} [premierAddOn.kind] Kind of resource. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will update the named add-on for the production slot. + * + * @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. + */ + updatePremierAddOnSlotWithHttpOperationResponse(resourceGroupName: string, name: string, premierAddOnName: string, premierAddOn: models.PremierAddOnPatchResource, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Updates a named add-on of an app. + * + * Updates a named add-on of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} premierAddOnName Add-on name. + * + * @param {object} premierAddOn A JSON representation of the edited premier + * add-on. + * + * @param {string} [premierAddOn.sku] Premier add on SKU. + * + * @param {string} [premierAddOn.product] Premier add on Product. + * + * @param {string} [premierAddOn.vendor] Premier add on Vendor. + * + * @param {string} [premierAddOn.marketplacePublisher] Premier add on + * Marketplace publisher. + * + * @param {string} [premierAddOn.marketplaceOffer] Premier add on Marketplace + * offer. + * + * @param {string} [premierAddOn.kind] Kind of resource. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will update the named add-on for the production slot. + * + * @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 {PremierAddOn} - 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. + * + * {PremierAddOn} [result] - The deserialized result object if an error did not occur. + * See {@link PremierAddOn} 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. + */ + updatePremierAddOnSlot(resourceGroupName: string, name: string, premierAddOnName: string, premierAddOn: models.PremierAddOnPatchResource, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + updatePremierAddOnSlot(resourceGroupName: string, name: string, premierAddOnName: string, premierAddOn: models.PremierAddOnPatchResource, slot: string, callback: ServiceCallback): void; + updatePremierAddOnSlot(resourceGroupName: string, name: string, premierAddOnName: string, premierAddOn: models.PremierAddOnPatchResource, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Gets data around private site access enablement and authorized + * Virtual Networks that can access the site. + * + * Gets data around private site access enablement and authorized Virtual + * Networks that can access the site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @param {string} slot The name of the slot for the web app. + * + * @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. + */ + getPrivateAccessSlotWithHttpOperationResponse(resourceGroupName: string, name: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets data around private site access enablement and authorized + * Virtual Networks that can access the site. + * + * Gets data around private site access enablement and authorized Virtual + * Networks that can access the site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @param {string} slot The name of the slot for the web app. + * + * @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 {PrivateAccess} - 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. + * + * {PrivateAccess} [result] - The deserialized result object if an error did not occur. + * See {@link PrivateAccess} 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. + */ + getPrivateAccessSlot(resourceGroupName: string, name: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getPrivateAccessSlot(resourceGroupName: string, name: string, slot: string, callback: ServiceCallback): void; + getPrivateAccessSlot(resourceGroupName: string, name: string, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Sets data around private site access enablement and authorized + * Virtual Networks that can access the site. + * + * Sets data around private site access enablement and authorized Virtual + * Networks that can access the site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @param {object} access The information for the private access + * + * @param {boolean} [access.enabled] Whether private access is enabled or not. + * + * @param {array} [access.virtualNetworks] The Virtual Networks (and subnets) + * allowed to access the site privately. + * + * @param {string} [access.kind] Kind of resource. + * + * @param {string} slot The name of the slot for the web app. + * + * @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. + */ + putPrivateAccessVnetSlotWithHttpOperationResponse(resourceGroupName: string, name: string, access: models.PrivateAccess, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Sets data around private site access enablement and authorized + * Virtual Networks that can access the site. + * + * Sets data around private site access enablement and authorized Virtual + * Networks that can access the site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @param {object} access The information for the private access + * + * @param {boolean} [access.enabled] Whether private access is enabled or not. + * + * @param {array} [access.virtualNetworks] The Virtual Networks (and subnets) + * allowed to access the site privately. + * + * @param {string} [access.kind] Kind of resource. + * + * @param {string} slot The name of the slot for the web app. + * + * @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 {PrivateAccess} - 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. + * + * {PrivateAccess} [result] - The deserialized result object if an error did not occur. + * See {@link PrivateAccess} 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. + */ + putPrivateAccessVnetSlot(resourceGroupName: string, name: string, access: models.PrivateAccess, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + putPrivateAccessVnetSlot(resourceGroupName: string, name: string, access: models.PrivateAccess, slot: string, callback: ServiceCallback): void; + putPrivateAccessVnetSlot(resourceGroupName: string, name: string, access: models.PrivateAccess, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Get list of processes for a web site, or a deployment slot, or for + * a specific scaled-out instance in a web site. + * + * Get list of processes for a web site, or a deployment slot, or for a + * specific scaled-out instance in a web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API returns deployments for the production slot. + * + * @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. + */ + listProcessesSlotWithHttpOperationResponse(resourceGroupName: string, name: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get list of processes for a web site, or a deployment slot, or for + * a specific scaled-out instance in a web site. + * + * Get list of processes for a web site, or a deployment slot, or for a + * specific scaled-out instance in a web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API returns deployments for the production slot. + * + * @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 {ProcessInfoCollection} - 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. + * + * {ProcessInfoCollection} [result] - The deserialized result object if an error did not occur. + * See {@link ProcessInfoCollection} 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. + */ + listProcessesSlot(resourceGroupName: string, name: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listProcessesSlot(resourceGroupName: string, name: string, slot: string, callback: ServiceCallback): void; + listProcessesSlot(resourceGroupName: string, name: string, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Get process information by its ID for a specific scaled-out + * instance in a web site. + * + * Get process information by its ID for a specific scaled-out instance in a + * web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API returns deployments for the production slot. + * + * @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. + */ + getProcessSlotWithHttpOperationResponse(resourceGroupName: string, name: string, processId: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get process information by its ID for a specific scaled-out + * instance in a web site. + * + * Get process information by its ID for a specific scaled-out instance in a + * web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API returns deployments for the production slot. + * + * @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 {ProcessInfo} - 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. + * + * {ProcessInfo} [result] - The deserialized result object if an error did not occur. + * See {@link ProcessInfo} 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. + */ + getProcessSlot(resourceGroupName: string, name: string, processId: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getProcessSlot(resourceGroupName: string, name: string, processId: string, slot: string, callback: ServiceCallback): void; + getProcessSlot(resourceGroupName: string, name: string, processId: string, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Terminate a process by its ID for a web site, or a deployment slot, + * or specific scaled-out instance in a web site. + * + * Terminate a process by its ID for a web site, or a deployment slot, or + * specific scaled-out instance in a web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API returns deployments for the production slot. + * + * @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. + */ + deleteProcessSlotWithHttpOperationResponse(resourceGroupName: string, name: string, processId: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Terminate a process by its ID for a web site, or a deployment slot, + * or specific scaled-out instance in a web site. + * + * Terminate a process by its ID for a web site, or a deployment slot, or + * specific scaled-out instance in a web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API returns deployments for the production slot. + * + * @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 {null} - 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. + * + * {null} [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. + */ + deleteProcessSlot(resourceGroupName: string, name: string, processId: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteProcessSlot(resourceGroupName: string, name: string, processId: string, slot: string, callback: ServiceCallback): void; + deleteProcessSlot(resourceGroupName: string, name: string, processId: string, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Get a memory dump of a process by its ID for a specific scaled-out + * instance in a web site. + * + * Get a memory dump of a process by its ID for a specific scaled-out instance + * in a web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API returns deployments for the production slot. + * + * @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. + */ + getProcessDumpSlotWithHttpOperationResponse(resourceGroupName: string, name: string, processId: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get a memory dump of a process by its ID for a specific scaled-out + * instance in a web site. + * + * Get a memory dump of a process by its ID for a specific scaled-out instance + * in a web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API returns deployments for the production slot. + * + * @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 {Object} - 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. + * + * {Object} [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. + */ + getProcessDumpSlot(resourceGroupName: string, name: string, processId: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getProcessDumpSlot(resourceGroupName: string, name: string, processId: string, slot: string, callback: ServiceCallback): void; + getProcessDumpSlot(resourceGroupName: string, name: string, processId: string, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary List module information for a process by its ID for a specific + * scaled-out instance in a web site. + * + * List module information for a process by its ID for a specific scaled-out + * instance in a web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API returns deployments for the production slot. + * + * @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. + */ + listProcessModulesSlotWithHttpOperationResponse(resourceGroupName: string, name: string, processId: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary List module information for a process by its ID for a specific + * scaled-out instance in a web site. + * + * List module information for a process by its ID for a specific scaled-out + * instance in a web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API returns deployments for the production slot. + * + * @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 {ProcessModuleInfoCollection} - 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. + * + * {ProcessModuleInfoCollection} [result] - The deserialized result object if an error did not occur. + * See {@link ProcessModuleInfoCollection} 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. + */ + listProcessModulesSlot(resourceGroupName: string, name: string, processId: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listProcessModulesSlot(resourceGroupName: string, name: string, processId: string, slot: string, callback: ServiceCallback): void; + listProcessModulesSlot(resourceGroupName: string, name: string, processId: string, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Get process information by its ID for a specific scaled-out + * instance in a web site. + * + * Get process information by its ID for a specific scaled-out instance in a + * web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @param {string} baseAddress Module base address. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API returns deployments for the production slot. + * + * @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. + */ + getProcessModuleSlotWithHttpOperationResponse(resourceGroupName: string, name: string, processId: string, baseAddress: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get process information by its ID for a specific scaled-out + * instance in a web site. + * + * Get process information by its ID for a specific scaled-out instance in a + * web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @param {string} baseAddress Module base address. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API returns deployments for the production slot. + * + * @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 {ProcessModuleInfo} - 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. + * + * {ProcessModuleInfo} [result] - The deserialized result object if an error did not occur. + * See {@link ProcessModuleInfo} 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. + */ + getProcessModuleSlot(resourceGroupName: string, name: string, processId: string, baseAddress: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getProcessModuleSlot(resourceGroupName: string, name: string, processId: string, baseAddress: string, slot: string, callback: ServiceCallback): void; + getProcessModuleSlot(resourceGroupName: string, name: string, processId: string, baseAddress: string, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary List the threads in a process by its ID for a specific scaled-out + * instance in a web site. + * + * List the threads in a process by its ID for a specific scaled-out instance + * in a web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API returns deployments for the production slot. + * + * @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. + */ + listProcessThreadsSlotWithHttpOperationResponse(resourceGroupName: string, name: string, processId: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary List the threads in a process by its ID for a specific scaled-out + * instance in a web site. + * + * List the threads in a process by its ID for a specific scaled-out instance + * in a web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API returns deployments for the production slot. + * + * @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 {ProcessThreadInfoCollection} - 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. + * + * {ProcessThreadInfoCollection} [result] - The deserialized result object if an error did not occur. + * See {@link ProcessThreadInfoCollection} 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. + */ + listProcessThreadsSlot(resourceGroupName: string, name: string, processId: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listProcessThreadsSlot(resourceGroupName: string, name: string, processId: string, slot: string, callback: ServiceCallback): void; + listProcessThreadsSlot(resourceGroupName: string, name: string, processId: string, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Get thread information by Thread ID for a specific process, in a + * specific scaled-out instance in a web site. + * + * Get thread information by Thread ID for a specific process, in a specific + * scaled-out instance in a web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @param {string} threadId TID. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API returns deployments for the production slot. + * + * @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. + */ + getProcessThreadSlotWithHttpOperationResponse(resourceGroupName: string, name: string, processId: string, threadId: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get thread information by Thread ID for a specific process, in a + * specific scaled-out instance in a web site. + * + * Get thread information by Thread ID for a specific process, in a specific + * scaled-out instance in a web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @param {string} threadId TID. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API returns deployments for the production slot. + * + * @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 {ProcessThreadInfo} - 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. + * + * {ProcessThreadInfo} [result] - The deserialized result object if an error did not occur. + * See {@link ProcessThreadInfo} 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. + */ + getProcessThreadSlot(resourceGroupName: string, name: string, processId: string, threadId: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getProcessThreadSlot(resourceGroupName: string, name: string, processId: string, threadId: string, slot: string, callback: ServiceCallback): void; + getProcessThreadSlot(resourceGroupName: string, name: string, processId: string, threadId: string, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Get public certificates for an app or a deployment slot. + * + * Get public certificates for an app or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API gets hostname bindings for the production slot. + * + * @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. + */ + listPublicCertificatesSlotWithHttpOperationResponse(resourceGroupName: string, name: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get public certificates for an app or a deployment slot. + * + * Get public certificates for an app or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API gets hostname bindings for the production slot. + * + * @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 {PublicCertificateCollection} - 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. + * + * {PublicCertificateCollection} [result] - The deserialized result object if an error did not occur. + * See {@link PublicCertificateCollection} 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. + */ + listPublicCertificatesSlot(resourceGroupName: string, name: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listPublicCertificatesSlot(resourceGroupName: string, name: string, slot: string, callback: ServiceCallback): void; + listPublicCertificatesSlot(resourceGroupName: string, name: string, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Get the named public certificate for an app (or deployment slot, if + * specified). + * + * Get the named public certificate for an app (or deployment slot, if + * specified). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API the named binding for the production slot. + * + * @param {string} publicCertificateName Public certificate name. + * + * @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. + */ + getPublicCertificateSlotWithHttpOperationResponse(resourceGroupName: string, name: string, slot: string, publicCertificateName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get the named public certificate for an app (or deployment slot, if + * specified). + * + * Get the named public certificate for an app (or deployment slot, if + * specified). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API the named binding for the production slot. + * + * @param {string} publicCertificateName Public certificate name. + * + * @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 {PublicCertificate} - 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. + * + * {PublicCertificate} [result] - The deserialized result object if an error did not occur. + * See {@link PublicCertificate} 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. + */ + getPublicCertificateSlot(resourceGroupName: string, name: string, slot: string, publicCertificateName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getPublicCertificateSlot(resourceGroupName: string, name: string, slot: string, publicCertificateName: string, callback: ServiceCallback): void; + getPublicCertificateSlot(resourceGroupName: string, name: string, slot: string, publicCertificateName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Creates a hostname binding for an app. + * + * Creates a hostname binding for an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} publicCertificateName Public certificate name. + * + * @param {object} publicCertificate Public certificate details. This is the + * JSON representation of a PublicCertificate object. + * + * @param {buffer} [publicCertificate.blob] Public Certificate byte array + * + * @param {string} [publicCertificate.publicCertificateLocation] Public + * Certificate Location. Possible values include: 'CurrentUserMy', + * 'LocalMachineMy', 'Unknown' + * + * @param {string} [publicCertificate.kind] Kind of resource. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will create a binding for the production slot. + * + * @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. + */ + createOrUpdatePublicCertificateSlotWithHttpOperationResponse(resourceGroupName: string, name: string, publicCertificateName: string, publicCertificate: models.PublicCertificate, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Creates a hostname binding for an app. + * + * Creates a hostname binding for an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} publicCertificateName Public certificate name. + * + * @param {object} publicCertificate Public certificate details. This is the + * JSON representation of a PublicCertificate object. + * + * @param {buffer} [publicCertificate.blob] Public Certificate byte array + * + * @param {string} [publicCertificate.publicCertificateLocation] Public + * Certificate Location. Possible values include: 'CurrentUserMy', + * 'LocalMachineMy', 'Unknown' + * + * @param {string} [publicCertificate.kind] Kind of resource. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will create a binding for the production slot. + * + * @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 {PublicCertificate} - 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. + * + * {PublicCertificate} [result] - The deserialized result object if an error did not occur. + * See {@link PublicCertificate} 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. + */ + createOrUpdatePublicCertificateSlot(resourceGroupName: string, name: string, publicCertificateName: string, publicCertificate: models.PublicCertificate, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdatePublicCertificateSlot(resourceGroupName: string, name: string, publicCertificateName: string, publicCertificate: models.PublicCertificate, slot: string, callback: ServiceCallback): void; + createOrUpdatePublicCertificateSlot(resourceGroupName: string, name: string, publicCertificateName: string, publicCertificate: models.PublicCertificate, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Deletes a hostname binding for an app. + * + * Deletes a hostname binding for an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will delete the binding for the production slot. + * + * @param {string} publicCertificateName Public certificate name. + * + * @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. + */ + deletePublicCertificateSlotWithHttpOperationResponse(resourceGroupName: string, name: string, slot: string, publicCertificateName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Deletes a hostname binding for an app. + * + * Deletes a hostname binding for an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will delete the binding for the production slot. + * + * @param {string} publicCertificateName Public certificate name. + * + * @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 {null} - 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. + * + * {null} [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. + */ + deletePublicCertificateSlot(resourceGroupName: string, name: string, slot: string, publicCertificateName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deletePublicCertificateSlot(resourceGroupName: string, name: string, slot: string, publicCertificateName: string, callback: ServiceCallback): void; + deletePublicCertificateSlot(resourceGroupName: string, name: string, slot: string, publicCertificateName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Gets the publishing profile for an app (or deployment slot, if + * specified). + * + * Gets the publishing profile for an app (or deployment slot, if specified). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} publishingProfileOptions Specifies publishingProfileOptions + * for publishing profile. For example, use {"format": "FileZilla3"} to get a + * FileZilla publishing profile. + * + * @param {string} [publishingProfileOptions.format] Name of the format. Valid + * values are: + * FileZilla3 + * WebDeploy -- default + * Ftp. Possible values include: 'FileZilla3', 'WebDeploy', 'Ftp' + * + * @param {boolean} [publishingProfileOptions.includeDisasterRecoveryEndpoints] + * Include the DisasterRecover endpoint if true + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will get the publishing profile for the production slot. + * + * @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. + */ + listPublishingProfileXmlWithSecretsSlotWithHttpOperationResponse(resourceGroupName: string, name: string, publishingProfileOptions: models.CsmPublishingProfileOptions, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets the publishing profile for an app (or deployment slot, if + * specified). + * + * Gets the publishing profile for an app (or deployment slot, if specified). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} publishingProfileOptions Specifies publishingProfileOptions + * for publishing profile. For example, use {"format": "FileZilla3"} to get a + * FileZilla publishing profile. + * + * @param {string} [publishingProfileOptions.format] Name of the format. Valid + * values are: + * FileZilla3 + * WebDeploy -- default + * Ftp. Possible values include: 'FileZilla3', 'WebDeploy', 'Ftp' + * + * @param {boolean} [publishingProfileOptions.includeDisasterRecoveryEndpoints] + * Include the DisasterRecover endpoint if true + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will get the publishing profile for the production slot. + * + * @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 {Object} - 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. + * + * {Object} [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. + */ + listPublishingProfileXmlWithSecretsSlot(resourceGroupName: string, name: string, publishingProfileOptions: models.CsmPublishingProfileOptions, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listPublishingProfileXmlWithSecretsSlot(resourceGroupName: string, name: string, publishingProfileOptions: models.CsmPublishingProfileOptions, slot: string, callback: ServiceCallback): void; + listPublishingProfileXmlWithSecretsSlot(resourceGroupName: string, name: string, publishingProfileOptions: models.CsmPublishingProfileOptions, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Resets the configuration settings of the current slot if they were + * previously modified by calling the API with POST. + * + * Resets the configuration settings of the current slot if they were + * previously modified by calling the API with POST. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API resets configuration settings for the production slot. + * + * @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. + */ + resetSlotConfigurationSlotWithHttpOperationResponse(resourceGroupName: string, name: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Resets the configuration settings of the current slot if they were + * previously modified by calling the API with POST. + * + * Resets the configuration settings of the current slot if they were + * previously modified by calling the API with POST. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API resets configuration settings for the production slot. + * + * @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 {null} - 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. + * + * {null} [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. + */ + resetSlotConfigurationSlot(resourceGroupName: string, name: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + resetSlotConfigurationSlot(resourceGroupName: string, name: string, slot: string, callback: ServiceCallback): void; + resetSlotConfigurationSlot(resourceGroupName: string, name: string, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Restarts an app (or deployment slot, if specified). + * + * Restarts an app (or deployment slot, if specified). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will restart the production slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {boolean} [options.softRestart] Specify true to apply the + * configuration settings and restarts the app only if necessary. By default, + * the API always restarts and reprovisions the app. + * + * @param {boolean} [options.synchronous] Specify true to block until the app + * is restarted. By default, it is set to false, and the API responds + * immediately (asynchronous). + * + * @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. + */ + restartSlotWithHttpOperationResponse(resourceGroupName: string, name: string, slot: string, options?: { softRestart? : boolean, synchronous? : boolean, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Restarts an app (or deployment slot, if specified). + * + * Restarts an app (or deployment slot, if specified). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will restart the production slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {boolean} [options.softRestart] Specify true to apply the + * configuration settings and restarts the app only if necessary. By default, + * the API always restarts and reprovisions the app. + * + * @param {boolean} [options.synchronous] Specify true to block until the app + * is restarted. By default, it is set to false, and the API responds + * immediately (asynchronous). + * + * @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 {null} - 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. + * + * {null} [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. + */ + restartSlot(resourceGroupName: string, name: string, slot: string, options?: { softRestart? : boolean, synchronous? : boolean, customHeaders? : { [headerName: string]: string; } }): Promise; + restartSlot(resourceGroupName: string, name: string, slot: string, callback: ServiceCallback): void; + restartSlot(resourceGroupName: string, name: string, slot: string, options: { softRestart? : boolean, synchronous? : boolean, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Restores an app from a backup blob in Azure Storage. + * + * Restores an app from a backup blob in Azure Storage. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} request Information on restore request . + * + * @param {string} request.storageAccountUrl SAS URL to the container. + * + * @param {string} [request.blobName] Name of a blob which contains the backup. + * + * @param {boolean} request.overwrite true if the restore + * operation can overwrite target app; otherwise, false. + * true is needed if trying to restore over an existing app. + * + * @param {string} [request.siteName] Name of an app. + * + * @param {array} [request.databases] Collection of databases which should be + * restored. This list has to match the list of databases included in the + * backup. + * + * @param {boolean} [request.ignoreConflictingHostNames] Changes a logic when + * restoring an app with custom domains. true to remove custom + * domains automatically. If false, custom domains are added to + * the app's object when it is being restored, but that might fail due to + * conflicts during the operation. + * + * @param {boolean} [request.ignoreDatabases] Ignore the databases and only + * restore the site content + * + * @param {string} [request.appServicePlan] Specify app service plan that will + * own restored site. + * + * @param {string} [request.operationType] Operation type. Possible values + * include: 'Default', 'Clone', 'Relocation', 'Snapshot', 'CloudFS' + * + * @param {boolean} [request.adjustConnectionStrings] true if + * SiteConfig.ConnectionStrings should be set in new app; otherwise, + * false. + * + * @param {string} [request.hostingEnvironment] App Service Environment name, + * if needed (only when restoring an app to an App Service Environment). + * + * @param {string} [request.kind] Kind of resource. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will restore a backup of the production slot. + * + * @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. + */ + restoreFromBackupBlobSlotWithHttpOperationResponse(resourceGroupName: string, name: string, request: models.RestoreRequest, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Restores an app from a backup blob in Azure Storage. + * + * Restores an app from a backup blob in Azure Storage. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} request Information on restore request . + * + * @param {string} request.storageAccountUrl SAS URL to the container. + * + * @param {string} [request.blobName] Name of a blob which contains the backup. + * + * @param {boolean} request.overwrite true if the restore + * operation can overwrite target app; otherwise, false. + * true is needed if trying to restore over an existing app. + * + * @param {string} [request.siteName] Name of an app. + * + * @param {array} [request.databases] Collection of databases which should be + * restored. This list has to match the list of databases included in the + * backup. + * + * @param {boolean} [request.ignoreConflictingHostNames] Changes a logic when + * restoring an app with custom domains. true to remove custom + * domains automatically. If false, custom domains are added to + * the app's object when it is being restored, but that might fail due to + * conflicts during the operation. + * + * @param {boolean} [request.ignoreDatabases] Ignore the databases and only + * restore the site content + * + * @param {string} [request.appServicePlan] Specify app service plan that will + * own restored site. + * + * @param {string} [request.operationType] Operation type. Possible values + * include: 'Default', 'Clone', 'Relocation', 'Snapshot', 'CloudFS' + * + * @param {boolean} [request.adjustConnectionStrings] true if + * SiteConfig.ConnectionStrings should be set in new app; otherwise, + * false. + * + * @param {string} [request.hostingEnvironment] App Service Environment name, + * if needed (only when restoring an app to an App Service Environment). + * + * @param {string} [request.kind] Kind of resource. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will restore a backup of the production slot. + * + * @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 {null} - 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. + * + * {null} [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. + */ + restoreFromBackupBlobSlot(resourceGroupName: string, name: string, request: models.RestoreRequest, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + restoreFromBackupBlobSlot(resourceGroupName: string, name: string, request: models.RestoreRequest, slot: string, callback: ServiceCallback): void; + restoreFromBackupBlobSlot(resourceGroupName: string, name: string, request: models.RestoreRequest, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Restores a deleted web app to this web app. + * + * Restores a deleted web app to this web app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {object} restoreRequest Deleted web app restore information. + * + * @param {string} [restoreRequest.deletedSiteId] ARM resource ID of the + * deleted app. Example: + * /subscriptions/{subId}/providers/Microsoft.Web/deletedSites/{deletedSiteId} + * + * @param {boolean} [restoreRequest.recoverConfiguration] If true, deleted site + * configuration, in addition to content, will be restored. + * + * @param {string} [restoreRequest.snapshotTime] Point in time to restore the + * deleted app from, formatted as a DateTime string. + * If unspecified, default value is the time that the app was deleted. + * + * @param {string} [restoreRequest.kind] Kind of resource. + * + * @param {string} slot Name of web app slot. If not specified then will + * default to production slot. + * + * @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. + */ + restoreFromDeletedAppSlotWithHttpOperationResponse(resourceGroupName: string, name: string, restoreRequest: models.DeletedAppRestoreRequest, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Restores a deleted web app to this web app. + * + * Restores a deleted web app to this web app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {object} restoreRequest Deleted web app restore information. + * + * @param {string} [restoreRequest.deletedSiteId] ARM resource ID of the + * deleted app. Example: + * /subscriptions/{subId}/providers/Microsoft.Web/deletedSites/{deletedSiteId} + * + * @param {boolean} [restoreRequest.recoverConfiguration] If true, deleted site + * configuration, in addition to content, will be restored. + * + * @param {string} [restoreRequest.snapshotTime] Point in time to restore the + * deleted app from, formatted as a DateTime string. + * If unspecified, default value is the time that the app was deleted. + * + * @param {string} [restoreRequest.kind] Kind of resource. + * + * @param {string} slot Name of web app slot. If not specified then will + * default to production slot. + * + * @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 {null} - 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. + * + * {null} [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. + */ + restoreFromDeletedAppSlot(resourceGroupName: string, name: string, restoreRequest: models.DeletedAppRestoreRequest, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + restoreFromDeletedAppSlot(resourceGroupName: string, name: string, restoreRequest: models.DeletedAppRestoreRequest, slot: string, callback: ServiceCallback): void; + restoreFromDeletedAppSlot(resourceGroupName: string, name: string, restoreRequest: models.DeletedAppRestoreRequest, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Restores a web app from a snapshot. + * + * Restores a web app from a snapshot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {object} restoreRequest Snapshot restore settings. Snapshot + * information can be obtained by calling GetDeletedSites or GetSiteSnapshots + * API. + * + * @param {string} [restoreRequest.snapshotTime] Point in time in which the app + * restore should be done, formatted as a DateTime string. + * + * @param {object} [restoreRequest.recoverySource] Optional. Specifies the web + * app that snapshot contents will be retrieved from. + * If empty, the targeted web app will be used as the source. + * + * @param {string} [restoreRequest.recoverySource.location] Geographical + * location of the source web app, e.g. SouthEastAsia, SouthCentralUS + * + * @param {string} [restoreRequest.recoverySource.id] ARM resource ID of the + * source app. + * /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName} + * for production slots and + * /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/slots/{slotName} + * for other slots. + * + * @param {boolean} restoreRequest.overwrite If true the restore + * operation can overwrite source app; otherwise, false. + * + * @param {boolean} [restoreRequest.recoverConfiguration] If true, site + * configuration, in addition to content, will be reverted. + * + * @param {boolean} [restoreRequest.ignoreConflictingHostNames] If true, custom + * hostname conflicts will be ignored when recovering to a target web app. + * This setting is only necessary when RecoverConfiguration is enabled. + * + * @param {string} [restoreRequest.kind] Kind of resource. + * + * @param {string} slot Name of web app slot. If not specified then will + * default to production slot. + * + * @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. + */ + restoreSnapshotSlotWithHttpOperationResponse(resourceGroupName: string, name: string, restoreRequest: models.SnapshotRestoreRequest, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Restores a web app from a snapshot. + * + * Restores a web app from a snapshot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {object} restoreRequest Snapshot restore settings. Snapshot + * information can be obtained by calling GetDeletedSites or GetSiteSnapshots + * API. + * + * @param {string} [restoreRequest.snapshotTime] Point in time in which the app + * restore should be done, formatted as a DateTime string. + * + * @param {object} [restoreRequest.recoverySource] Optional. Specifies the web + * app that snapshot contents will be retrieved from. + * If empty, the targeted web app will be used as the source. + * + * @param {string} [restoreRequest.recoverySource.location] Geographical + * location of the source web app, e.g. SouthEastAsia, SouthCentralUS + * + * @param {string} [restoreRequest.recoverySource.id] ARM resource ID of the + * source app. + * /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName} + * for production slots and + * /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/slots/{slotName} + * for other slots. + * + * @param {boolean} restoreRequest.overwrite If true the restore + * operation can overwrite source app; otherwise, false. + * + * @param {boolean} [restoreRequest.recoverConfiguration] If true, site + * configuration, in addition to content, will be reverted. + * + * @param {boolean} [restoreRequest.ignoreConflictingHostNames] If true, custom + * hostname conflicts will be ignored when recovering to a target web app. + * This setting is only necessary when RecoverConfiguration is enabled. + * + * @param {string} [restoreRequest.kind] Kind of resource. + * + * @param {string} slot Name of web app slot. If not specified then will + * default to production slot. + * + * @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 {null} - 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. + * + * {null} [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. + */ + restoreSnapshotSlot(resourceGroupName: string, name: string, restoreRequest: models.SnapshotRestoreRequest, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + restoreSnapshotSlot(resourceGroupName: string, name: string, restoreRequest: models.SnapshotRestoreRequest, slot: string, callback: ServiceCallback): void; + restoreSnapshotSlot(resourceGroupName: string, name: string, restoreRequest: models.SnapshotRestoreRequest, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Get list of siteextensions for a web site, or a deployment slot. + * + * Get list of siteextensions for a web site, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API deletes a deployment for the production slot. + * + * @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. + */ + listSiteExtensionsSlotWithHttpOperationResponse(resourceGroupName: string, name: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get list of siteextensions for a web site, or a deployment slot. + * + * Get list of siteextensions for a web site, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API deletes a deployment for the production slot. + * + * @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 {SiteExtensionInfoCollection} - 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. + * + * {SiteExtensionInfoCollection} [result] - The deserialized result object if an error did not occur. + * See {@link SiteExtensionInfoCollection} 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. + */ + listSiteExtensionsSlot(resourceGroupName: string, name: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listSiteExtensionsSlot(resourceGroupName: string, name: string, slot: string, callback: ServiceCallback): void; + listSiteExtensionsSlot(resourceGroupName: string, name: string, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Get site extension information by its ID for a web site, or a + * deployment slot. + * + * Get site extension information by its ID for a web site, or a deployment + * slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} siteExtensionId Site extension name. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API deletes a deployment for the production slot. + * + * @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. + */ + getSiteExtensionSlotWithHttpOperationResponse(resourceGroupName: string, name: string, siteExtensionId: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get site extension information by its ID for a web site, or a + * deployment slot. + * + * Get site extension information by its ID for a web site, or a deployment + * slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} siteExtensionId Site extension name. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API deletes a deployment for the production slot. + * + * @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 {SiteExtensionInfo} - 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. + * + * {SiteExtensionInfo} [result] - The deserialized result object if an error did not occur. + * See {@link SiteExtensionInfo} 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. + */ + getSiteExtensionSlot(resourceGroupName: string, name: string, siteExtensionId: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getSiteExtensionSlot(resourceGroupName: string, name: string, siteExtensionId: string, slot: string, callback: ServiceCallback): void; + getSiteExtensionSlot(resourceGroupName: string, name: string, siteExtensionId: string, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Install site extension on a web site, or a deployment slot. + * + * Install site extension on a web site, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} siteExtensionId Site extension name. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API deletes a deployment for the production slot. + * + * @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. + */ + installSiteExtensionSlotWithHttpOperationResponse(resourceGroupName: string, name: string, siteExtensionId: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Install site extension on a web site, or a deployment slot. + * + * Install site extension on a web site, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} siteExtensionId Site extension name. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API deletes a deployment for the production slot. + * + * @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 {SiteExtensionInfo} - 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. + * + * {SiteExtensionInfo} [result] - The deserialized result object if an error did not occur. + * See {@link SiteExtensionInfo} 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. + */ + installSiteExtensionSlot(resourceGroupName: string, name: string, siteExtensionId: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + installSiteExtensionSlot(resourceGroupName: string, name: string, siteExtensionId: string, slot: string, callback: ServiceCallback): void; + installSiteExtensionSlot(resourceGroupName: string, name: string, siteExtensionId: string, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Remove a site extension from a web site, or a deployment slot. + * + * Remove a site extension from a web site, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} siteExtensionId Site extension name. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API deletes a deployment for the production slot. + * + * @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. + */ + deleteSiteExtensionSlotWithHttpOperationResponse(resourceGroupName: string, name: string, siteExtensionId: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Remove a site extension from a web site, or a deployment slot. + * + * Remove a site extension from a web site, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} siteExtensionId Site extension name. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API deletes a deployment for the production slot. + * + * @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 {null} - 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. + * + * {null} [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. + */ + deleteSiteExtensionSlot(resourceGroupName: string, name: string, siteExtensionId: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteSiteExtensionSlot(resourceGroupName: string, name: string, siteExtensionId: string, slot: string, callback: ServiceCallback): void; + deleteSiteExtensionSlot(resourceGroupName: string, name: string, siteExtensionId: string, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Get the difference in configuration settings between two web app + * slots. + * + * Get the difference in configuration settings between two web app slots. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} slotSwapEntity JSON object that contains the target slot + * name. See example. + * + * @param {string} slotSwapEntity.targetSlot Destination deployment slot during + * swap operation. + * + * @param {boolean} slotSwapEntity.preserveVnet true to preserve + * Virtual Network to the slot during swap; otherwise, false. + * + * @param {string} slot Name of the source slot. If a slot is not specified, + * the production slot is used as the source slot. + * + * @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. + */ + listSlotDifferencesSlotWithHttpOperationResponse(resourceGroupName: string, name: string, slotSwapEntity: models.CsmSlotEntity, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get the difference in configuration settings between two web app + * slots. + * + * Get the difference in configuration settings between two web app slots. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} slotSwapEntity JSON object that contains the target slot + * name. See example. + * + * @param {string} slotSwapEntity.targetSlot Destination deployment slot during + * swap operation. + * + * @param {boolean} slotSwapEntity.preserveVnet true to preserve + * Virtual Network to the slot during swap; otherwise, false. + * + * @param {string} slot Name of the source slot. If a slot is not specified, + * the production slot is used as the source slot. + * + * @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 {SlotDifferenceCollection} - 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. + * + * {SlotDifferenceCollection} [result] - The deserialized result object if an error did not occur. + * See {@link SlotDifferenceCollection} 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. + */ + listSlotDifferencesSlot(resourceGroupName: string, name: string, slotSwapEntity: models.CsmSlotEntity, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listSlotDifferencesSlot(resourceGroupName: string, name: string, slotSwapEntity: models.CsmSlotEntity, slot: string, callback: ServiceCallback): void; + listSlotDifferencesSlot(resourceGroupName: string, name: string, slotSwapEntity: models.CsmSlotEntity, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Swaps two deployment slots of an app. + * + * Swaps two deployment slots of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} slotSwapEntity JSON object that contains the target slot + * name. See example. + * + * @param {string} slotSwapEntity.targetSlot Destination deployment slot during + * swap operation. + * + * @param {boolean} slotSwapEntity.preserveVnet true to preserve + * Virtual Network to the slot during swap; otherwise, false. + * + * @param {string} slot Name of the source slot. If a slot is not specified, + * the production slot is used as the source slot. + * + * @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. + */ + swapSlotSlotWithHttpOperationResponse(resourceGroupName: string, name: string, slotSwapEntity: models.CsmSlotEntity, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Swaps two deployment slots of an app. + * + * Swaps two deployment slots of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} slotSwapEntity JSON object that contains the target slot + * name. See example. + * + * @param {string} slotSwapEntity.targetSlot Destination deployment slot during + * swap operation. + * + * @param {boolean} slotSwapEntity.preserveVnet true to preserve + * Virtual Network to the slot during swap; otherwise, false. + * + * @param {string} slot Name of the source slot. If a slot is not specified, + * the production slot is used as the source slot. + * + * @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 {null} - 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. + * + * {null} [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. + */ + swapSlotSlot(resourceGroupName: string, name: string, slotSwapEntity: models.CsmSlotEntity, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + swapSlotSlot(resourceGroupName: string, name: string, slotSwapEntity: models.CsmSlotEntity, slot: string, callback: ServiceCallback): void; + swapSlotSlot(resourceGroupName: string, name: string, slotSwapEntity: models.CsmSlotEntity, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Returns all Snapshots to the user. + * + * Returns all Snapshots to the user. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Website Name. + * + * @param {string} slot Website Slot. + * + * @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. + */ + listSnapshotsSlotWithHttpOperationResponse(resourceGroupName: string, name: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Returns all Snapshots to the user. + * + * Returns all Snapshots to the user. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Website Name. + * + * @param {string} slot Website Slot. + * + * @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 {SnapshotCollection} - 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. + * + * {SnapshotCollection} [result] - The deserialized result object if an error did not occur. + * See {@link SnapshotCollection} 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. + */ + listSnapshotsSlot(resourceGroupName: string, name: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listSnapshotsSlot(resourceGroupName: string, name: string, slot: string, callback: ServiceCallback): void; + listSnapshotsSlot(resourceGroupName: string, name: string, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Gets the source control configuration of an app. + * + * Gets the source control configuration of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will get the source control configuration for the + * production slot. + * + * @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. + */ + getSourceControlSlotWithHttpOperationResponse(resourceGroupName: string, name: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets the source control configuration of an app. + * + * Gets the source control configuration of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will get the source control configuration for the + * production slot. + * + * @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 {SiteSourceControl} - 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. + * + * {SiteSourceControl} [result] - The deserialized result object if an error did not occur. + * See {@link SiteSourceControl} 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. + */ + getSourceControlSlot(resourceGroupName: string, name: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getSourceControlSlot(resourceGroupName: string, name: string, slot: string, callback: ServiceCallback): void; + getSourceControlSlot(resourceGroupName: string, name: string, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Updates the source control configuration of an app. + * + * Updates the source control configuration of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} siteSourceControl JSON representation of a SiteSourceControl + * object. See example. + * + * @param {string} [siteSourceControl.repoUrl] Repository or source control + * URL. + * + * @param {string} [siteSourceControl.branch] Name of branch to use for + * deployment. + * + * @param {boolean} [siteSourceControl.isManualIntegration] true + * to limit to manual integration; false to enable continuous + * integration (which configures webhooks into online repos like GitHub). + * + * @param {boolean} [siteSourceControl.deploymentRollbackEnabled] + * true to enable deployment rollback; otherwise, + * false. + * + * @param {boolean} [siteSourceControl.isMercurial] true for a + * Mercurial repository; false for a Git repository. + * + * @param {string} [siteSourceControl.kind] Kind of resource. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will update the source control configuration for the + * production slot. + * + * @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. + */ + createOrUpdateSourceControlSlotWithHttpOperationResponse(resourceGroupName: string, name: string, siteSourceControl: models.SiteSourceControl, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Updates the source control configuration of an app. + * + * Updates the source control configuration of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} siteSourceControl JSON representation of a SiteSourceControl + * object. See example. + * + * @param {string} [siteSourceControl.repoUrl] Repository or source control + * URL. + * + * @param {string} [siteSourceControl.branch] Name of branch to use for + * deployment. + * + * @param {boolean} [siteSourceControl.isManualIntegration] true + * to limit to manual integration; false to enable continuous + * integration (which configures webhooks into online repos like GitHub). + * + * @param {boolean} [siteSourceControl.deploymentRollbackEnabled] + * true to enable deployment rollback; otherwise, + * false. + * + * @param {boolean} [siteSourceControl.isMercurial] true for a + * Mercurial repository; false for a Git repository. + * + * @param {string} [siteSourceControl.kind] Kind of resource. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will update the source control configuration for the + * production slot. + * + * @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 {SiteSourceControl} - 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. + * + * {SiteSourceControl} [result] - The deserialized result object if an error did not occur. + * See {@link SiteSourceControl} 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. + */ + createOrUpdateSourceControlSlot(resourceGroupName: string, name: string, siteSourceControl: models.SiteSourceControl, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdateSourceControlSlot(resourceGroupName: string, name: string, siteSourceControl: models.SiteSourceControl, slot: string, callback: ServiceCallback): void; + createOrUpdateSourceControlSlot(resourceGroupName: string, name: string, siteSourceControl: models.SiteSourceControl, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Deletes the source control configuration of an app. + * + * Deletes the source control configuration of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will delete the source control configuration for the + * production slot. + * + * @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. + */ + deleteSourceControlSlotWithHttpOperationResponse(resourceGroupName: string, name: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Deletes the source control configuration of an app. + * + * Deletes the source control configuration of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will delete the source control configuration for the + * production slot. + * + * @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 {null} - 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. + * + * {null} [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. + */ + deleteSourceControlSlot(resourceGroupName: string, name: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteSourceControlSlot(resourceGroupName: string, name: string, slot: string, callback: ServiceCallback): void; + deleteSourceControlSlot(resourceGroupName: string, name: string, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Updates the source control configuration of an app. + * + * Updates the source control configuration of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} siteSourceControl JSON representation of a SiteSourceControl + * object. See example. + * + * @param {string} [siteSourceControl.repoUrl] Repository or source control + * URL. + * + * @param {string} [siteSourceControl.branch] Name of branch to use for + * deployment. + * + * @param {boolean} [siteSourceControl.isManualIntegration] true + * to limit to manual integration; false to enable continuous + * integration (which configures webhooks into online repos like GitHub). + * + * @param {boolean} [siteSourceControl.deploymentRollbackEnabled] + * true to enable deployment rollback; otherwise, + * false. + * + * @param {boolean} [siteSourceControl.isMercurial] true for a + * Mercurial repository; false for a Git repository. + * + * @param {string} [siteSourceControl.kind] Kind of resource. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will update the source control configuration for the + * production slot. + * + * @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. + */ + updateSourceControlSlotWithHttpOperationResponse(resourceGroupName: string, name: string, siteSourceControl: models.SiteSourceControl, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Updates the source control configuration of an app. + * + * Updates the source control configuration of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} siteSourceControl JSON representation of a SiteSourceControl + * object. See example. + * + * @param {string} [siteSourceControl.repoUrl] Repository or source control + * URL. + * + * @param {string} [siteSourceControl.branch] Name of branch to use for + * deployment. + * + * @param {boolean} [siteSourceControl.isManualIntegration] true + * to limit to manual integration; false to enable continuous + * integration (which configures webhooks into online repos like GitHub). + * + * @param {boolean} [siteSourceControl.deploymentRollbackEnabled] + * true to enable deployment rollback; otherwise, + * false. + * + * @param {boolean} [siteSourceControl.isMercurial] true for a + * Mercurial repository; false for a Git repository. + * + * @param {string} [siteSourceControl.kind] Kind of resource. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will update the source control configuration for the + * production slot. + * + * @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 {SiteSourceControl} - 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. + * + * {SiteSourceControl} [result] - The deserialized result object if an error did not occur. + * See {@link SiteSourceControl} 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. + */ + updateSourceControlSlot(resourceGroupName: string, name: string, siteSourceControl: models.SiteSourceControl, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + updateSourceControlSlot(resourceGroupName: string, name: string, siteSourceControl: models.SiteSourceControl, slot: string, callback: ServiceCallback): void; + updateSourceControlSlot(resourceGroupName: string, name: string, siteSourceControl: models.SiteSourceControl, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Starts an app (or deployment slot, if specified). + * + * Starts an app (or deployment slot, if specified). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will start the production slot. + * + * @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. + */ + startSlotWithHttpOperationResponse(resourceGroupName: string, name: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Starts an app (or deployment slot, if specified). + * + * Starts an app (or deployment slot, if specified). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will start the production slot. + * + * @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 {null} - 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. + * + * {null} [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. + */ + startSlot(resourceGroupName: string, name: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + startSlot(resourceGroupName: string, name: string, slot: string, callback: ServiceCallback): void; + startSlot(resourceGroupName: string, name: string, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Stops an app (or deployment slot, if specified). + * + * Stops an app (or deployment slot, if specified). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will stop the production slot. + * + * @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. + */ + stopSlotWithHttpOperationResponse(resourceGroupName: string, name: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Stops an app (or deployment slot, if specified). + * + * Stops an app (or deployment slot, if specified). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will stop the production slot. + * + * @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 {null} - 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. + * + * {null} [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. + */ + stopSlot(resourceGroupName: string, name: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + stopSlot(resourceGroupName: string, name: string, slot: string, callback: ServiceCallback): void; + stopSlot(resourceGroupName: string, name: string, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Sync web app repository. + * + * Sync web app repository. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {string} slot Name of web app slot. If not specified then will + * default to production slot. + * + * @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. + */ + syncRepositorySlotWithHttpOperationResponse(resourceGroupName: string, name: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Sync web app repository. + * + * Sync web app repository. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {string} slot Name of web app slot. If not specified then will + * default to production slot. + * + * @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 {null} - 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. + * + * {null} [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. + */ + syncRepositorySlot(resourceGroupName: string, name: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + syncRepositorySlot(resourceGroupName: string, name: string, slot: string, callback: ServiceCallback): void; + syncRepositorySlot(resourceGroupName: string, name: string, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Syncs function trigger metadata to the scale controller + * + * Syncs function trigger metadata to the scale controller + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will restore a backup of the production slot. + * + * @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. + */ + syncFunctionTriggersSlotWithHttpOperationResponse(resourceGroupName: string, name: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Syncs function trigger metadata to the scale controller + * + * Syncs function trigger metadata to the scale controller + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will restore a backup of the production slot. + * + * @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 {null} - 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. + * + * {null} [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. + */ + syncFunctionTriggersSlot(resourceGroupName: string, name: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + syncFunctionTriggersSlot(resourceGroupName: string, name: string, slot: string, callback: ServiceCallback): void; + syncFunctionTriggersSlot(resourceGroupName: string, name: string, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary List triggered web jobs for an app, or a deployment slot. + * + * List triggered web jobs for an app, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API deletes a deployment for the production slot. + * + * @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. + */ + listTriggeredWebJobsSlotWithHttpOperationResponse(resourceGroupName: string, name: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary List triggered web jobs for an app, or a deployment slot. + * + * List triggered web jobs for an app, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API deletes a deployment for the production slot. + * + * @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 {TriggeredWebJobCollection} - 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. + * + * {TriggeredWebJobCollection} [result] - The deserialized result object if an error did not occur. + * See {@link TriggeredWebJobCollection} 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. + */ + listTriggeredWebJobsSlot(resourceGroupName: string, name: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listTriggeredWebJobsSlot(resourceGroupName: string, name: string, slot: string, callback: ServiceCallback): void; + listTriggeredWebJobsSlot(resourceGroupName: string, name: string, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Gets a triggered web job by its ID for an app, or a deployment + * slot. + * + * Gets a triggered web job by its ID for an app, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} webJobName Name of Web Job. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API deletes a deployment for the production slot. + * + * @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. + */ + getTriggeredWebJobSlotWithHttpOperationResponse(resourceGroupName: string, name: string, webJobName: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets a triggered web job by its ID for an app, or a deployment + * slot. + * + * Gets a triggered web job by its ID for an app, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} webJobName Name of Web Job. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API deletes a deployment for the production slot. + * + * @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 {TriggeredWebJob} - 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. + * + * {TriggeredWebJob} [result] - The deserialized result object if an error did not occur. + * See {@link TriggeredWebJob} 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. + */ + getTriggeredWebJobSlot(resourceGroupName: string, name: string, webJobName: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getTriggeredWebJobSlot(resourceGroupName: string, name: string, webJobName: string, slot: string, callback: ServiceCallback): void; + getTriggeredWebJobSlot(resourceGroupName: string, name: string, webJobName: string, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Delete a triggered web job by its ID for an app, or a deployment + * slot. + * + * Delete a triggered web job by its ID for an app, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} webJobName Name of Web Job. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API deletes a deployment for the production slot. + * + * @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. + */ + deleteTriggeredWebJobSlotWithHttpOperationResponse(resourceGroupName: string, name: string, webJobName: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Delete a triggered web job by its ID for an app, or a deployment + * slot. + * + * Delete a triggered web job by its ID for an app, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} webJobName Name of Web Job. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API deletes a deployment for the production slot. + * + * @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 {null} - 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. + * + * {null} [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. + */ + deleteTriggeredWebJobSlot(resourceGroupName: string, name: string, webJobName: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteTriggeredWebJobSlot(resourceGroupName: string, name: string, webJobName: string, slot: string, callback: ServiceCallback): void; + deleteTriggeredWebJobSlot(resourceGroupName: string, name: string, webJobName: string, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary List a triggered web job's history for an app, or a deployment + * slot. + * + * List a triggered web job's history for an app, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} webJobName Name of Web Job. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API deletes a deployment for the production slot. + * + * @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. + */ + listTriggeredWebJobHistorySlotWithHttpOperationResponse(resourceGroupName: string, name: string, webJobName: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary List a triggered web job's history for an app, or a deployment + * slot. + * + * List a triggered web job's history for an app, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} webJobName Name of Web Job. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API deletes a deployment for the production slot. + * + * @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 {TriggeredJobHistoryCollection} - 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. + * + * {TriggeredJobHistoryCollection} [result] - The deserialized result object if an error did not occur. + * See {@link TriggeredJobHistoryCollection} 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. + */ + listTriggeredWebJobHistorySlot(resourceGroupName: string, name: string, webJobName: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listTriggeredWebJobHistorySlot(resourceGroupName: string, name: string, webJobName: string, slot: string, callback: ServiceCallback): void; + listTriggeredWebJobHistorySlot(resourceGroupName: string, name: string, webJobName: string, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Gets a triggered web job's history by its ID for an app, , or a + * deployment slot. + * + * Gets a triggered web job's history by its ID for an app, , or a deployment + * slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} webJobName Name of Web Job. + * + * @param {string} id History ID. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API deletes a deployment for the production slot. + * + * @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. + */ + getTriggeredWebJobHistorySlotWithHttpOperationResponse(resourceGroupName: string, name: string, webJobName: string, id: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets a triggered web job's history by its ID for an app, , or a + * deployment slot. + * + * Gets a triggered web job's history by its ID for an app, , or a deployment + * slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} webJobName Name of Web Job. + * + * @param {string} id History ID. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API deletes a deployment for the production slot. + * + * @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 {TriggeredJobHistory} - 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. + * + * {TriggeredJobHistory} [result] - The deserialized result object if an error did not occur. + * See {@link TriggeredJobHistory} 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. + */ + getTriggeredWebJobHistorySlot(resourceGroupName: string, name: string, webJobName: string, id: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getTriggeredWebJobHistorySlot(resourceGroupName: string, name: string, webJobName: string, id: string, slot: string, callback: ServiceCallback): void; + getTriggeredWebJobHistorySlot(resourceGroupName: string, name: string, webJobName: string, id: string, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Run a triggered web job for an app, or a deployment slot. + * + * Run a triggered web job for an app, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} webJobName Name of Web Job. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API deletes a deployment for the production slot. + * + * @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. + */ + runTriggeredWebJobSlotWithHttpOperationResponse(resourceGroupName: string, name: string, webJobName: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Run a triggered web job for an app, or a deployment slot. + * + * Run a triggered web job for an app, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} webJobName Name of Web Job. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API deletes a deployment for the production slot. + * + * @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 {null} - 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. + * + * {null} [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. + */ + runTriggeredWebJobSlot(resourceGroupName: string, name: string, webJobName: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + runTriggeredWebJobSlot(resourceGroupName: string, name: string, webJobName: string, slot: string, callback: ServiceCallback): void; + runTriggeredWebJobSlot(resourceGroupName: string, name: string, webJobName: string, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Gets the quota usage information of an app (or deployment slot, if + * specified). + * + * Gets the quota usage information of an app (or deployment slot, if + * specified). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will get quota information of the production slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.filter] Return only information specified in the + * filter (using OData syntax). For example: $filter=(name.value eq 'Metric1' + * or name.value eq 'Metric2') and startTime eq 2014-01-01T00:00:00Z and + * endTime eq 2014-12-31T23:59:59Z and timeGrain eq + * duration'[Hour|Minute|Day]'. + * + * @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. + */ + listUsagesSlotWithHttpOperationResponse(resourceGroupName: string, name: string, slot: string, options?: { filter? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets the quota usage information of an app (or deployment slot, if + * specified). + * + * Gets the quota usage information of an app (or deployment slot, if + * specified). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will get quota information of the production slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.filter] Return only information specified in the + * filter (using OData syntax). For example: $filter=(name.value eq 'Metric1' + * or name.value eq 'Metric2') and startTime eq 2014-01-01T00:00:00Z and + * endTime eq 2014-12-31T23:59:59Z and timeGrain eq + * duration'[Hour|Minute|Day]'. + * + * @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 {CsmUsageQuotaCollection} - 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. + * + * {CsmUsageQuotaCollection} [result] - The deserialized result object if an error did not occur. + * See {@link CsmUsageQuotaCollection} 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. + */ + listUsagesSlot(resourceGroupName: string, name: string, slot: string, options?: { filter? : string, customHeaders? : { [headerName: string]: string; } }): Promise; + listUsagesSlot(resourceGroupName: string, name: string, slot: string, callback: ServiceCallback): void; + listUsagesSlot(resourceGroupName: string, name: string, slot: string, options: { filter? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Gets the virtual networks the app (or deployment slot) is connected + * to. + * + * Gets the virtual networks the app (or deployment slot) is connected to. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will get virtual network connections for the production + * slot. + * + * @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. + */ + listVnetConnectionsSlotWithHttpOperationResponse(resourceGroupName: string, name: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets the virtual networks the app (or deployment slot) is connected + * to. + * + * Gets the virtual networks the app (or deployment slot) is connected to. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will get virtual network connections for the production + * slot. + * + * @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. + */ + listVnetConnectionsSlot(resourceGroupName: string, name: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listVnetConnectionsSlot(resourceGroupName: string, name: string, slot: string, callback: ServiceCallback): void; + listVnetConnectionsSlot(resourceGroupName: string, name: string, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Gets a virtual network the app (or deployment slot) is connected to + * by name. + * + * Gets a virtual network the app (or deployment slot) is connected to by name. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} vnetName Name of the virtual network. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will get the named virtual network for the production + * slot. + * + * @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. + */ + getVnetConnectionSlotWithHttpOperationResponse(resourceGroupName: string, name: string, vnetName: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets a virtual network the app (or deployment slot) is connected to + * by name. + * + * Gets a virtual network the app (or deployment slot) is connected to by name. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} vnetName Name of the virtual network. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will get the named virtual network for the production + * slot. + * + * @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 {VnetInfo} - 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. + * + * {VnetInfo} [result] - The deserialized result object if an error did not occur. + * See {@link VnetInfo} 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. + */ + getVnetConnectionSlot(resourceGroupName: string, name: string, vnetName: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getVnetConnectionSlot(resourceGroupName: string, name: string, vnetName: string, slot: string, callback: ServiceCallback): void; + getVnetConnectionSlot(resourceGroupName: string, name: string, vnetName: string, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Adds a Virtual Network connection to an app or slot (PUT) or + * updates the connection properties (PATCH). + * + * Adds a Virtual Network connection to an app or slot (PUT) or updates the + * connection properties (PATCH). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} vnetName Name of an existing Virtual Network. + * + * @param {object} connectionEnvelope Properties of the Virtual Network + * connection. See example. + * + * @param {string} [connectionEnvelope.vnetResourceId] The Virtual Network's + * resource ID. + * + * @param {buffer} [connectionEnvelope.certBlob] A certificate file (.cer) blob + * containing the public key of the private key used to authenticate a + * Point-To-Site VPN connection. + * + * @param {string} [connectionEnvelope.dnsServers] DNS servers to be used by + * this Virtual Network. This should be a comma-separated list of IP addresses. + * + * @param {string} [connectionEnvelope.kind] Kind of resource. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will add or update connections for the production slot. + * + * @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. + */ + createOrUpdateVnetConnectionSlotWithHttpOperationResponse(resourceGroupName: string, name: string, vnetName: string, connectionEnvelope: models.VnetInfo, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Adds a Virtual Network connection to an app or slot (PUT) or + * updates the connection properties (PATCH). + * + * Adds a Virtual Network connection to an app or slot (PUT) or updates the + * connection properties (PATCH). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} vnetName Name of an existing Virtual Network. + * + * @param {object} connectionEnvelope Properties of the Virtual Network + * connection. See example. + * + * @param {string} [connectionEnvelope.vnetResourceId] The Virtual Network's + * resource ID. + * + * @param {buffer} [connectionEnvelope.certBlob] A certificate file (.cer) blob + * containing the public key of the private key used to authenticate a + * Point-To-Site VPN connection. + * + * @param {string} [connectionEnvelope.dnsServers] DNS servers to be used by + * this Virtual Network. This should be a comma-separated list of IP addresses. + * + * @param {string} [connectionEnvelope.kind] Kind of resource. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will add or update connections for the production slot. + * + * @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 {VnetInfo} - 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. + * + * {VnetInfo} [result] - The deserialized result object if an error did not occur. + * See {@link VnetInfo} 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. + */ + createOrUpdateVnetConnectionSlot(resourceGroupName: string, name: string, vnetName: string, connectionEnvelope: models.VnetInfo, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdateVnetConnectionSlot(resourceGroupName: string, name: string, vnetName: string, connectionEnvelope: models.VnetInfo, slot: string, callback: ServiceCallback): void; + createOrUpdateVnetConnectionSlot(resourceGroupName: string, name: string, vnetName: string, connectionEnvelope: models.VnetInfo, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Deletes a connection from an app (or deployment slot to a named + * virtual network. + * + * Deletes a connection from an app (or deployment slot to a named virtual + * network. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} vnetName Name of the virtual network. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will delete the connection for the production slot. + * + * @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. + */ + deleteVnetConnectionSlotWithHttpOperationResponse(resourceGroupName: string, name: string, vnetName: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Deletes a connection from an app (or deployment slot to a named + * virtual network. + * + * Deletes a connection from an app (or deployment slot to a named virtual + * network. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} vnetName Name of the virtual network. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will delete the connection for the production slot. + * + * @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 {null} - 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. + * + * {null} [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. + */ + deleteVnetConnectionSlot(resourceGroupName: string, name: string, vnetName: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteVnetConnectionSlot(resourceGroupName: string, name: string, vnetName: string, slot: string, callback: ServiceCallback): void; + deleteVnetConnectionSlot(resourceGroupName: string, name: string, vnetName: string, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Adds a Virtual Network connection to an app or slot (PUT) or + * updates the connection properties (PATCH). + * + * Adds a Virtual Network connection to an app or slot (PUT) or updates the + * connection properties (PATCH). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} vnetName Name of an existing Virtual Network. + * + * @param {object} connectionEnvelope Properties of the Virtual Network + * connection. See example. + * + * @param {string} [connectionEnvelope.vnetResourceId] The Virtual Network's + * resource ID. + * + * @param {buffer} [connectionEnvelope.certBlob] A certificate file (.cer) blob + * containing the public key of the private key used to authenticate a + * Point-To-Site VPN connection. + * + * @param {string} [connectionEnvelope.dnsServers] DNS servers to be used by + * this Virtual Network. This should be a comma-separated list of IP addresses. + * + * @param {string} [connectionEnvelope.kind] Kind of resource. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will add or update connections for the production slot. + * + * @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. + */ + updateVnetConnectionSlotWithHttpOperationResponse(resourceGroupName: string, name: string, vnetName: string, connectionEnvelope: models.VnetInfo, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Adds a Virtual Network connection to an app or slot (PUT) or + * updates the connection properties (PATCH). + * + * Adds a Virtual Network connection to an app or slot (PUT) or updates the + * connection properties (PATCH). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} vnetName Name of an existing Virtual Network. + * + * @param {object} connectionEnvelope Properties of the Virtual Network + * connection. See example. + * + * @param {string} [connectionEnvelope.vnetResourceId] The Virtual Network's + * resource ID. + * + * @param {buffer} [connectionEnvelope.certBlob] A certificate file (.cer) blob + * containing the public key of the private key used to authenticate a + * Point-To-Site VPN connection. + * + * @param {string} [connectionEnvelope.dnsServers] DNS servers to be used by + * this Virtual Network. This should be a comma-separated list of IP addresses. + * + * @param {string} [connectionEnvelope.kind] Kind of resource. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will add or update connections for the production slot. + * + * @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 {VnetInfo} - 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. + * + * {VnetInfo} [result] - The deserialized result object if an error did not occur. + * See {@link VnetInfo} 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. + */ + updateVnetConnectionSlot(resourceGroupName: string, name: string, vnetName: string, connectionEnvelope: models.VnetInfo, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + updateVnetConnectionSlot(resourceGroupName: string, name: string, vnetName: string, connectionEnvelope: models.VnetInfo, slot: string, callback: ServiceCallback): void; + updateVnetConnectionSlot(resourceGroupName: string, name: string, vnetName: string, connectionEnvelope: models.VnetInfo, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Gets an app's Virtual Network gateway. + * + * Gets an app's Virtual Network gateway. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} vnetName Name of the Virtual Network. + * + * @param {string} gatewayName Name of the gateway. Currently, the only + * supported string is "primary". + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will get a gateway for the production slot's Virtual + * Network. + * + * @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. + */ + getVnetConnectionGatewaySlotWithHttpOperationResponse(resourceGroupName: string, name: string, vnetName: string, gatewayName: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets an app's Virtual Network gateway. + * + * Gets an app's Virtual Network gateway. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} vnetName Name of the Virtual Network. + * + * @param {string} gatewayName Name of the gateway. Currently, the only + * supported string is "primary". + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will get a gateway for the production slot's Virtual + * Network. + * + * @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 {VnetGateway} - 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. + * + * {VnetGateway} [result] - The deserialized result object if an error did not occur. + * See {@link VnetGateway} 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. + */ + getVnetConnectionGatewaySlot(resourceGroupName: string, name: string, vnetName: string, gatewayName: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getVnetConnectionGatewaySlot(resourceGroupName: string, name: string, vnetName: string, gatewayName: string, slot: string, callback: ServiceCallback): void; + getVnetConnectionGatewaySlot(resourceGroupName: string, name: string, vnetName: string, gatewayName: string, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Adds a gateway to a connected Virtual Network (PUT) or updates it + * (PATCH). + * + * Adds a gateway to a connected Virtual Network (PUT) or updates it (PATCH). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} vnetName Name of the Virtual Network. + * + * @param {string} gatewayName Name of the gateway. Currently, the only + * supported string is "primary". + * + * @param {object} connectionEnvelope The properties to update this gateway + * with. + * + * @param {string} [connectionEnvelope.vnetName] The Virtual Network name. + * + * @param {string} connectionEnvelope.vpnPackageUri The URI where the VPN + * package can be downloaded. + * + * @param {string} [connectionEnvelope.kind] Kind of resource. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will add or update a gateway for the production slot's + * Virtual Network. + * + * @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. + */ + createOrUpdateVnetConnectionGatewaySlotWithHttpOperationResponse(resourceGroupName: string, name: string, vnetName: string, gatewayName: string, connectionEnvelope: models.VnetGateway, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Adds a gateway to a connected Virtual Network (PUT) or updates it + * (PATCH). + * + * Adds a gateway to a connected Virtual Network (PUT) or updates it (PATCH). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} vnetName Name of the Virtual Network. + * + * @param {string} gatewayName Name of the gateway. Currently, the only + * supported string is "primary". + * + * @param {object} connectionEnvelope The properties to update this gateway + * with. + * + * @param {string} [connectionEnvelope.vnetName] The Virtual Network name. + * + * @param {string} connectionEnvelope.vpnPackageUri The URI where the VPN + * package can be downloaded. + * + * @param {string} [connectionEnvelope.kind] Kind of resource. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will add or update a gateway for the production slot's + * Virtual Network. + * + * @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 {VnetGateway} - 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. + * + * {VnetGateway} [result] - The deserialized result object if an error did not occur. + * See {@link VnetGateway} 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. + */ + createOrUpdateVnetConnectionGatewaySlot(resourceGroupName: string, name: string, vnetName: string, gatewayName: string, connectionEnvelope: models.VnetGateway, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdateVnetConnectionGatewaySlot(resourceGroupName: string, name: string, vnetName: string, gatewayName: string, connectionEnvelope: models.VnetGateway, slot: string, callback: ServiceCallback): void; + createOrUpdateVnetConnectionGatewaySlot(resourceGroupName: string, name: string, vnetName: string, gatewayName: string, connectionEnvelope: models.VnetGateway, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Adds a gateway to a connected Virtual Network (PUT) or updates it + * (PATCH). + * + * Adds a gateway to a connected Virtual Network (PUT) or updates it (PATCH). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} vnetName Name of the Virtual Network. + * + * @param {string} gatewayName Name of the gateway. Currently, the only + * supported string is "primary". + * + * @param {object} connectionEnvelope The properties to update this gateway + * with. + * + * @param {string} [connectionEnvelope.vnetName] The Virtual Network name. + * + * @param {string} connectionEnvelope.vpnPackageUri The URI where the VPN + * package can be downloaded. + * + * @param {string} [connectionEnvelope.kind] Kind of resource. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will add or update a gateway for the production slot's + * Virtual Network. + * + * @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. + */ + updateVnetConnectionGatewaySlotWithHttpOperationResponse(resourceGroupName: string, name: string, vnetName: string, gatewayName: string, connectionEnvelope: models.VnetGateway, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Adds a gateway to a connected Virtual Network (PUT) or updates it + * (PATCH). + * + * Adds a gateway to a connected Virtual Network (PUT) or updates it (PATCH). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} vnetName Name of the Virtual Network. + * + * @param {string} gatewayName Name of the gateway. Currently, the only + * supported string is "primary". + * + * @param {object} connectionEnvelope The properties to update this gateway + * with. + * + * @param {string} [connectionEnvelope.vnetName] The Virtual Network name. + * + * @param {string} connectionEnvelope.vpnPackageUri The URI where the VPN + * package can be downloaded. + * + * @param {string} [connectionEnvelope.kind] Kind of resource. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will add or update a gateway for the production slot's + * Virtual Network. + * + * @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 {VnetGateway} - 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. + * + * {VnetGateway} [result] - The deserialized result object if an error did not occur. + * See {@link VnetGateway} 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. + */ + updateVnetConnectionGatewaySlot(resourceGroupName: string, name: string, vnetName: string, gatewayName: string, connectionEnvelope: models.VnetGateway, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + updateVnetConnectionGatewaySlot(resourceGroupName: string, name: string, vnetName: string, gatewayName: string, connectionEnvelope: models.VnetGateway, slot: string, callback: ServiceCallback): void; + updateVnetConnectionGatewaySlot(resourceGroupName: string, name: string, vnetName: string, gatewayName: string, connectionEnvelope: models.VnetGateway, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary List webjobs for an app, or a deployment slot. + * + * List webjobs for an app, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API returns deployments for the production slot. + * + * @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. + */ + listWebJobsSlotWithHttpOperationResponse(resourceGroupName: string, name: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary List webjobs for an app, or a deployment slot. + * + * List webjobs for an app, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API returns deployments for the production slot. + * + * @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 {WebJobCollection} - 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. + * + * {WebJobCollection} [result] - The deserialized result object if an error did not occur. + * See {@link WebJobCollection} 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. + */ + listWebJobsSlot(resourceGroupName: string, name: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listWebJobsSlot(resourceGroupName: string, name: string, slot: string, callback: ServiceCallback): void; + listWebJobsSlot(resourceGroupName: string, name: string, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Get webjob information for an app, or a deployment slot. + * + * Get webjob information for an app, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} webJobName Name of the web job. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API returns deployments for the production slot. + * + * @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. + */ + getWebJobSlotWithHttpOperationResponse(resourceGroupName: string, name: string, webJobName: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get webjob information for an app, or a deployment slot. + * + * Get webjob information for an app, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} webJobName Name of the web job. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API returns deployments for the production slot. + * + * @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 {WebJob} - 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. + * + * {WebJob} [result] - The deserialized result object if an error did not occur. + * See {@link WebJob} 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. + */ + getWebJobSlot(resourceGroupName: string, name: string, webJobName: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getWebJobSlot(resourceGroupName: string, name: string, webJobName: string, slot: string, callback: ServiceCallback): void; + getWebJobSlot(resourceGroupName: string, name: string, webJobName: string, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Get the difference in configuration settings between two web app + * slots. + * + * Get the difference in configuration settings between two web app slots. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} slotSwapEntity JSON object that contains the target slot + * name. See example. + * + * @param {string} slotSwapEntity.targetSlot Destination deployment slot during + * swap operation. + * + * @param {boolean} slotSwapEntity.preserveVnet true to preserve + * Virtual Network to the slot during swap; otherwise, false. + * + * @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. + */ + listSlotDifferencesFromProductionWithHttpOperationResponse(resourceGroupName: string, name: string, slotSwapEntity: models.CsmSlotEntity, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get the difference in configuration settings between two web app + * slots. + * + * Get the difference in configuration settings between two web app slots. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} slotSwapEntity JSON object that contains the target slot + * name. See example. + * + * @param {string} slotSwapEntity.targetSlot Destination deployment slot during + * swap operation. + * + * @param {boolean} slotSwapEntity.preserveVnet true to preserve + * Virtual Network to the slot during swap; otherwise, false. + * + * @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 {SlotDifferenceCollection} - 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. + * + * {SlotDifferenceCollection} [result] - The deserialized result object if an error did not occur. + * See {@link SlotDifferenceCollection} 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. + */ + listSlotDifferencesFromProduction(resourceGroupName: string, name: string, slotSwapEntity: models.CsmSlotEntity, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listSlotDifferencesFromProduction(resourceGroupName: string, name: string, slotSwapEntity: models.CsmSlotEntity, callback: ServiceCallback): void; + listSlotDifferencesFromProduction(resourceGroupName: string, name: string, slotSwapEntity: models.CsmSlotEntity, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Swaps two deployment slots of an app. + * + * Swaps two deployment slots of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} slotSwapEntity JSON object that contains the target slot + * name. See example. + * + * @param {string} slotSwapEntity.targetSlot Destination deployment slot during + * swap operation. + * + * @param {boolean} slotSwapEntity.preserveVnet true to preserve + * Virtual Network to the slot during swap; otherwise, false. + * + * @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. + */ + swapSlotWithProductionWithHttpOperationResponse(resourceGroupName: string, name: string, slotSwapEntity: models.CsmSlotEntity, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Swaps two deployment slots of an app. + * + * Swaps two deployment slots of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} slotSwapEntity JSON object that contains the target slot + * name. See example. + * + * @param {string} slotSwapEntity.targetSlot Destination deployment slot during + * swap operation. + * + * @param {boolean} slotSwapEntity.preserveVnet true to preserve + * Virtual Network to the slot during swap; otherwise, false. + * + * @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 {null} - 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. + * + * {null} [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. + */ + swapSlotWithProduction(resourceGroupName: string, name: string, slotSwapEntity: models.CsmSlotEntity, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + swapSlotWithProduction(resourceGroupName: string, name: string, slotSwapEntity: models.CsmSlotEntity, callback: ServiceCallback): void; + swapSlotWithProduction(resourceGroupName: string, name: string, slotSwapEntity: models.CsmSlotEntity, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Returns all Snapshots to the user. + * + * Returns all Snapshots to the user. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Website Name. + * + * @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. + */ + listSnapshotsWithHttpOperationResponse(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Returns all Snapshots to the user. + * + * Returns all Snapshots to the user. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Website Name. + * + * @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 {SnapshotCollection} - 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. + * + * {SnapshotCollection} [result] - The deserialized result object if an error did not occur. + * See {@link SnapshotCollection} 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. + */ + listSnapshots(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listSnapshots(resourceGroupName: string, name: string, callback: ServiceCallback): void; + listSnapshots(resourceGroupName: string, name: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Gets the source control configuration of an app. + * + * Gets the source control configuration of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @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. + */ + getSourceControlWithHttpOperationResponse(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets the source control configuration of an app. + * + * Gets the source control configuration of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @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 {SiteSourceControl} - 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. + * + * {SiteSourceControl} [result] - The deserialized result object if an error did not occur. + * See {@link SiteSourceControl} 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. + */ + getSourceControl(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getSourceControl(resourceGroupName: string, name: string, callback: ServiceCallback): void; + getSourceControl(resourceGroupName: string, name: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Updates the source control configuration of an app. + * + * Updates the source control configuration of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} siteSourceControl JSON representation of a SiteSourceControl + * object. See example. + * + * @param {string} [siteSourceControl.repoUrl] Repository or source control + * URL. + * + * @param {string} [siteSourceControl.branch] Name of branch to use for + * deployment. + * + * @param {boolean} [siteSourceControl.isManualIntegration] true + * to limit to manual integration; false to enable continuous + * integration (which configures webhooks into online repos like GitHub). + * + * @param {boolean} [siteSourceControl.deploymentRollbackEnabled] + * true to enable deployment rollback; otherwise, + * false. + * + * @param {boolean} [siteSourceControl.isMercurial] true for a + * Mercurial repository; false for a Git repository. + * + * @param {string} [siteSourceControl.kind] Kind of resource. + * + * @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. + */ + createOrUpdateSourceControlWithHttpOperationResponse(resourceGroupName: string, name: string, siteSourceControl: models.SiteSourceControl, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Updates the source control configuration of an app. + * + * Updates the source control configuration of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} siteSourceControl JSON representation of a SiteSourceControl + * object. See example. + * + * @param {string} [siteSourceControl.repoUrl] Repository or source control + * URL. + * + * @param {string} [siteSourceControl.branch] Name of branch to use for + * deployment. + * + * @param {boolean} [siteSourceControl.isManualIntegration] true + * to limit to manual integration; false to enable continuous + * integration (which configures webhooks into online repos like GitHub). + * + * @param {boolean} [siteSourceControl.deploymentRollbackEnabled] + * true to enable deployment rollback; otherwise, + * false. + * + * @param {boolean} [siteSourceControl.isMercurial] true for a + * Mercurial repository; false for a Git repository. + * + * @param {string} [siteSourceControl.kind] Kind of resource. + * + * @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 {SiteSourceControl} - 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. + * + * {SiteSourceControl} [result] - The deserialized result object if an error did not occur. + * See {@link SiteSourceControl} 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. + */ + createOrUpdateSourceControl(resourceGroupName: string, name: string, siteSourceControl: models.SiteSourceControl, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdateSourceControl(resourceGroupName: string, name: string, siteSourceControl: models.SiteSourceControl, callback: ServiceCallback): void; + createOrUpdateSourceControl(resourceGroupName: string, name: string, siteSourceControl: models.SiteSourceControl, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Deletes the source control configuration of an app. + * + * Deletes the source control configuration of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @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. + */ + deleteSourceControlWithHttpOperationResponse(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Deletes the source control configuration of an app. + * + * Deletes the source control configuration of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @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 {null} - 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. + * + * {null} [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. + */ + deleteSourceControl(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteSourceControl(resourceGroupName: string, name: string, callback: ServiceCallback): void; + deleteSourceControl(resourceGroupName: string, name: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Updates the source control configuration of an app. + * + * Updates the source control configuration of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} siteSourceControl JSON representation of a SiteSourceControl + * object. See example. + * + * @param {string} [siteSourceControl.repoUrl] Repository or source control + * URL. + * + * @param {string} [siteSourceControl.branch] Name of branch to use for + * deployment. + * + * @param {boolean} [siteSourceControl.isManualIntegration] true + * to limit to manual integration; false to enable continuous + * integration (which configures webhooks into online repos like GitHub). + * + * @param {boolean} [siteSourceControl.deploymentRollbackEnabled] + * true to enable deployment rollback; otherwise, + * false. + * + * @param {boolean} [siteSourceControl.isMercurial] true for a + * Mercurial repository; false for a Git repository. + * + * @param {string} [siteSourceControl.kind] Kind of resource. + * + * @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. + */ + updateSourceControlWithHttpOperationResponse(resourceGroupName: string, name: string, siteSourceControl: models.SiteSourceControl, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Updates the source control configuration of an app. + * + * Updates the source control configuration of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} siteSourceControl JSON representation of a SiteSourceControl + * object. See example. + * + * @param {string} [siteSourceControl.repoUrl] Repository or source control + * URL. + * + * @param {string} [siteSourceControl.branch] Name of branch to use for + * deployment. + * + * @param {boolean} [siteSourceControl.isManualIntegration] true + * to limit to manual integration; false to enable continuous + * integration (which configures webhooks into online repos like GitHub). + * + * @param {boolean} [siteSourceControl.deploymentRollbackEnabled] + * true to enable deployment rollback; otherwise, + * false. + * + * @param {boolean} [siteSourceControl.isMercurial] true for a + * Mercurial repository; false for a Git repository. + * + * @param {string} [siteSourceControl.kind] Kind of resource. + * + * @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 {SiteSourceControl} - 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. + * + * {SiteSourceControl} [result] - The deserialized result object if an error did not occur. + * See {@link SiteSourceControl} 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. + */ + updateSourceControl(resourceGroupName: string, name: string, siteSourceControl: models.SiteSourceControl, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + updateSourceControl(resourceGroupName: string, name: string, siteSourceControl: models.SiteSourceControl, callback: ServiceCallback): void; + updateSourceControl(resourceGroupName: string, name: string, siteSourceControl: models.SiteSourceControl, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Starts an app (or deployment slot, if specified). + * + * Starts an app (or deployment slot, if specified). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @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. + */ + startWithHttpOperationResponse(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Starts an app (or deployment slot, if specified). + * + * Starts an app (or deployment slot, if specified). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @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 {null} - 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. + * + * {null} [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. + */ + start(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + start(resourceGroupName: string, name: string, callback: ServiceCallback): void; + start(resourceGroupName: string, name: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Stops an app (or deployment slot, if specified). + * + * Stops an app (or deployment slot, if specified). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @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. + */ + stopWithHttpOperationResponse(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Stops an app (or deployment slot, if specified). + * + * Stops an app (or deployment slot, if specified). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @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 {null} - 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. + * + * {null} [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. + */ + stop(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + stop(resourceGroupName: string, name: string, callback: ServiceCallback): void; + stop(resourceGroupName: string, name: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Sync web app repository. + * + * Sync web app repository. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @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. + */ + syncRepositoryWithHttpOperationResponse(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Sync web app repository. + * + * Sync web app repository. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @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 {null} - 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. + * + * {null} [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. + */ + syncRepository(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + syncRepository(resourceGroupName: string, name: string, callback: ServiceCallback): void; + syncRepository(resourceGroupName: string, name: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Syncs function trigger metadata to the scale controller + * + * Syncs function trigger metadata to the scale controller + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @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. + */ + syncFunctionTriggersWithHttpOperationResponse(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Syncs function trigger metadata to the scale controller + * + * Syncs function trigger metadata to the scale controller + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @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 {null} - 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. + * + * {null} [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. + */ + syncFunctionTriggers(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + syncFunctionTriggers(resourceGroupName: string, name: string, callback: ServiceCallback): void; + syncFunctionTriggers(resourceGroupName: string, name: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary List triggered web jobs for an app, or a deployment slot. + * + * List triggered web jobs for an app, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @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. + */ + listTriggeredWebJobsWithHttpOperationResponse(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary List triggered web jobs for an app, or a deployment slot. + * + * List triggered web jobs for an app, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @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 {TriggeredWebJobCollection} - 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. + * + * {TriggeredWebJobCollection} [result] - The deserialized result object if an error did not occur. + * See {@link TriggeredWebJobCollection} 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. + */ + listTriggeredWebJobs(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listTriggeredWebJobs(resourceGroupName: string, name: string, callback: ServiceCallback): void; + listTriggeredWebJobs(resourceGroupName: string, name: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Gets a triggered web job by its ID for an app, or a deployment + * slot. + * + * Gets a triggered web job by its ID for an app, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} webJobName Name of Web Job. + * + * @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. + */ + getTriggeredWebJobWithHttpOperationResponse(resourceGroupName: string, name: string, webJobName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets a triggered web job by its ID for an app, or a deployment + * slot. + * + * Gets a triggered web job by its ID for an app, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} webJobName Name of Web Job. + * + * @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 {TriggeredWebJob} - 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. + * + * {TriggeredWebJob} [result] - The deserialized result object if an error did not occur. + * See {@link TriggeredWebJob} 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. + */ + getTriggeredWebJob(resourceGroupName: string, name: string, webJobName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getTriggeredWebJob(resourceGroupName: string, name: string, webJobName: string, callback: ServiceCallback): void; + getTriggeredWebJob(resourceGroupName: string, name: string, webJobName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Delete a triggered web job by its ID for an app, or a deployment + * slot. + * + * Delete a triggered web job by its ID for an app, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} webJobName Name of Web Job. + * + * @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. + */ + deleteTriggeredWebJobWithHttpOperationResponse(resourceGroupName: string, name: string, webJobName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Delete a triggered web job by its ID for an app, or a deployment + * slot. + * + * Delete a triggered web job by its ID for an app, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} webJobName Name of Web Job. + * + * @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 {null} - 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. + * + * {null} [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. + */ + deleteTriggeredWebJob(resourceGroupName: string, name: string, webJobName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteTriggeredWebJob(resourceGroupName: string, name: string, webJobName: string, callback: ServiceCallback): void; + deleteTriggeredWebJob(resourceGroupName: string, name: string, webJobName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary List a triggered web job's history for an app, or a deployment + * slot. + * + * List a triggered web job's history for an app, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} webJobName Name of Web Job. + * + * @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. + */ + listTriggeredWebJobHistoryWithHttpOperationResponse(resourceGroupName: string, name: string, webJobName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary List a triggered web job's history for an app, or a deployment + * slot. + * + * List a triggered web job's history for an app, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} webJobName Name of Web Job. + * + * @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 {TriggeredJobHistoryCollection} - 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. + * + * {TriggeredJobHistoryCollection} [result] - The deserialized result object if an error did not occur. + * See {@link TriggeredJobHistoryCollection} 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. + */ + listTriggeredWebJobHistory(resourceGroupName: string, name: string, webJobName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listTriggeredWebJobHistory(resourceGroupName: string, name: string, webJobName: string, callback: ServiceCallback): void; + listTriggeredWebJobHistory(resourceGroupName: string, name: string, webJobName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Gets a triggered web job's history by its ID for an app, , or a + * deployment slot. + * + * Gets a triggered web job's history by its ID for an app, , or a deployment + * slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} webJobName Name of Web Job. + * + * @param {string} id History ID. + * + * @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. + */ + getTriggeredWebJobHistoryWithHttpOperationResponse(resourceGroupName: string, name: string, webJobName: string, id: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets a triggered web job's history by its ID for an app, , or a + * deployment slot. + * + * Gets a triggered web job's history by its ID for an app, , or a deployment + * slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} webJobName Name of Web Job. + * + * @param {string} id History ID. + * + * @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 {TriggeredJobHistory} - 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. + * + * {TriggeredJobHistory} [result] - The deserialized result object if an error did not occur. + * See {@link TriggeredJobHistory} 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. + */ + getTriggeredWebJobHistory(resourceGroupName: string, name: string, webJobName: string, id: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getTriggeredWebJobHistory(resourceGroupName: string, name: string, webJobName: string, id: string, callback: ServiceCallback): void; + getTriggeredWebJobHistory(resourceGroupName: string, name: string, webJobName: string, id: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Run a triggered web job for an app, or a deployment slot. + * + * Run a triggered web job for an app, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} webJobName Name of Web Job. + * + * @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. + */ + runTriggeredWebJobWithHttpOperationResponse(resourceGroupName: string, name: string, webJobName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Run a triggered web job for an app, or a deployment slot. + * + * Run a triggered web job for an app, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} webJobName Name of Web Job. + * + * @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 {null} - 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. + * + * {null} [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. + */ + runTriggeredWebJob(resourceGroupName: string, name: string, webJobName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + runTriggeredWebJob(resourceGroupName: string, name: string, webJobName: string, callback: ServiceCallback): void; + runTriggeredWebJob(resourceGroupName: string, name: string, webJobName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Gets the quota usage information of an app (or deployment slot, if + * specified). + * + * Gets the quota usage information of an app (or deployment slot, if + * specified). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.filter] Return only information specified in the + * filter (using OData syntax). For example: $filter=(name.value eq 'Metric1' + * or name.value eq 'Metric2') and startTime eq 2014-01-01T00:00:00Z and + * endTime eq 2014-12-31T23:59:59Z and timeGrain eq + * duration'[Hour|Minute|Day]'. + * + * @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. + */ + listUsagesWithHttpOperationResponse(resourceGroupName: string, name: string, options?: { filter? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets the quota usage information of an app (or deployment slot, if + * specified). + * + * Gets the quota usage information of an app (or deployment slot, if + * specified). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.filter] Return only information specified in the + * filter (using OData syntax). For example: $filter=(name.value eq 'Metric1' + * or name.value eq 'Metric2') and startTime eq 2014-01-01T00:00:00Z and + * endTime eq 2014-12-31T23:59:59Z and timeGrain eq + * duration'[Hour|Minute|Day]'. + * + * @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 {CsmUsageQuotaCollection} - 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. + * + * {CsmUsageQuotaCollection} [result] - The deserialized result object if an error did not occur. + * See {@link CsmUsageQuotaCollection} 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. + */ + listUsages(resourceGroupName: string, name: string, options?: { filter? : string, customHeaders? : { [headerName: string]: string; } }): Promise; + listUsages(resourceGroupName: string, name: string, callback: ServiceCallback): void; + listUsages(resourceGroupName: string, name: string, options: { filter? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Gets the virtual networks the app (or deployment slot) is connected + * to. + * + * Gets the virtual networks the app (or deployment slot) is connected to. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @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. + */ + listVnetConnectionsWithHttpOperationResponse(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets the virtual networks the app (or deployment slot) is connected + * to. + * + * Gets the virtual networks the app (or deployment slot) is connected to. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @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. + */ + listVnetConnections(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listVnetConnections(resourceGroupName: string, name: string, callback: ServiceCallback): void; + listVnetConnections(resourceGroupName: string, name: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Gets a virtual network the app (or deployment slot) is connected to + * by name. + * + * Gets a virtual network the app (or deployment slot) is connected to by name. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} vnetName Name of the virtual network. + * + * @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. + */ + getVnetConnectionWithHttpOperationResponse(resourceGroupName: string, name: string, vnetName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets a virtual network the app (or deployment slot) is connected to + * by name. + * + * Gets a virtual network the app (or deployment slot) is connected to by name. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} vnetName Name of the virtual network. + * + * @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 {VnetInfo} - 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. + * + * {VnetInfo} [result] - The deserialized result object if an error did not occur. + * See {@link VnetInfo} 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. + */ + getVnetConnection(resourceGroupName: string, name: string, vnetName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getVnetConnection(resourceGroupName: string, name: string, vnetName: string, callback: ServiceCallback): void; + getVnetConnection(resourceGroupName: string, name: string, vnetName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Adds a Virtual Network connection to an app or slot (PUT) or + * updates the connection properties (PATCH). + * + * Adds a Virtual Network connection to an app or slot (PUT) or updates the + * connection properties (PATCH). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} vnetName Name of an existing Virtual Network. + * + * @param {object} connectionEnvelope Properties of the Virtual Network + * connection. See example. + * + * @param {string} [connectionEnvelope.vnetResourceId] The Virtual Network's + * resource ID. + * + * @param {buffer} [connectionEnvelope.certBlob] A certificate file (.cer) blob + * containing the public key of the private key used to authenticate a + * Point-To-Site VPN connection. + * + * @param {string} [connectionEnvelope.dnsServers] DNS servers to be used by + * this Virtual Network. This should be a comma-separated list of IP addresses. + * + * @param {string} [connectionEnvelope.kind] Kind of resource. + * + * @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. + */ + createOrUpdateVnetConnectionWithHttpOperationResponse(resourceGroupName: string, name: string, vnetName: string, connectionEnvelope: models.VnetInfo, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Adds a Virtual Network connection to an app or slot (PUT) or + * updates the connection properties (PATCH). + * + * Adds a Virtual Network connection to an app or slot (PUT) or updates the + * connection properties (PATCH). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} vnetName Name of an existing Virtual Network. + * + * @param {object} connectionEnvelope Properties of the Virtual Network + * connection. See example. + * + * @param {string} [connectionEnvelope.vnetResourceId] The Virtual Network's + * resource ID. + * + * @param {buffer} [connectionEnvelope.certBlob] A certificate file (.cer) blob + * containing the public key of the private key used to authenticate a + * Point-To-Site VPN connection. + * + * @param {string} [connectionEnvelope.dnsServers] DNS servers to be used by + * this Virtual Network. This should be a comma-separated list of IP addresses. + * + * @param {string} [connectionEnvelope.kind] Kind of resource. + * + * @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 {VnetInfo} - 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. + * + * {VnetInfo} [result] - The deserialized result object if an error did not occur. + * See {@link VnetInfo} 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. + */ + createOrUpdateVnetConnection(resourceGroupName: string, name: string, vnetName: string, connectionEnvelope: models.VnetInfo, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdateVnetConnection(resourceGroupName: string, name: string, vnetName: string, connectionEnvelope: models.VnetInfo, callback: ServiceCallback): void; + createOrUpdateVnetConnection(resourceGroupName: string, name: string, vnetName: string, connectionEnvelope: models.VnetInfo, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Deletes a connection from an app (or deployment slot to a named + * virtual network. + * + * Deletes a connection from an app (or deployment slot to a named virtual + * network. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} vnetName Name of the virtual network. + * + * @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. + */ + deleteVnetConnectionWithHttpOperationResponse(resourceGroupName: string, name: string, vnetName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Deletes a connection from an app (or deployment slot to a named + * virtual network. + * + * Deletes a connection from an app (or deployment slot to a named virtual + * network. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} vnetName Name of the virtual network. + * + * @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 {null} - 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. + * + * {null} [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. + */ + deleteVnetConnection(resourceGroupName: string, name: string, vnetName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteVnetConnection(resourceGroupName: string, name: string, vnetName: string, callback: ServiceCallback): void; + deleteVnetConnection(resourceGroupName: string, name: string, vnetName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Adds a Virtual Network connection to an app or slot (PUT) or + * updates the connection properties (PATCH). + * + * Adds a Virtual Network connection to an app or slot (PUT) or updates the + * connection properties (PATCH). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} vnetName Name of an existing Virtual Network. + * + * @param {object} connectionEnvelope Properties of the Virtual Network + * connection. See example. + * + * @param {string} [connectionEnvelope.vnetResourceId] The Virtual Network's + * resource ID. + * + * @param {buffer} [connectionEnvelope.certBlob] A certificate file (.cer) blob + * containing the public key of the private key used to authenticate a + * Point-To-Site VPN connection. + * + * @param {string} [connectionEnvelope.dnsServers] DNS servers to be used by + * this Virtual Network. This should be a comma-separated list of IP addresses. + * + * @param {string} [connectionEnvelope.kind] Kind of resource. + * + * @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. + */ + updateVnetConnectionWithHttpOperationResponse(resourceGroupName: string, name: string, vnetName: string, connectionEnvelope: models.VnetInfo, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Adds a Virtual Network connection to an app or slot (PUT) or + * updates the connection properties (PATCH). + * + * Adds a Virtual Network connection to an app or slot (PUT) or updates the + * connection properties (PATCH). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} vnetName Name of an existing Virtual Network. + * + * @param {object} connectionEnvelope Properties of the Virtual Network + * connection. See example. + * + * @param {string} [connectionEnvelope.vnetResourceId] The Virtual Network's + * resource ID. + * + * @param {buffer} [connectionEnvelope.certBlob] A certificate file (.cer) blob + * containing the public key of the private key used to authenticate a + * Point-To-Site VPN connection. + * + * @param {string} [connectionEnvelope.dnsServers] DNS servers to be used by + * this Virtual Network. This should be a comma-separated list of IP addresses. + * + * @param {string} [connectionEnvelope.kind] Kind of resource. + * + * @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 {VnetInfo} - 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. + * + * {VnetInfo} [result] - The deserialized result object if an error did not occur. + * See {@link VnetInfo} 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. + */ + updateVnetConnection(resourceGroupName: string, name: string, vnetName: string, connectionEnvelope: models.VnetInfo, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + updateVnetConnection(resourceGroupName: string, name: string, vnetName: string, connectionEnvelope: models.VnetInfo, callback: ServiceCallback): void; + updateVnetConnection(resourceGroupName: string, name: string, vnetName: string, connectionEnvelope: models.VnetInfo, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Gets an app's Virtual Network gateway. + * + * Gets an app's Virtual Network gateway. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} vnetName Name of the Virtual Network. + * + * @param {string} gatewayName Name of the gateway. Currently, the only + * supported string is "primary". + * + * @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. + */ + getVnetConnectionGatewayWithHttpOperationResponse(resourceGroupName: string, name: string, vnetName: string, gatewayName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets an app's Virtual Network gateway. + * + * Gets an app's Virtual Network gateway. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} vnetName Name of the Virtual Network. + * + * @param {string} gatewayName Name of the gateway. Currently, the only + * supported string is "primary". + * + * @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 {VnetGateway} - 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. + * + * {VnetGateway} [result] - The deserialized result object if an error did not occur. + * See {@link VnetGateway} 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. + */ + getVnetConnectionGateway(resourceGroupName: string, name: string, vnetName: string, gatewayName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getVnetConnectionGateway(resourceGroupName: string, name: string, vnetName: string, gatewayName: string, callback: ServiceCallback): void; + getVnetConnectionGateway(resourceGroupName: string, name: string, vnetName: string, gatewayName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Adds a gateway to a connected Virtual Network (PUT) or updates it + * (PATCH). + * + * Adds a gateway to a connected Virtual Network (PUT) or updates it (PATCH). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} vnetName Name of the Virtual Network. + * + * @param {string} gatewayName Name of the gateway. Currently, the only + * supported string is "primary". + * + * @param {object} connectionEnvelope The properties to update this gateway + * with. + * + * @param {string} [connectionEnvelope.vnetName] The Virtual Network name. + * + * @param {string} connectionEnvelope.vpnPackageUri The URI where the VPN + * package can be downloaded. + * + * @param {string} [connectionEnvelope.kind] Kind of resource. + * + * @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. + */ + createOrUpdateVnetConnectionGatewayWithHttpOperationResponse(resourceGroupName: string, name: string, vnetName: string, gatewayName: string, connectionEnvelope: models.VnetGateway, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Adds a gateway to a connected Virtual Network (PUT) or updates it + * (PATCH). + * + * Adds a gateway to a connected Virtual Network (PUT) or updates it (PATCH). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} vnetName Name of the Virtual Network. + * + * @param {string} gatewayName Name of the gateway. Currently, the only + * supported string is "primary". + * + * @param {object} connectionEnvelope The properties to update this gateway + * with. + * + * @param {string} [connectionEnvelope.vnetName] The Virtual Network name. + * + * @param {string} connectionEnvelope.vpnPackageUri The URI where the VPN + * package can be downloaded. + * + * @param {string} [connectionEnvelope.kind] Kind of resource. + * + * @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 {VnetGateway} - 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. + * + * {VnetGateway} [result] - The deserialized result object if an error did not occur. + * See {@link VnetGateway} 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. + */ + createOrUpdateVnetConnectionGateway(resourceGroupName: string, name: string, vnetName: string, gatewayName: string, connectionEnvelope: models.VnetGateway, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdateVnetConnectionGateway(resourceGroupName: string, name: string, vnetName: string, gatewayName: string, connectionEnvelope: models.VnetGateway, callback: ServiceCallback): void; + createOrUpdateVnetConnectionGateway(resourceGroupName: string, name: string, vnetName: string, gatewayName: string, connectionEnvelope: models.VnetGateway, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Adds a gateway to a connected Virtual Network (PUT) or updates it + * (PATCH). + * + * Adds a gateway to a connected Virtual Network (PUT) or updates it (PATCH). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} vnetName Name of the Virtual Network. + * + * @param {string} gatewayName Name of the gateway. Currently, the only + * supported string is "primary". + * + * @param {object} connectionEnvelope The properties to update this gateway + * with. + * + * @param {string} [connectionEnvelope.vnetName] The Virtual Network name. + * + * @param {string} connectionEnvelope.vpnPackageUri The URI where the VPN + * package can be downloaded. + * + * @param {string} [connectionEnvelope.kind] Kind of resource. + * + * @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. + */ + updateVnetConnectionGatewayWithHttpOperationResponse(resourceGroupName: string, name: string, vnetName: string, gatewayName: string, connectionEnvelope: models.VnetGateway, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Adds a gateway to a connected Virtual Network (PUT) or updates it + * (PATCH). + * + * Adds a gateway to a connected Virtual Network (PUT) or updates it (PATCH). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} vnetName Name of the Virtual Network. + * + * @param {string} gatewayName Name of the gateway. Currently, the only + * supported string is "primary". + * + * @param {object} connectionEnvelope The properties to update this gateway + * with. + * + * @param {string} [connectionEnvelope.vnetName] The Virtual Network name. + * + * @param {string} connectionEnvelope.vpnPackageUri The URI where the VPN + * package can be downloaded. + * + * @param {string} [connectionEnvelope.kind] Kind of resource. + * + * @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 {VnetGateway} - 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. + * + * {VnetGateway} [result] - The deserialized result object if an error did not occur. + * See {@link VnetGateway} 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. + */ + updateVnetConnectionGateway(resourceGroupName: string, name: string, vnetName: string, gatewayName: string, connectionEnvelope: models.VnetGateway, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + updateVnetConnectionGateway(resourceGroupName: string, name: string, vnetName: string, gatewayName: string, connectionEnvelope: models.VnetGateway, callback: ServiceCallback): void; + updateVnetConnectionGateway(resourceGroupName: string, name: string, vnetName: string, gatewayName: string, connectionEnvelope: models.VnetGateway, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary List webjobs for an app, or a deployment slot. + * + * List webjobs for an app, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @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. + */ + listWebJobsWithHttpOperationResponse(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary List webjobs for an app, or a deployment slot. + * + * List webjobs for an app, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @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 {WebJobCollection} - 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. + * + * {WebJobCollection} [result] - The deserialized result object if an error did not occur. + * See {@link WebJobCollection} 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. + */ + listWebJobs(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listWebJobs(resourceGroupName: string, name: string, callback: ServiceCallback): void; + listWebJobs(resourceGroupName: string, name: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Get webjob information for an app, or a deployment slot. + * + * Get webjob information for an app, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} webJobName Name of the web job. + * + * @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. + */ + getWebJobWithHttpOperationResponse(resourceGroupName: string, name: string, webJobName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get webjob information for an app, or a deployment slot. + * + * Get webjob information for an app, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} webJobName Name of the web job. + * + * @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 {WebJob} - 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. + * + * {WebJob} [result] - The deserialized result object if an error did not occur. + * See {@link WebJob} 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. + */ + getWebJob(resourceGroupName: string, name: string, webJobName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getWebJob(resourceGroupName: string, name: string, webJobName: string, callback: ServiceCallback): void; + getWebJob(resourceGroupName: string, name: string, webJobName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Creates a new web, mobile, or API app in an existing resource + * group, or updates an existing app. + * + * Creates a new web, mobile, or API app in an existing resource group, or + * updates an existing app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Unique name of the app to create or update. To create + * or update a deployment slot, use the {slot} parameter. + * + * @param {object} siteEnvelope A JSON representation of the app properties. + * See example. + * + * @param {boolean} [siteEnvelope.enabled] true if the app is + * enabled; otherwise, false. Setting this value to false disables + * the app (takes the app offline). + * + * @param {array} [siteEnvelope.hostNameSslStates] Hostname SSL states are used + * to manage the SSL bindings for app's hostnames. + * + * @param {string} [siteEnvelope.serverFarmId] Resource ID of the associated + * App Service plan, formatted as: + * "/subscriptions/{subscriptionID}/resourceGroups/{groupName}/providers/Microsoft.Web/serverfarms/{appServicePlanName}". + * + * @param {boolean} [siteEnvelope.reserved] true if reserved; + * otherwise, false. + * + * @param {boolean} [siteEnvelope.isXenon] Obsolete: Hyper-V sandbox. + * + * @param {boolean} [siteEnvelope.hyperV] Hyper-V sandbox. + * + * @param {object} [siteEnvelope.siteConfig] Configuration of the app. + * + * @param {number} [siteEnvelope.siteConfig.numberOfWorkers] Number of workers. + * + * @param {array} [siteEnvelope.siteConfig.defaultDocuments] Default documents. + * + * @param {string} [siteEnvelope.siteConfig.netFrameworkVersion] .NET Framework + * version. + * + * @param {string} [siteEnvelope.siteConfig.phpVersion] Version of PHP. + * + * @param {string} [siteEnvelope.siteConfig.pythonVersion] Version of Python. + * + * @param {string} [siteEnvelope.siteConfig.nodeVersion] Version of Node.js. + * + * @param {string} [siteEnvelope.siteConfig.linuxFxVersion] Linux App Framework + * and version + * + * @param {string} [siteEnvelope.siteConfig.windowsFxVersion] Xenon App + * Framework and version + * + * @param {boolean} [siteEnvelope.siteConfig.requestTracingEnabled] + * true if request tracing is enabled; otherwise, + * false. + * + * @param {date} [siteEnvelope.siteConfig.requestTracingExpirationTime] Request + * tracing expiration time. + * + * @param {boolean} [siteEnvelope.siteConfig.remoteDebuggingEnabled] + * true if remote debugging is enabled; otherwise, + * false. + * + * @param {string} [siteEnvelope.siteConfig.remoteDebuggingVersion] Remote + * debugging version. + * + * @param {boolean} [siteEnvelope.siteConfig.httpLoggingEnabled] + * true if HTTP logging is enabled; otherwise, false. + * + * @param {number} [siteEnvelope.siteConfig.logsDirectorySizeLimit] HTTP logs + * directory size limit. + * + * @param {boolean} [siteEnvelope.siteConfig.detailedErrorLoggingEnabled] + * true if detailed error logging is enabled; otherwise, + * false. + * + * @param {string} [siteEnvelope.siteConfig.publishingUsername] Publishing user + * name. + * + * @param {array} [siteEnvelope.siteConfig.appSettings] Application settings. + * + * @param {object} [siteEnvelope.siteConfig.azureStorageAccounts] User-provided + * Azure storage accounts. + * + * @param {array} [siteEnvelope.siteConfig.connectionStrings] Connection + * strings. + * + * @param {array} [siteEnvelope.siteConfig.handlerMappings] Handler mappings. + * + * @param {string} [siteEnvelope.siteConfig.documentRoot] Document root. + * + * @param {string} [siteEnvelope.siteConfig.scmType] SCM type. Possible values + * include: 'None', 'Dropbox', 'Tfs', 'LocalGit', 'GitHub', 'CodePlexGit', + * 'CodePlexHg', 'BitbucketGit', 'BitbucketHg', 'ExternalGit', 'ExternalHg', + * 'OneDrive', 'VSO' + * + * @param {boolean} [siteEnvelope.siteConfig.use32BitWorkerProcess] + * true to use 32-bit worker process; otherwise, + * false. + * + * @param {boolean} [siteEnvelope.siteConfig.webSocketsEnabled] + * true if WebSocket is enabled; otherwise, false. + * + * @param {boolean} [siteEnvelope.siteConfig.alwaysOn] true if + * Always On is enabled; otherwise, false. + * + * @param {string} [siteEnvelope.siteConfig.javaVersion] Java version. + * + * @param {string} [siteEnvelope.siteConfig.javaContainer] Java container. + * + * @param {string} [siteEnvelope.siteConfig.javaContainerVersion] Java + * container version. + * + * @param {string} [siteEnvelope.siteConfig.appCommandLine] App command line to + * launch. + * + * @param {string} [siteEnvelope.siteConfig.managedPipelineMode] Managed + * pipeline mode. Possible values include: 'Integrated', 'Classic' + * + * @param {array} [siteEnvelope.siteConfig.virtualApplications] Virtual + * applications. + * + * @param {string} [siteEnvelope.siteConfig.loadBalancing] Site load balancing. + * Possible values include: 'WeightedRoundRobin', 'LeastRequests', + * 'LeastResponseTime', 'WeightedTotalTraffic', 'RequestHash' + * + * @param {object} [siteEnvelope.siteConfig.experiments] This is work around + * for polymophic types. + * + * @param {array} [siteEnvelope.siteConfig.experiments.rampUpRules] List of + * ramp-up rules. + * + * @param {object} [siteEnvelope.siteConfig.limits] Site limits. + * + * @param {number} [siteEnvelope.siteConfig.limits.maxPercentageCpu] Maximum + * allowed CPU usage percentage. + * + * @param {number} [siteEnvelope.siteConfig.limits.maxMemoryInMb] Maximum + * allowed memory usage in MB. + * + * @param {number} [siteEnvelope.siteConfig.limits.maxDiskSizeInMb] Maximum + * allowed disk size usage in MB. + * + * @param {boolean} [siteEnvelope.siteConfig.autoHealEnabled] true + * if Auto Heal is enabled; otherwise, false. + * + * @param {object} [siteEnvelope.siteConfig.autoHealRules] Auto Heal rules. + * + * @param {object} [siteEnvelope.siteConfig.autoHealRules.triggers] Conditions + * that describe when to execute the auto-heal actions. + * + * @param {object} [siteEnvelope.siteConfig.autoHealRules.triggers.requests] A + * rule based on total requests. + * + * @param {number} + * [siteEnvelope.siteConfig.autoHealRules.triggers.requests.count] Request + * Count. + * + * @param {string} + * [siteEnvelope.siteConfig.autoHealRules.triggers.requests.timeInterval] Time + * interval. + * + * @param {number} + * [siteEnvelope.siteConfig.autoHealRules.triggers.privateBytesInKB] A rule + * based on private bytes. + * + * @param {array} [siteEnvelope.siteConfig.autoHealRules.triggers.statusCodes] + * A rule based on status codes. + * + * @param {object} + * [siteEnvelope.siteConfig.autoHealRules.triggers.slowRequests] A rule based + * on request execution time. + * + * @param {string} + * [siteEnvelope.siteConfig.autoHealRules.triggers.slowRequests.timeTaken] Time + * taken. + * + * @param {number} + * [siteEnvelope.siteConfig.autoHealRules.triggers.slowRequests.count] Request + * Count. + * + * @param {string} + * [siteEnvelope.siteConfig.autoHealRules.triggers.slowRequests.timeInterval] + * Time interval. + * + * @param {object} [siteEnvelope.siteConfig.autoHealRules.actions] Actions to + * be executed when a rule is triggered. + * + * @param {string} [siteEnvelope.siteConfig.autoHealRules.actions.actionType] + * Predefined action to be taken. Possible values include: 'Recycle', + * 'LogEvent', 'CustomAction' + * + * @param {object} [siteEnvelope.siteConfig.autoHealRules.actions.customAction] + * Custom action to be taken. + * + * @param {string} + * [siteEnvelope.siteConfig.autoHealRules.actions.customAction.exe] Executable + * to be run. + * + * @param {string} + * [siteEnvelope.siteConfig.autoHealRules.actions.customAction.parameters] + * Parameters for the executable. + * + * @param {string} + * [siteEnvelope.siteConfig.autoHealRules.actions.minProcessExecutionTime] + * Minimum time the process must execute + * before taking the action + * + * @param {string} [siteEnvelope.siteConfig.tracingOptions] Tracing options. + * + * @param {string} [siteEnvelope.siteConfig.vnetName] Virtual Network name. + * + * @param {object} [siteEnvelope.siteConfig.cors] Cross-Origin Resource Sharing + * (CORS) settings. + * + * @param {array} [siteEnvelope.siteConfig.cors.allowedOrigins] Gets or sets + * the list of origins that should be allowed to make cross-origin + * calls (for example: http://example.com:12345). Use "*" to allow all. + * + * @param {object} [siteEnvelope.siteConfig.push] Push endpoint settings. + * + * @param {boolean} siteEnvelope.siteConfig.push.isPushEnabled Gets or sets a + * flag indicating whether the Push endpoint is enabled. + * + * @param {string} [siteEnvelope.siteConfig.push.tagWhitelistJson] Gets or sets + * a JSON string containing a list of tags that are whitelisted for use by the + * push registration endpoint. + * + * @param {string} [siteEnvelope.siteConfig.push.tagsRequiringAuth] Gets or + * sets a JSON string containing a list of tags that require user + * authentication to be used in the push registration endpoint. + * Tags can consist of alphanumeric characters and the following: + * '_', '@', '#', '.', ':', '-'. + * Validation should be performed at the PushRequestHandler. + * + * @param {string} [siteEnvelope.siteConfig.push.dynamicTagsJson] Gets or sets + * a JSON string containing a list of dynamic tags that will be evaluated from + * user claims in the push registration endpoint. + * + * @param {string} [siteEnvelope.siteConfig.push.kind] Kind of resource. + * + * @param {object} [siteEnvelope.siteConfig.apiDefinition] Information about + * the formal API definition for the app. + * + * @param {string} [siteEnvelope.siteConfig.apiDefinition.url] The URL of the + * API definition. + * + * @param {string} [siteEnvelope.siteConfig.autoSwapSlotName] Auto-swap slot + * name. + * + * @param {boolean} [siteEnvelope.siteConfig.localMySqlEnabled] + * true to enable local MySQL; otherwise, false. + * + * @param {number} [siteEnvelope.siteConfig.managedServiceIdentityId] Managed + * Service Identity Id + * + * @param {number} [siteEnvelope.siteConfig.xManagedServiceIdentityId] Explicit + * Managed Service Identity Id + * + * @param {array} [siteEnvelope.siteConfig.ipSecurityRestrictions] IP security + * restrictions. + * + * @param {boolean} [siteEnvelope.siteConfig.http20Enabled] Http20Enabled: + * configures a web site to allow clients to connect over http2.0 + * + * @param {string} [siteEnvelope.siteConfig.minTlsVersion] MinTlsVersion: + * configures the minimum version of TLS required for SSL requests. Possible + * values include: '1.0', '1.1', '1.2' + * + * @param {string} [siteEnvelope.siteConfig.ftpsState] State of FTP / FTPS + * service. Possible values include: 'AllAllowed', 'FtpsOnly', 'Disabled' + * + * @param {number} [siteEnvelope.siteConfig.reservedInstanceCount] Number of + * reserved instances. + * This setting only applies to the Consumption Plan + * + * @param {boolean} [siteEnvelope.scmSiteAlsoStopped] true to stop + * SCM (KUDU) site when the app is stopped; otherwise, false. The + * default is false. + * + * @param {object} [siteEnvelope.hostingEnvironmentProfile] App Service + * Environment to use for the app. + * + * @param {string} [siteEnvelope.hostingEnvironmentProfile.id] Resource ID of + * the App Service Environment. + * + * @param {boolean} [siteEnvelope.clientAffinityEnabled] true to + * enable client affinity; false to stop sending session affinity + * cookies, which route client requests in the same session to the same + * instance. Default is true. + * + * @param {boolean} [siteEnvelope.clientCertEnabled] true to + * enable client certificate authentication (TLS mutual authentication); + * otherwise, false. Default is false. + * + * @param {boolean} [siteEnvelope.hostNamesDisabled] true to + * disable the public hostnames of the app; otherwise, false. + * If true, the app is only accessible via API management process. + * + * @param {number} [siteEnvelope.containerSize] Size of the function container. + * + * @param {number} [siteEnvelope.dailyMemoryTimeQuota] Maximum allowed daily + * memory-time quota (applicable on dynamic apps only). + * + * @param {object} [siteEnvelope.cloningInfo] If specified during app creation, + * the app is cloned from a source app. + * + * @param {uuid} [siteEnvelope.cloningInfo.correlationId] Correlation ID of + * cloning operation. This ID ties multiple cloning operations + * together to use the same snapshot. + * + * @param {boolean} [siteEnvelope.cloningInfo.overwrite] true to + * overwrite destination app; otherwise, false. + * + * @param {boolean} [siteEnvelope.cloningInfo.cloneCustomHostNames] + * true to clone custom hostnames from source app; otherwise, + * false. + * + * @param {boolean} [siteEnvelope.cloningInfo.cloneSourceControl] + * true to clone source control from source app; otherwise, + * false. + * + * @param {string} siteEnvelope.cloningInfo.sourceWebAppId ARM resource ID of + * the source app. App resource ID is of the form + * /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName} + * for production slots and + * /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/slots/{slotName} + * for other slots. + * + * @param {string} [siteEnvelope.cloningInfo.hostingEnvironment] App Service + * Environment. + * + * @param {object} [siteEnvelope.cloningInfo.appSettingsOverrides] Application + * setting overrides for cloned app. If specified, these settings override the + * settings cloned + * from source app. Otherwise, application settings from source app are + * retained. + * + * @param {boolean} [siteEnvelope.cloningInfo.configureLoadBalancing] + * true to configure load balancing for source and destination + * app. + * + * @param {string} [siteEnvelope.cloningInfo.trafficManagerProfileId] ARM + * resource ID of the Traffic Manager profile to use, if it exists. Traffic + * Manager resource ID is of the form + * /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/trafficManagerProfiles/{profileName}. + * + * @param {string} [siteEnvelope.cloningInfo.trafficManagerProfileName] Name of + * Traffic Manager profile to create. This is only needed if Traffic Manager + * profile does not already exist. + * + * @param {boolean} [siteEnvelope.httpsOnly] HttpsOnly: configures a web site + * to accept only https requests. Issues redirect for + * http requests + * + * @param {object} [siteEnvelope.identity] + * + * @param {string} [siteEnvelope.identity.type] Type of managed service + * identity. Possible values include: 'SystemAssigned', 'UserAssigned' + * + * @param {array} [siteEnvelope.identity.identityIds] Array of UserAssigned + * managed service identities. + * + * @param {string} [siteEnvelope.kind] Kind of resource. + * + * @param {string} siteEnvelope.location Resource Location. + * + * @param {object} [siteEnvelope.tags] Resource tags. + * + * @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. + */ + 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 + * group, or updates an existing app. + * + * Creates a new web, mobile, or API app in an existing resource group, or + * updates an existing app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Unique name of the app to create or update. To create + * or update a deployment slot, use the {slot} parameter. + * + * @param {object} siteEnvelope A JSON representation of the app properties. + * See example. + * + * @param {boolean} [siteEnvelope.enabled] true if the app is + * enabled; otherwise, false. Setting this value to false disables + * the app (takes the app offline). + * + * @param {array} [siteEnvelope.hostNameSslStates] Hostname SSL states are used + * to manage the SSL bindings for app's hostnames. + * + * @param {string} [siteEnvelope.serverFarmId] Resource ID of the associated + * App Service plan, formatted as: + * "/subscriptions/{subscriptionID}/resourceGroups/{groupName}/providers/Microsoft.Web/serverfarms/{appServicePlanName}". + * + * @param {boolean} [siteEnvelope.reserved] true if reserved; + * otherwise, false. + * + * @param {boolean} [siteEnvelope.isXenon] Obsolete: Hyper-V sandbox. + * + * @param {boolean} [siteEnvelope.hyperV] Hyper-V sandbox. + * + * @param {object} [siteEnvelope.siteConfig] Configuration of the app. + * + * @param {number} [siteEnvelope.siteConfig.numberOfWorkers] Number of workers. + * + * @param {array} [siteEnvelope.siteConfig.defaultDocuments] Default documents. + * + * @param {string} [siteEnvelope.siteConfig.netFrameworkVersion] .NET Framework + * version. + * + * @param {string} [siteEnvelope.siteConfig.phpVersion] Version of PHP. + * + * @param {string} [siteEnvelope.siteConfig.pythonVersion] Version of Python. + * + * @param {string} [siteEnvelope.siteConfig.nodeVersion] Version of Node.js. + * + * @param {string} [siteEnvelope.siteConfig.linuxFxVersion] Linux App Framework + * and version + * + * @param {string} [siteEnvelope.siteConfig.windowsFxVersion] Xenon App + * Framework and version + * + * @param {boolean} [siteEnvelope.siteConfig.requestTracingEnabled] + * true if request tracing is enabled; otherwise, + * false. + * + * @param {date} [siteEnvelope.siteConfig.requestTracingExpirationTime] Request + * tracing expiration time. + * + * @param {boolean} [siteEnvelope.siteConfig.remoteDebuggingEnabled] + * true if remote debugging is enabled; otherwise, + * false. + * + * @param {string} [siteEnvelope.siteConfig.remoteDebuggingVersion] Remote + * debugging version. + * + * @param {boolean} [siteEnvelope.siteConfig.httpLoggingEnabled] + * true if HTTP logging is enabled; otherwise, false. + * + * @param {number} [siteEnvelope.siteConfig.logsDirectorySizeLimit] HTTP logs + * directory size limit. + * + * @param {boolean} [siteEnvelope.siteConfig.detailedErrorLoggingEnabled] + * true if detailed error logging is enabled; otherwise, + * false. + * + * @param {string} [siteEnvelope.siteConfig.publishingUsername] Publishing user + * name. + * + * @param {array} [siteEnvelope.siteConfig.appSettings] Application settings. + * + * @param {object} [siteEnvelope.siteConfig.azureStorageAccounts] User-provided + * Azure storage accounts. + * + * @param {array} [siteEnvelope.siteConfig.connectionStrings] Connection + * strings. + * + * @param {array} [siteEnvelope.siteConfig.handlerMappings] Handler mappings. + * + * @param {string} [siteEnvelope.siteConfig.documentRoot] Document root. + * + * @param {string} [siteEnvelope.siteConfig.scmType] SCM type. Possible values + * include: 'None', 'Dropbox', 'Tfs', 'LocalGit', 'GitHub', 'CodePlexGit', + * 'CodePlexHg', 'BitbucketGit', 'BitbucketHg', 'ExternalGit', 'ExternalHg', + * 'OneDrive', 'VSO' + * + * @param {boolean} [siteEnvelope.siteConfig.use32BitWorkerProcess] + * true to use 32-bit worker process; otherwise, + * false. + * + * @param {boolean} [siteEnvelope.siteConfig.webSocketsEnabled] + * true if WebSocket is enabled; otherwise, false. + * + * @param {boolean} [siteEnvelope.siteConfig.alwaysOn] true if + * Always On is enabled; otherwise, false. + * + * @param {string} [siteEnvelope.siteConfig.javaVersion] Java version. + * + * @param {string} [siteEnvelope.siteConfig.javaContainer] Java container. + * + * @param {string} [siteEnvelope.siteConfig.javaContainerVersion] Java + * container version. + * + * @param {string} [siteEnvelope.siteConfig.appCommandLine] App command line to + * launch. + * + * @param {string} [siteEnvelope.siteConfig.managedPipelineMode] Managed + * pipeline mode. Possible values include: 'Integrated', 'Classic' + * + * @param {array} [siteEnvelope.siteConfig.virtualApplications] Virtual + * applications. + * + * @param {string} [siteEnvelope.siteConfig.loadBalancing] Site load balancing. + * Possible values include: 'WeightedRoundRobin', 'LeastRequests', + * 'LeastResponseTime', 'WeightedTotalTraffic', 'RequestHash' + * + * @param {object} [siteEnvelope.siteConfig.experiments] This is work around + * for polymophic types. + * + * @param {array} [siteEnvelope.siteConfig.experiments.rampUpRules] List of + * ramp-up rules. + * + * @param {object} [siteEnvelope.siteConfig.limits] Site limits. + * + * @param {number} [siteEnvelope.siteConfig.limits.maxPercentageCpu] Maximum + * allowed CPU usage percentage. + * + * @param {number} [siteEnvelope.siteConfig.limits.maxMemoryInMb] Maximum + * allowed memory usage in MB. + * + * @param {number} [siteEnvelope.siteConfig.limits.maxDiskSizeInMb] Maximum + * allowed disk size usage in MB. + * + * @param {boolean} [siteEnvelope.siteConfig.autoHealEnabled] true + * if Auto Heal is enabled; otherwise, false. + * + * @param {object} [siteEnvelope.siteConfig.autoHealRules] Auto Heal rules. + * + * @param {object} [siteEnvelope.siteConfig.autoHealRules.triggers] Conditions + * that describe when to execute the auto-heal actions. + * + * @param {object} [siteEnvelope.siteConfig.autoHealRules.triggers.requests] A + * rule based on total requests. + * + * @param {number} + * [siteEnvelope.siteConfig.autoHealRules.triggers.requests.count] Request + * Count. + * + * @param {string} + * [siteEnvelope.siteConfig.autoHealRules.triggers.requests.timeInterval] Time + * interval. + * + * @param {number} + * [siteEnvelope.siteConfig.autoHealRules.triggers.privateBytesInKB] A rule + * based on private bytes. + * + * @param {array} [siteEnvelope.siteConfig.autoHealRules.triggers.statusCodes] + * A rule based on status codes. + * + * @param {object} + * [siteEnvelope.siteConfig.autoHealRules.triggers.slowRequests] A rule based + * on request execution time. + * + * @param {string} + * [siteEnvelope.siteConfig.autoHealRules.triggers.slowRequests.timeTaken] Time + * taken. + * + * @param {number} + * [siteEnvelope.siteConfig.autoHealRules.triggers.slowRequests.count] Request + * Count. + * + * @param {string} + * [siteEnvelope.siteConfig.autoHealRules.triggers.slowRequests.timeInterval] + * Time interval. + * + * @param {object} [siteEnvelope.siteConfig.autoHealRules.actions] Actions to + * be executed when a rule is triggered. + * + * @param {string} [siteEnvelope.siteConfig.autoHealRules.actions.actionType] + * Predefined action to be taken. Possible values include: 'Recycle', + * 'LogEvent', 'CustomAction' + * + * @param {object} [siteEnvelope.siteConfig.autoHealRules.actions.customAction] + * Custom action to be taken. + * + * @param {string} + * [siteEnvelope.siteConfig.autoHealRules.actions.customAction.exe] Executable + * to be run. + * + * @param {string} + * [siteEnvelope.siteConfig.autoHealRules.actions.customAction.parameters] + * Parameters for the executable. + * + * @param {string} + * [siteEnvelope.siteConfig.autoHealRules.actions.minProcessExecutionTime] + * Minimum time the process must execute + * before taking the action + * + * @param {string} [siteEnvelope.siteConfig.tracingOptions] Tracing options. + * + * @param {string} [siteEnvelope.siteConfig.vnetName] Virtual Network name. + * + * @param {object} [siteEnvelope.siteConfig.cors] Cross-Origin Resource Sharing + * (CORS) settings. + * + * @param {array} [siteEnvelope.siteConfig.cors.allowedOrigins] Gets or sets + * the list of origins that should be allowed to make cross-origin + * calls (for example: http://example.com:12345). Use "*" to allow all. + * + * @param {object} [siteEnvelope.siteConfig.push] Push endpoint settings. + * + * @param {boolean} siteEnvelope.siteConfig.push.isPushEnabled Gets or sets a + * flag indicating whether the Push endpoint is enabled. + * + * @param {string} [siteEnvelope.siteConfig.push.tagWhitelistJson] Gets or sets + * a JSON string containing a list of tags that are whitelisted for use by the + * push registration endpoint. + * + * @param {string} [siteEnvelope.siteConfig.push.tagsRequiringAuth] Gets or + * sets a JSON string containing a list of tags that require user + * authentication to be used in the push registration endpoint. + * Tags can consist of alphanumeric characters and the following: + * '_', '@', '#', '.', ':', '-'. + * Validation should be performed at the PushRequestHandler. + * + * @param {string} [siteEnvelope.siteConfig.push.dynamicTagsJson] Gets or sets + * a JSON string containing a list of dynamic tags that will be evaluated from + * user claims in the push registration endpoint. + * + * @param {string} [siteEnvelope.siteConfig.push.kind] Kind of resource. + * + * @param {object} [siteEnvelope.siteConfig.apiDefinition] Information about + * the formal API definition for the app. + * + * @param {string} [siteEnvelope.siteConfig.apiDefinition.url] The URL of the + * API definition. + * + * @param {string} [siteEnvelope.siteConfig.autoSwapSlotName] Auto-swap slot + * name. + * + * @param {boolean} [siteEnvelope.siteConfig.localMySqlEnabled] + * true to enable local MySQL; otherwise, false. + * + * @param {number} [siteEnvelope.siteConfig.managedServiceIdentityId] Managed + * Service Identity Id + * + * @param {number} [siteEnvelope.siteConfig.xManagedServiceIdentityId] Explicit + * Managed Service Identity Id + * + * @param {array} [siteEnvelope.siteConfig.ipSecurityRestrictions] IP security + * restrictions. + * + * @param {boolean} [siteEnvelope.siteConfig.http20Enabled] Http20Enabled: + * configures a web site to allow clients to connect over http2.0 + * + * @param {string} [siteEnvelope.siteConfig.minTlsVersion] MinTlsVersion: + * configures the minimum version of TLS required for SSL requests. Possible + * values include: '1.0', '1.1', '1.2' + * + * @param {string} [siteEnvelope.siteConfig.ftpsState] State of FTP / FTPS + * service. Possible values include: 'AllAllowed', 'FtpsOnly', 'Disabled' + * + * @param {number} [siteEnvelope.siteConfig.reservedInstanceCount] Number of + * reserved instances. + * This setting only applies to the Consumption Plan + * + * @param {boolean} [siteEnvelope.scmSiteAlsoStopped] true to stop + * SCM (KUDU) site when the app is stopped; otherwise, false. The + * default is false. + * + * @param {object} [siteEnvelope.hostingEnvironmentProfile] App Service + * Environment to use for the app. + * + * @param {string} [siteEnvelope.hostingEnvironmentProfile.id] Resource ID of + * the App Service Environment. + * + * @param {boolean} [siteEnvelope.clientAffinityEnabled] true to + * enable client affinity; false to stop sending session affinity + * cookies, which route client requests in the same session to the same + * instance. Default is true. + * + * @param {boolean} [siteEnvelope.clientCertEnabled] true to + * enable client certificate authentication (TLS mutual authentication); + * otherwise, false. Default is false. + * + * @param {boolean} [siteEnvelope.hostNamesDisabled] true to + * disable the public hostnames of the app; otherwise, false. + * If true, the app is only accessible via API management process. + * + * @param {number} [siteEnvelope.containerSize] Size of the function container. + * + * @param {number} [siteEnvelope.dailyMemoryTimeQuota] Maximum allowed daily + * memory-time quota (applicable on dynamic apps only). + * + * @param {object} [siteEnvelope.cloningInfo] If specified during app creation, + * the app is cloned from a source app. + * + * @param {uuid} [siteEnvelope.cloningInfo.correlationId] Correlation ID of + * cloning operation. This ID ties multiple cloning operations + * together to use the same snapshot. + * + * @param {boolean} [siteEnvelope.cloningInfo.overwrite] true to + * overwrite destination app; otherwise, false. + * + * @param {boolean} [siteEnvelope.cloningInfo.cloneCustomHostNames] + * true to clone custom hostnames from source app; otherwise, + * false. + * + * @param {boolean} [siteEnvelope.cloningInfo.cloneSourceControl] + * true to clone source control from source app; otherwise, + * false. + * + * @param {string} siteEnvelope.cloningInfo.sourceWebAppId ARM resource ID of + * the source app. App resource ID is of the form + * /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName} + * for production slots and + * /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/slots/{slotName} + * for other slots. + * + * @param {string} [siteEnvelope.cloningInfo.hostingEnvironment] App Service + * Environment. + * + * @param {object} [siteEnvelope.cloningInfo.appSettingsOverrides] Application + * setting overrides for cloned app. If specified, these settings override the + * settings cloned + * from source app. Otherwise, application settings from source app are + * retained. + * + * @param {boolean} [siteEnvelope.cloningInfo.configureLoadBalancing] + * true to configure load balancing for source and destination + * app. + * + * @param {string} [siteEnvelope.cloningInfo.trafficManagerProfileId] ARM + * resource ID of the Traffic Manager profile to use, if it exists. Traffic + * Manager resource ID is of the form + * /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/trafficManagerProfiles/{profileName}. + * + * @param {string} [siteEnvelope.cloningInfo.trafficManagerProfileName] Name of + * Traffic Manager profile to create. This is only needed if Traffic Manager + * profile does not already exist. + * + * @param {boolean} [siteEnvelope.httpsOnly] HttpsOnly: configures a web site + * to accept only https requests. Issues redirect for + * http requests + * + * @param {object} [siteEnvelope.identity] + * + * @param {string} [siteEnvelope.identity.type] Type of managed service + * identity. Possible values include: 'SystemAssigned', 'UserAssigned' + * + * @param {array} [siteEnvelope.identity.identityIds] Array of UserAssigned + * managed service identities. + * + * @param {string} [siteEnvelope.kind] Kind of resource. + * + * @param {string} siteEnvelope.location Resource Location. + * + * @param {object} [siteEnvelope.tags] Resource tags. + * + * @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 {Site} - 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. + * + * {Site} [result] - The deserialized result object if an error did not occur. + * See {@link Site} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + beginCreateOrUpdate(resourceGroupName: string, 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: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Restores a specific backup to another app (or deployment slot, if + * specified). + * + * Restores a specific backup to another app (or deployment slot, if + * specified). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} backupId ID of the backup. + * + * @param {object} request Information on restore request . + * + * @param {string} request.storageAccountUrl SAS URL to the container. + * + * @param {string} [request.blobName] Name of a blob which contains the backup. + * + * @param {boolean} request.overwrite true if the restore + * operation can overwrite target app; otherwise, false. + * true is needed if trying to restore over an existing app. + * + * @param {string} [request.siteName] Name of an app. + * + * @param {array} [request.databases] Collection of databases which should be + * restored. This list has to match the list of databases included in the + * backup. + * + * @param {boolean} [request.ignoreConflictingHostNames] Changes a logic when + * restoring an app with custom domains. true to remove custom + * domains automatically. If false, custom domains are added to + * the app's object when it is being restored, but that might fail due to + * conflicts during the operation. + * + * @param {boolean} [request.ignoreDatabases] Ignore the databases and only + * restore the site content + * + * @param {string} [request.appServicePlan] Specify app service plan that will + * own restored site. + * + * @param {string} [request.operationType] Operation type. Possible values + * include: 'Default', 'Clone', 'Relocation', 'Snapshot', 'CloudFS' + * + * @param {boolean} [request.adjustConnectionStrings] true if + * SiteConfig.ConnectionStrings should be set in new app; otherwise, + * false. + * + * @param {string} [request.hostingEnvironment] App Service Environment name, + * if needed (only when restoring an app to an App Service Environment). + * + * @param {string} [request.kind] Kind of resource. + * + * @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. + */ + beginRestoreWithHttpOperationResponse(resourceGroupName: string, name: string, backupId: string, request: models.RestoreRequest, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Restores a specific backup to another app (or deployment slot, if + * specified). + * + * Restores a specific backup to another app (or deployment slot, if + * specified). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} backupId ID of the backup. + * + * @param {object} request Information on restore request . + * + * @param {string} request.storageAccountUrl SAS URL to the container. + * + * @param {string} [request.blobName] Name of a blob which contains the backup. + * + * @param {boolean} request.overwrite true if the restore + * operation can overwrite target app; otherwise, false. + * true is needed if trying to restore over an existing app. + * + * @param {string} [request.siteName] Name of an app. + * + * @param {array} [request.databases] Collection of databases which should be + * restored. This list has to match the list of databases included in the + * backup. + * + * @param {boolean} [request.ignoreConflictingHostNames] Changes a logic when + * restoring an app with custom domains. true to remove custom + * domains automatically. If false, custom domains are added to + * the app's object when it is being restored, but that might fail due to + * conflicts during the operation. + * + * @param {boolean} [request.ignoreDatabases] Ignore the databases and only + * restore the site content + * + * @param {string} [request.appServicePlan] Specify app service plan that will + * own restored site. + * + * @param {string} [request.operationType] Operation type. Possible values + * include: 'Default', 'Clone', 'Relocation', 'Snapshot', 'CloudFS' + * + * @param {boolean} [request.adjustConnectionStrings] true if + * SiteConfig.ConnectionStrings should be set in new app; otherwise, + * false. + * + * @param {string} [request.hostingEnvironment] App Service Environment name, + * if needed (only when restoring an app to an App Service Environment). + * + * @param {string} [request.kind] Kind of resource. + * + * @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 {null} - 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. + * + * {null} [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. + */ + beginRestore(resourceGroupName: string, name: string, backupId: string, request: models.RestoreRequest, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginRestore(resourceGroupName: string, name: string, backupId: string, request: models.RestoreRequest, callback: ServiceCallback): void; + beginRestore(resourceGroupName: string, name: string, backupId: string, request: models.RestoreRequest, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Gets the Git/FTP publishing credentials of an app. + * + * Gets the Git/FTP publishing credentials of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @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. + */ + beginListPublishingCredentialsWithHttpOperationResponse(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets the Git/FTP publishing credentials of an app. + * + * Gets the Git/FTP publishing credentials of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @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 {User} - 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. + * + * {User} [result] - The deserialized result object if an error did not occur. + * See {@link User} 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. + */ + beginListPublishingCredentials(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginListPublishingCredentials(resourceGroupName: string, name: string, callback: ServiceCallback): void; + beginListPublishingCredentials(resourceGroupName: string, name: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Invoke the MSDeploy web app extension. + * + * Invoke the MSDeploy web app extension. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {object} mSDeploy Details of MSDeploy operation + * + * @param {string} [mSDeploy.packageUri] Package URI + * + * @param {string} [mSDeploy.connectionString] SQL Connection String + * + * @param {string} [mSDeploy.dbType] Database Type + * + * @param {string} [mSDeploy.setParametersXmlFileUri] URI of MSDeploy + * Parameters file. Must not be set if SetParameters is used. + * + * @param {object} [mSDeploy.setParameters] MSDeploy Parameters. Must not be + * set if SetParametersXmlFileUri is used. + * + * @param {boolean} [mSDeploy.skipAppData] Controls whether the MSDeploy + * operation skips the App_Data directory. + * If set to true, the existing App_Data directory on the + * destination + * will not be deleted, and any App_Data directory in the source will be + * ignored. + * Setting is false by default. + * + * @param {boolean} [mSDeploy.appOffline] Sets the AppOffline rule while the + * MSDeploy operation executes. + * Setting is false by default. + * + * @param {string} [mSDeploy.kind] Kind of resource. + * + * @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. + */ + beginCreateMSDeployOperationWithHttpOperationResponse(resourceGroupName: string, name: string, mSDeploy: models.MSDeploy, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Invoke the MSDeploy web app extension. + * + * Invoke the MSDeploy web app extension. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {object} mSDeploy Details of MSDeploy operation + * + * @param {string} [mSDeploy.packageUri] Package URI + * + * @param {string} [mSDeploy.connectionString] SQL Connection String + * + * @param {string} [mSDeploy.dbType] Database Type + * + * @param {string} [mSDeploy.setParametersXmlFileUri] URI of MSDeploy + * Parameters file. Must not be set if SetParameters is used. + * + * @param {object} [mSDeploy.setParameters] MSDeploy Parameters. Must not be + * set if SetParametersXmlFileUri is used. + * + * @param {boolean} [mSDeploy.skipAppData] Controls whether the MSDeploy + * operation skips the App_Data directory. + * If set to true, the existing App_Data directory on the + * destination + * will not be deleted, and any App_Data directory in the source will be + * ignored. + * Setting is false by default. + * + * @param {boolean} [mSDeploy.appOffline] Sets the AppOffline rule while the + * MSDeploy operation executes. + * Setting is false by default. + * + * @param {string} [mSDeploy.kind] Kind of resource. + * + * @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 {MSDeployStatus} - 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. + * + * {MSDeployStatus} [result] - The deserialized result object if an error did not occur. + * See {@link MSDeployStatus} 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. + */ + beginCreateMSDeployOperation(resourceGroupName: string, name: string, mSDeploy: models.MSDeploy, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginCreateMSDeployOperation(resourceGroupName: string, name: string, mSDeploy: models.MSDeploy, callback: ServiceCallback): void; + beginCreateMSDeployOperation(resourceGroupName: string, name: string, mSDeploy: models.MSDeploy, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Create function for web site, or a deployment slot. + * + * Create function for web site, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} functionName Function name. + * + * @param {object} functionEnvelope Function details. + * + * @param {string} [functionEnvelope.functionAppId] Function App ID. + * + * @param {string} [functionEnvelope.scriptRootPathHref] Script root path URI. + * + * @param {string} [functionEnvelope.scriptHref] Script URI. + * + * @param {string} [functionEnvelope.configHref] Config URI. + * + * @param {string} [functionEnvelope.secretsFileHref] Secrets file URI. + * + * @param {string} [functionEnvelope.href] Function URI. + * + * @param {object} [functionEnvelope.config] Config information. + * + * @param {object} [functionEnvelope.files] File list. + * + * @param {string} [functionEnvelope.testData] Test data used when testing via + * the Azure Portal. + * + * @param {string} [functionEnvelope.kind] Kind of resource. + * + * @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. + */ + beginCreateFunctionWithHttpOperationResponse(resourceGroupName: string, name: string, functionName: string, functionEnvelope: models.FunctionEnvelope, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Create function for web site, or a deployment slot. + * + * Create function for web site, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} functionName Function name. + * + * @param {object} functionEnvelope Function details. + * + * @param {string} [functionEnvelope.functionAppId] Function App ID. + * + * @param {string} [functionEnvelope.scriptRootPathHref] Script root path URI. + * + * @param {string} [functionEnvelope.scriptHref] Script URI. + * + * @param {string} [functionEnvelope.configHref] Config URI. + * + * @param {string} [functionEnvelope.secretsFileHref] Secrets file URI. + * + * @param {string} [functionEnvelope.href] Function URI. + * + * @param {object} [functionEnvelope.config] Config information. + * + * @param {object} [functionEnvelope.files] File list. + * + * @param {string} [functionEnvelope.testData] Test data used when testing via + * the Azure Portal. + * + * @param {string} [functionEnvelope.kind] Kind of resource. + * + * @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 {FunctionEnvelope} - 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. + * + * {FunctionEnvelope} [result] - The deserialized result object if an error did not occur. + * See {@link FunctionEnvelope} 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. + */ + beginCreateFunction(resourceGroupName: string, name: string, functionName: string, functionEnvelope: models.FunctionEnvelope, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginCreateFunction(resourceGroupName: string, name: string, functionName: string, functionEnvelope: models.FunctionEnvelope, callback: ServiceCallback): void; + beginCreateFunction(resourceGroupName: string, name: string, functionName: string, functionEnvelope: models.FunctionEnvelope, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Invoke the MSDeploy web app extension. + * + * Invoke the MSDeploy web app extension. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {string} instanceId ID of web app instance. + * + * @param {object} mSDeploy Details of MSDeploy operation + * + * @param {string} [mSDeploy.packageUri] Package URI + * + * @param {string} [mSDeploy.connectionString] SQL Connection String + * + * @param {string} [mSDeploy.dbType] Database Type + * + * @param {string} [mSDeploy.setParametersXmlFileUri] URI of MSDeploy + * Parameters file. Must not be set if SetParameters is used. + * + * @param {object} [mSDeploy.setParameters] MSDeploy Parameters. Must not be + * set if SetParametersXmlFileUri is used. + * + * @param {boolean} [mSDeploy.skipAppData] Controls whether the MSDeploy + * operation skips the App_Data directory. + * If set to true, the existing App_Data directory on the + * destination + * will not be deleted, and any App_Data directory in the source will be + * ignored. + * Setting is false by default. + * + * @param {boolean} [mSDeploy.appOffline] Sets the AppOffline rule while the + * MSDeploy operation executes. + * Setting is false by default. + * + * @param {string} [mSDeploy.kind] Kind of resource. + * + * @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. + */ + beginCreateInstanceMSDeployOperationWithHttpOperationResponse(resourceGroupName: string, name: string, instanceId: string, mSDeploy: models.MSDeploy, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Invoke the MSDeploy web app extension. + * + * Invoke the MSDeploy web app extension. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {string} instanceId ID of web app instance. + * + * @param {object} mSDeploy Details of MSDeploy operation + * + * @param {string} [mSDeploy.packageUri] Package URI + * + * @param {string} [mSDeploy.connectionString] SQL Connection String + * + * @param {string} [mSDeploy.dbType] Database Type + * + * @param {string} [mSDeploy.setParametersXmlFileUri] URI of MSDeploy + * Parameters file. Must not be set if SetParameters is used. + * + * @param {object} [mSDeploy.setParameters] MSDeploy Parameters. Must not be + * set if SetParametersXmlFileUri is used. + * + * @param {boolean} [mSDeploy.skipAppData] Controls whether the MSDeploy + * operation skips the App_Data directory. + * If set to true, the existing App_Data directory on the + * destination + * will not be deleted, and any App_Data directory in the source will be + * ignored. + * Setting is false by default. + * + * @param {boolean} [mSDeploy.appOffline] Sets the AppOffline rule while the + * MSDeploy operation executes. + * Setting is false by default. + * + * @param {string} [mSDeploy.kind] Kind of resource. + * + * @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 {MSDeployStatus} - 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. + * + * {MSDeployStatus} [result] - The deserialized result object if an error did not occur. + * See {@link MSDeployStatus} 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. + */ + beginCreateInstanceMSDeployOperation(resourceGroupName: string, name: string, instanceId: string, mSDeploy: models.MSDeploy, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginCreateInstanceMSDeployOperation(resourceGroupName: string, name: string, instanceId: string, mSDeploy: models.MSDeploy, callback: ServiceCallback): void; + beginCreateInstanceMSDeployOperation(resourceGroupName: string, name: string, instanceId: string, mSDeploy: models.MSDeploy, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Restores a web app. + * + * Restores a web app. + * + * @param {string} subscriptionName Azure subscription. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {object} migrationOptions Migration migrationOptions. + * + * @param {string} migrationOptions.azurefilesConnectionString AzureFiles + * connection string. + * + * @param {string} migrationOptions.azurefilesShare AzureFiles share. + * + * @param {boolean} [migrationOptions.switchSiteAfterMigration] + * trueif the app should be switched over; otherwise, + * false. + * + * @param {boolean} [migrationOptions.blockWriteAccessToSite] true + * if the app should be read only during copy operation; otherwise, + * false. + * + * @param {string} [migrationOptions.kind] Kind of resource. + * + * @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. + */ + beginMigrateStorageWithHttpOperationResponse(subscriptionName: string, resourceGroupName: string, name: string, migrationOptions: models.StorageMigrationOptions, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Restores a web app. + * + * Restores a web app. + * + * @param {string} subscriptionName Azure subscription. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {object} migrationOptions Migration migrationOptions. + * + * @param {string} migrationOptions.azurefilesConnectionString AzureFiles + * connection string. + * + * @param {string} migrationOptions.azurefilesShare AzureFiles share. + * + * @param {boolean} [migrationOptions.switchSiteAfterMigration] + * trueif the app should be switched over; otherwise, + * false. + * + * @param {boolean} [migrationOptions.blockWriteAccessToSite] true + * if the app should be read only during copy operation; otherwise, + * false. + * + * @param {string} [migrationOptions.kind] Kind of resource. + * + * @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 {StorageMigrationResponse} - 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. + * + * {StorageMigrationResponse} [result] - The deserialized result object if an error did not occur. + * See {@link StorageMigrationResponse} 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. + */ + beginMigrateStorage(subscriptionName: string, resourceGroupName: string, name: string, migrationOptions: models.StorageMigrationOptions, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginMigrateStorage(subscriptionName: string, resourceGroupName: string, name: string, migrationOptions: models.StorageMigrationOptions, callback: ServiceCallback): void; + beginMigrateStorage(subscriptionName: string, resourceGroupName: string, name: string, migrationOptions: models.StorageMigrationOptions, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Migrates a local (in-app) MySql database to a remote MySql + * database. + * + * Migrates a local (in-app) MySql database to a remote MySql database. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {object} migrationRequestEnvelope MySql migration options. + * + * @param {string} migrationRequestEnvelope.connectionString Connection string + * to the remote MySQL database. + * + * @param {string} migrationRequestEnvelope.migrationType The type of migration + * operation to be done. Possible values include: 'LocalToRemote', + * 'RemoteToLocal' + * + * @param {string} [migrationRequestEnvelope.kind] Kind of resource. + * + * @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. + */ + beginMigrateMySqlWithHttpOperationResponse(resourceGroupName: string, name: string, migrationRequestEnvelope: models.MigrateMySqlRequest, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Migrates a local (in-app) MySql database to a remote MySql + * database. + * + * Migrates a local (in-app) MySql database to a remote MySql database. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {object} migrationRequestEnvelope MySql migration options. + * + * @param {string} migrationRequestEnvelope.connectionString Connection string + * to the remote MySQL database. + * + * @param {string} migrationRequestEnvelope.migrationType The type of migration + * operation to be done. Possible values include: 'LocalToRemote', + * 'RemoteToLocal' + * + * @param {string} [migrationRequestEnvelope.kind] Kind of resource. + * + * @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 {Operation} - 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. + * + * {Operation} [result] - The deserialized result object if an error did not occur. + * See {@link Operation} 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. + */ + beginMigrateMySql(resourceGroupName: string, name: string, migrationRequestEnvelope: models.MigrateMySqlRequest, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginMigrateMySql(resourceGroupName: string, name: string, migrationRequestEnvelope: models.MigrateMySqlRequest, callback: ServiceCallback): void; + beginMigrateMySql(resourceGroupName: string, name: string, migrationRequestEnvelope: models.MigrateMySqlRequest, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Restores an app from a backup blob in Azure Storage. + * + * Restores an app from a backup blob in Azure Storage. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} request Information on restore request . + * + * @param {string} request.storageAccountUrl SAS URL to the container. + * + * @param {string} [request.blobName] Name of a blob which contains the backup. + * + * @param {boolean} request.overwrite true if the restore + * operation can overwrite target app; otherwise, false. + * true is needed if trying to restore over an existing app. + * + * @param {string} [request.siteName] Name of an app. + * + * @param {array} [request.databases] Collection of databases which should be + * restored. This list has to match the list of databases included in the + * backup. + * + * @param {boolean} [request.ignoreConflictingHostNames] Changes a logic when + * restoring an app with custom domains. true to remove custom + * domains automatically. If false, custom domains are added to + * the app's object when it is being restored, but that might fail due to + * conflicts during the operation. + * + * @param {boolean} [request.ignoreDatabases] Ignore the databases and only + * restore the site content + * + * @param {string} [request.appServicePlan] Specify app service plan that will + * own restored site. + * + * @param {string} [request.operationType] Operation type. Possible values + * include: 'Default', 'Clone', 'Relocation', 'Snapshot', 'CloudFS' + * + * @param {boolean} [request.adjustConnectionStrings] true if + * SiteConfig.ConnectionStrings should be set in new app; otherwise, + * false. + * + * @param {string} [request.hostingEnvironment] App Service Environment name, + * if needed (only when restoring an app to an App Service Environment). + * + * @param {string} [request.kind] Kind of resource. + * + * @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. + */ + beginRestoreFromBackupBlobWithHttpOperationResponse(resourceGroupName: string, name: string, request: models.RestoreRequest, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Restores an app from a backup blob in Azure Storage. + * + * Restores an app from a backup blob in Azure Storage. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} request Information on restore request . + * + * @param {string} request.storageAccountUrl SAS URL to the container. + * + * @param {string} [request.blobName] Name of a blob which contains the backup. + * + * @param {boolean} request.overwrite true if the restore + * operation can overwrite target app; otherwise, false. + * true is needed if trying to restore over an existing app. + * + * @param {string} [request.siteName] Name of an app. + * + * @param {array} [request.databases] Collection of databases which should be + * restored. This list has to match the list of databases included in the + * backup. + * + * @param {boolean} [request.ignoreConflictingHostNames] Changes a logic when + * restoring an app with custom domains. true to remove custom + * domains automatically. If false, custom domains are added to + * the app's object when it is being restored, but that might fail due to + * conflicts during the operation. + * + * @param {boolean} [request.ignoreDatabases] Ignore the databases and only + * restore the site content + * + * @param {string} [request.appServicePlan] Specify app service plan that will + * own restored site. + * + * @param {string} [request.operationType] Operation type. Possible values + * include: 'Default', 'Clone', 'Relocation', 'Snapshot', 'CloudFS' + * + * @param {boolean} [request.adjustConnectionStrings] true if + * SiteConfig.ConnectionStrings should be set in new app; otherwise, + * false. + * + * @param {string} [request.hostingEnvironment] App Service Environment name, + * if needed (only when restoring an app to an App Service Environment). + * + * @param {string} [request.kind] Kind of resource. + * + * @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 {null} - 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. + * + * {null} [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. + */ + beginRestoreFromBackupBlob(resourceGroupName: string, name: string, request: models.RestoreRequest, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginRestoreFromBackupBlob(resourceGroupName: string, name: string, request: models.RestoreRequest, callback: ServiceCallback): void; + beginRestoreFromBackupBlob(resourceGroupName: string, name: string, request: models.RestoreRequest, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Restores a deleted web app to this web app. + * + * Restores a deleted web app to this web app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {object} restoreRequest Deleted web app restore information. + * + * @param {string} [restoreRequest.deletedSiteId] ARM resource ID of the + * deleted app. Example: + * /subscriptions/{subId}/providers/Microsoft.Web/deletedSites/{deletedSiteId} + * + * @param {boolean} [restoreRequest.recoverConfiguration] If true, deleted site + * configuration, in addition to content, will be restored. + * + * @param {string} [restoreRequest.snapshotTime] Point in time to restore the + * deleted app from, formatted as a DateTime string. + * If unspecified, default value is the time that the app was deleted. + * + * @param {string} [restoreRequest.kind] Kind of resource. + * + * @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. + */ + beginRestoreFromDeletedAppWithHttpOperationResponse(resourceGroupName: string, name: string, restoreRequest: models.DeletedAppRestoreRequest, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Restores a deleted web app to this web app. + * + * Restores a deleted web app to this web app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {object} restoreRequest Deleted web app restore information. + * + * @param {string} [restoreRequest.deletedSiteId] ARM resource ID of the + * deleted app. Example: + * /subscriptions/{subId}/providers/Microsoft.Web/deletedSites/{deletedSiteId} + * + * @param {boolean} [restoreRequest.recoverConfiguration] If true, deleted site + * configuration, in addition to content, will be restored. + * + * @param {string} [restoreRequest.snapshotTime] Point in time to restore the + * deleted app from, formatted as a DateTime string. + * If unspecified, default value is the time that the app was deleted. + * + * @param {string} [restoreRequest.kind] Kind of resource. + * + * @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 {null} - 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. + * + * {null} [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. + */ + beginRestoreFromDeletedApp(resourceGroupName: string, name: string, restoreRequest: models.DeletedAppRestoreRequest, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginRestoreFromDeletedApp(resourceGroupName: string, name: string, restoreRequest: models.DeletedAppRestoreRequest, callback: ServiceCallback): void; + beginRestoreFromDeletedApp(resourceGroupName: string, name: string, restoreRequest: models.DeletedAppRestoreRequest, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Restores a web app from a snapshot. + * + * Restores a web app from a snapshot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {object} restoreRequest Snapshot restore settings. Snapshot + * information can be obtained by calling GetDeletedSites or GetSiteSnapshots + * API. + * + * @param {string} [restoreRequest.snapshotTime] Point in time in which the app + * restore should be done, formatted as a DateTime string. + * + * @param {object} [restoreRequest.recoverySource] Optional. Specifies the web + * app that snapshot contents will be retrieved from. + * If empty, the targeted web app will be used as the source. + * + * @param {string} [restoreRequest.recoverySource.location] Geographical + * location of the source web app, e.g. SouthEastAsia, SouthCentralUS + * + * @param {string} [restoreRequest.recoverySource.id] ARM resource ID of the + * source app. + * /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName} + * for production slots and + * /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/slots/{slotName} + * for other slots. + * + * @param {boolean} restoreRequest.overwrite If true the restore + * operation can overwrite source app; otherwise, false. + * + * @param {boolean} [restoreRequest.recoverConfiguration] If true, site + * configuration, in addition to content, will be reverted. + * + * @param {boolean} [restoreRequest.ignoreConflictingHostNames] If true, custom + * hostname conflicts will be ignored when recovering to a target web app. + * This setting is only necessary when RecoverConfiguration is enabled. + * + * @param {string} [restoreRequest.kind] Kind of resource. + * + * @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. + */ + beginRestoreSnapshotWithHttpOperationResponse(resourceGroupName: string, name: string, restoreRequest: models.SnapshotRestoreRequest, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Restores a web app from a snapshot. + * + * Restores a web app from a snapshot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {object} restoreRequest Snapshot restore settings. Snapshot + * information can be obtained by calling GetDeletedSites or GetSiteSnapshots + * API. + * + * @param {string} [restoreRequest.snapshotTime] Point in time in which the app + * restore should be done, formatted as a DateTime string. + * + * @param {object} [restoreRequest.recoverySource] Optional. Specifies the web + * app that snapshot contents will be retrieved from. + * If empty, the targeted web app will be used as the source. + * + * @param {string} [restoreRequest.recoverySource.location] Geographical + * location of the source web app, e.g. SouthEastAsia, SouthCentralUS + * + * @param {string} [restoreRequest.recoverySource.id] ARM resource ID of the + * source app. + * /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName} + * for production slots and + * /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/slots/{slotName} + * for other slots. + * + * @param {boolean} restoreRequest.overwrite If true the restore + * operation can overwrite source app; otherwise, false. + * + * @param {boolean} [restoreRequest.recoverConfiguration] If true, site + * configuration, in addition to content, will be reverted. + * + * @param {boolean} [restoreRequest.ignoreConflictingHostNames] If true, custom + * hostname conflicts will be ignored when recovering to a target web app. + * This setting is only necessary when RecoverConfiguration is enabled. + * + * @param {string} [restoreRequest.kind] Kind of resource. + * + * @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 {null} - 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. + * + * {null} [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. + */ + beginRestoreSnapshot(resourceGroupName: string, name: string, restoreRequest: models.SnapshotRestoreRequest, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginRestoreSnapshot(resourceGroupName: string, name: string, restoreRequest: models.SnapshotRestoreRequest, callback: ServiceCallback): void; + beginRestoreSnapshot(resourceGroupName: string, name: string, restoreRequest: models.SnapshotRestoreRequest, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Install site extension on a web site, or a deployment slot. + * + * Install site extension on a web site, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} siteExtensionId Site extension name. + * + * @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. + */ + beginInstallSiteExtensionWithHttpOperationResponse(resourceGroupName: string, name: string, siteExtensionId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Install site extension on a web site, or a deployment slot. + * + * Install site extension on a web site, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} siteExtensionId Site extension name. + * + * @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 {SiteExtensionInfo} - 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. + * + * {SiteExtensionInfo} [result] - The deserialized result object if an error did not occur. + * See {@link SiteExtensionInfo} 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. + */ + beginInstallSiteExtension(resourceGroupName: string, name: string, siteExtensionId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginInstallSiteExtension(resourceGroupName: string, name: string, siteExtensionId: string, callback: ServiceCallback): void; + beginInstallSiteExtension(resourceGroupName: string, name: string, siteExtensionId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Creates a new web, mobile, or API app in an existing resource + * group, or updates an existing app. + * + * Creates a new web, mobile, or API app in an existing resource group, or + * updates an existing app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Unique name of the app to create or update. To create + * or update a deployment slot, use the {slot} parameter. + * + * @param {object} siteEnvelope A JSON representation of the app properties. + * See example. + * + * @param {boolean} [siteEnvelope.enabled] true if the app is + * enabled; otherwise, false. Setting this value to false disables + * the app (takes the app offline). + * + * @param {array} [siteEnvelope.hostNameSslStates] Hostname SSL states are used + * to manage the SSL bindings for app's hostnames. + * + * @param {string} [siteEnvelope.serverFarmId] Resource ID of the associated + * App Service plan, formatted as: + * "/subscriptions/{subscriptionID}/resourceGroups/{groupName}/providers/Microsoft.Web/serverfarms/{appServicePlanName}". + * + * @param {boolean} [siteEnvelope.reserved] true if reserved; + * otherwise, false. + * + * @param {boolean} [siteEnvelope.isXenon] Obsolete: Hyper-V sandbox. + * + * @param {boolean} [siteEnvelope.hyperV] Hyper-V sandbox. + * + * @param {object} [siteEnvelope.siteConfig] Configuration of the app. + * + * @param {number} [siteEnvelope.siteConfig.numberOfWorkers] Number of workers. + * + * @param {array} [siteEnvelope.siteConfig.defaultDocuments] Default documents. + * + * @param {string} [siteEnvelope.siteConfig.netFrameworkVersion] .NET Framework + * version. + * + * @param {string} [siteEnvelope.siteConfig.phpVersion] Version of PHP. + * + * @param {string} [siteEnvelope.siteConfig.pythonVersion] Version of Python. + * + * @param {string} [siteEnvelope.siteConfig.nodeVersion] Version of Node.js. + * + * @param {string} [siteEnvelope.siteConfig.linuxFxVersion] Linux App Framework + * and version + * + * @param {string} [siteEnvelope.siteConfig.windowsFxVersion] Xenon App + * Framework and version + * + * @param {boolean} [siteEnvelope.siteConfig.requestTracingEnabled] + * true if request tracing is enabled; otherwise, + * false. + * + * @param {date} [siteEnvelope.siteConfig.requestTracingExpirationTime] Request + * tracing expiration time. + * + * @param {boolean} [siteEnvelope.siteConfig.remoteDebuggingEnabled] + * true if remote debugging is enabled; otherwise, + * false. + * + * @param {string} [siteEnvelope.siteConfig.remoteDebuggingVersion] Remote + * debugging version. + * + * @param {boolean} [siteEnvelope.siteConfig.httpLoggingEnabled] + * true if HTTP logging is enabled; otherwise, false. + * + * @param {number} [siteEnvelope.siteConfig.logsDirectorySizeLimit] HTTP logs + * directory size limit. + * + * @param {boolean} [siteEnvelope.siteConfig.detailedErrorLoggingEnabled] + * true if detailed error logging is enabled; otherwise, + * false. + * + * @param {string} [siteEnvelope.siteConfig.publishingUsername] Publishing user + * name. + * + * @param {array} [siteEnvelope.siteConfig.appSettings] Application settings. + * + * @param {object} [siteEnvelope.siteConfig.azureStorageAccounts] User-provided + * Azure storage accounts. + * + * @param {array} [siteEnvelope.siteConfig.connectionStrings] Connection + * strings. + * + * @param {array} [siteEnvelope.siteConfig.handlerMappings] Handler mappings. + * + * @param {string} [siteEnvelope.siteConfig.documentRoot] Document root. + * + * @param {string} [siteEnvelope.siteConfig.scmType] SCM type. Possible values + * include: 'None', 'Dropbox', 'Tfs', 'LocalGit', 'GitHub', 'CodePlexGit', + * 'CodePlexHg', 'BitbucketGit', 'BitbucketHg', 'ExternalGit', 'ExternalHg', + * 'OneDrive', 'VSO' + * + * @param {boolean} [siteEnvelope.siteConfig.use32BitWorkerProcess] + * true to use 32-bit worker process; otherwise, + * false. + * + * @param {boolean} [siteEnvelope.siteConfig.webSocketsEnabled] + * true if WebSocket is enabled; otherwise, false. + * + * @param {boolean} [siteEnvelope.siteConfig.alwaysOn] true if + * Always On is enabled; otherwise, false. + * + * @param {string} [siteEnvelope.siteConfig.javaVersion] Java version. + * + * @param {string} [siteEnvelope.siteConfig.javaContainer] Java container. + * + * @param {string} [siteEnvelope.siteConfig.javaContainerVersion] Java + * container version. + * + * @param {string} [siteEnvelope.siteConfig.appCommandLine] App command line to + * launch. + * + * @param {string} [siteEnvelope.siteConfig.managedPipelineMode] Managed + * pipeline mode. Possible values include: 'Integrated', 'Classic' + * + * @param {array} [siteEnvelope.siteConfig.virtualApplications] Virtual + * applications. + * + * @param {string} [siteEnvelope.siteConfig.loadBalancing] Site load balancing. + * Possible values include: 'WeightedRoundRobin', 'LeastRequests', + * 'LeastResponseTime', 'WeightedTotalTraffic', 'RequestHash' + * + * @param {object} [siteEnvelope.siteConfig.experiments] This is work around + * for polymophic types. + * + * @param {array} [siteEnvelope.siteConfig.experiments.rampUpRules] List of + * ramp-up rules. + * + * @param {object} [siteEnvelope.siteConfig.limits] Site limits. + * + * @param {number} [siteEnvelope.siteConfig.limits.maxPercentageCpu] Maximum + * allowed CPU usage percentage. + * + * @param {number} [siteEnvelope.siteConfig.limits.maxMemoryInMb] Maximum + * allowed memory usage in MB. + * + * @param {number} [siteEnvelope.siteConfig.limits.maxDiskSizeInMb] Maximum + * allowed disk size usage in MB. + * + * @param {boolean} [siteEnvelope.siteConfig.autoHealEnabled] true + * if Auto Heal is enabled; otherwise, false. + * + * @param {object} [siteEnvelope.siteConfig.autoHealRules] Auto Heal rules. + * + * @param {object} [siteEnvelope.siteConfig.autoHealRules.triggers] Conditions + * that describe when to execute the auto-heal actions. + * + * @param {object} [siteEnvelope.siteConfig.autoHealRules.triggers.requests] A + * rule based on total requests. + * + * @param {number} + * [siteEnvelope.siteConfig.autoHealRules.triggers.requests.count] Request + * Count. + * + * @param {string} + * [siteEnvelope.siteConfig.autoHealRules.triggers.requests.timeInterval] Time + * interval. + * + * @param {number} + * [siteEnvelope.siteConfig.autoHealRules.triggers.privateBytesInKB] A rule + * based on private bytes. + * + * @param {array} [siteEnvelope.siteConfig.autoHealRules.triggers.statusCodes] + * A rule based on status codes. + * + * @param {object} + * [siteEnvelope.siteConfig.autoHealRules.triggers.slowRequests] A rule based + * on request execution time. + * + * @param {string} + * [siteEnvelope.siteConfig.autoHealRules.triggers.slowRequests.timeTaken] Time + * taken. + * + * @param {number} + * [siteEnvelope.siteConfig.autoHealRules.triggers.slowRequests.count] Request + * Count. + * + * @param {string} + * [siteEnvelope.siteConfig.autoHealRules.triggers.slowRequests.timeInterval] + * Time interval. + * + * @param {object} [siteEnvelope.siteConfig.autoHealRules.actions] Actions to + * be executed when a rule is triggered. + * + * @param {string} [siteEnvelope.siteConfig.autoHealRules.actions.actionType] + * Predefined action to be taken. Possible values include: 'Recycle', + * 'LogEvent', 'CustomAction' + * + * @param {object} [siteEnvelope.siteConfig.autoHealRules.actions.customAction] + * Custom action to be taken. + * + * @param {string} + * [siteEnvelope.siteConfig.autoHealRules.actions.customAction.exe] Executable + * to be run. + * + * @param {string} + * [siteEnvelope.siteConfig.autoHealRules.actions.customAction.parameters] + * Parameters for the executable. + * + * @param {string} + * [siteEnvelope.siteConfig.autoHealRules.actions.minProcessExecutionTime] + * Minimum time the process must execute + * before taking the action + * + * @param {string} [siteEnvelope.siteConfig.tracingOptions] Tracing options. + * + * @param {string} [siteEnvelope.siteConfig.vnetName] Virtual Network name. + * + * @param {object} [siteEnvelope.siteConfig.cors] Cross-Origin Resource Sharing + * (CORS) settings. + * + * @param {array} [siteEnvelope.siteConfig.cors.allowedOrigins] Gets or sets + * the list of origins that should be allowed to make cross-origin + * calls (for example: http://example.com:12345). Use "*" to allow all. + * + * @param {object} [siteEnvelope.siteConfig.push] Push endpoint settings. + * + * @param {boolean} siteEnvelope.siteConfig.push.isPushEnabled Gets or sets a + * flag indicating whether the Push endpoint is enabled. + * + * @param {string} [siteEnvelope.siteConfig.push.tagWhitelistJson] Gets or sets + * a JSON string containing a list of tags that are whitelisted for use by the + * push registration endpoint. + * + * @param {string} [siteEnvelope.siteConfig.push.tagsRequiringAuth] Gets or + * sets a JSON string containing a list of tags that require user + * authentication to be used in the push registration endpoint. + * Tags can consist of alphanumeric characters and the following: + * '_', '@', '#', '.', ':', '-'. + * Validation should be performed at the PushRequestHandler. + * + * @param {string} [siteEnvelope.siteConfig.push.dynamicTagsJson] Gets or sets + * a JSON string containing a list of dynamic tags that will be evaluated from + * user claims in the push registration endpoint. + * + * @param {string} [siteEnvelope.siteConfig.push.kind] Kind of resource. + * + * @param {object} [siteEnvelope.siteConfig.apiDefinition] Information about + * the formal API definition for the app. + * + * @param {string} [siteEnvelope.siteConfig.apiDefinition.url] The URL of the + * API definition. + * + * @param {string} [siteEnvelope.siteConfig.autoSwapSlotName] Auto-swap slot + * name. + * + * @param {boolean} [siteEnvelope.siteConfig.localMySqlEnabled] + * true to enable local MySQL; otherwise, false. + * + * @param {number} [siteEnvelope.siteConfig.managedServiceIdentityId] Managed + * Service Identity Id + * + * @param {number} [siteEnvelope.siteConfig.xManagedServiceIdentityId] Explicit + * Managed Service Identity Id + * + * @param {array} [siteEnvelope.siteConfig.ipSecurityRestrictions] IP security + * restrictions. + * + * @param {boolean} [siteEnvelope.siteConfig.http20Enabled] Http20Enabled: + * configures a web site to allow clients to connect over http2.0 + * + * @param {string} [siteEnvelope.siteConfig.minTlsVersion] MinTlsVersion: + * configures the minimum version of TLS required for SSL requests. Possible + * values include: '1.0', '1.1', '1.2' + * + * @param {string} [siteEnvelope.siteConfig.ftpsState] State of FTP / FTPS + * service. Possible values include: 'AllAllowed', 'FtpsOnly', 'Disabled' + * + * @param {number} [siteEnvelope.siteConfig.reservedInstanceCount] Number of + * reserved instances. + * This setting only applies to the Consumption Plan + * + * @param {boolean} [siteEnvelope.scmSiteAlsoStopped] true to stop + * SCM (KUDU) site when the app is stopped; otherwise, false. The + * default is false. + * + * @param {object} [siteEnvelope.hostingEnvironmentProfile] App Service + * Environment to use for the app. + * + * @param {string} [siteEnvelope.hostingEnvironmentProfile.id] Resource ID of + * the App Service Environment. + * + * @param {boolean} [siteEnvelope.clientAffinityEnabled] true to + * enable client affinity; false to stop sending session affinity + * cookies, which route client requests in the same session to the same + * instance. Default is true. + * + * @param {boolean} [siteEnvelope.clientCertEnabled] true to + * enable client certificate authentication (TLS mutual authentication); + * otherwise, false. Default is false. + * + * @param {boolean} [siteEnvelope.hostNamesDisabled] true to + * disable the public hostnames of the app; otherwise, false. + * If true, the app is only accessible via API management process. + * + * @param {number} [siteEnvelope.containerSize] Size of the function container. + * + * @param {number} [siteEnvelope.dailyMemoryTimeQuota] Maximum allowed daily + * memory-time quota (applicable on dynamic apps only). + * + * @param {object} [siteEnvelope.cloningInfo] If specified during app creation, + * the app is cloned from a source app. + * + * @param {uuid} [siteEnvelope.cloningInfo.correlationId] Correlation ID of + * cloning operation. This ID ties multiple cloning operations + * together to use the same snapshot. + * + * @param {boolean} [siteEnvelope.cloningInfo.overwrite] true to + * overwrite destination app; otherwise, false. + * + * @param {boolean} [siteEnvelope.cloningInfo.cloneCustomHostNames] + * true to clone custom hostnames from source app; otherwise, + * false. + * + * @param {boolean} [siteEnvelope.cloningInfo.cloneSourceControl] + * true to clone source control from source app; otherwise, + * false. + * + * @param {string} siteEnvelope.cloningInfo.sourceWebAppId ARM resource ID of + * the source app. App resource ID is of the form + * /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName} + * for production slots and + * /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/slots/{slotName} + * for other slots. + * + * @param {string} [siteEnvelope.cloningInfo.hostingEnvironment] App Service + * Environment. + * + * @param {object} [siteEnvelope.cloningInfo.appSettingsOverrides] Application + * setting overrides for cloned app. If specified, these settings override the + * settings cloned + * from source app. Otherwise, application settings from source app are + * retained. + * + * @param {boolean} [siteEnvelope.cloningInfo.configureLoadBalancing] + * true to configure load balancing for source and destination + * app. + * + * @param {string} [siteEnvelope.cloningInfo.trafficManagerProfileId] ARM + * resource ID of the Traffic Manager profile to use, if it exists. Traffic + * Manager resource ID is of the form + * /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/trafficManagerProfiles/{profileName}. + * + * @param {string} [siteEnvelope.cloningInfo.trafficManagerProfileName] Name of + * Traffic Manager profile to create. This is only needed if Traffic Manager + * profile does not already exist. + * + * @param {boolean} [siteEnvelope.httpsOnly] HttpsOnly: configures a web site + * to accept only https requests. Issues redirect for + * http requests + * + * @param {object} [siteEnvelope.identity] + * + * @param {string} [siteEnvelope.identity.type] Type of managed service + * identity. Possible values include: 'SystemAssigned', 'UserAssigned' + * + * @param {array} [siteEnvelope.identity.identityIds] Array of UserAssigned + * managed service identities. + * + * @param {string} [siteEnvelope.kind] Kind of resource. + * + * @param {string} siteEnvelope.location Resource Location. + * + * @param {object} [siteEnvelope.tags] Resource tags. + * + * @param {string} slot Name of the deployment slot to create or update. By + * default, this API attempts to create or modify the production slot. + * + * @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. + */ + beginCreateOrUpdateSlotWithHttpOperationResponse(resourceGroupName: string, name: string, siteEnvelope: models.Site, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Creates a new web, mobile, or API app in an existing resource + * group, or updates an existing app. + * + * Creates a new web, mobile, or API app in an existing resource group, or + * updates an existing app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Unique name of the app to create or update. To create + * or update a deployment slot, use the {slot} parameter. + * + * @param {object} siteEnvelope A JSON representation of the app properties. + * See example. + * + * @param {boolean} [siteEnvelope.enabled] true if the app is + * enabled; otherwise, false. Setting this value to false disables + * the app (takes the app offline). + * + * @param {array} [siteEnvelope.hostNameSslStates] Hostname SSL states are used + * to manage the SSL bindings for app's hostnames. + * + * @param {string} [siteEnvelope.serverFarmId] Resource ID of the associated + * App Service plan, formatted as: + * "/subscriptions/{subscriptionID}/resourceGroups/{groupName}/providers/Microsoft.Web/serverfarms/{appServicePlanName}". + * + * @param {boolean} [siteEnvelope.reserved] true if reserved; + * otherwise, false. + * + * @param {boolean} [siteEnvelope.isXenon] Obsolete: Hyper-V sandbox. + * + * @param {boolean} [siteEnvelope.hyperV] Hyper-V sandbox. + * + * @param {object} [siteEnvelope.siteConfig] Configuration of the app. + * + * @param {number} [siteEnvelope.siteConfig.numberOfWorkers] Number of workers. + * + * @param {array} [siteEnvelope.siteConfig.defaultDocuments] Default documents. + * + * @param {string} [siteEnvelope.siteConfig.netFrameworkVersion] .NET Framework + * version. + * + * @param {string} [siteEnvelope.siteConfig.phpVersion] Version of PHP. + * + * @param {string} [siteEnvelope.siteConfig.pythonVersion] Version of Python. + * + * @param {string} [siteEnvelope.siteConfig.nodeVersion] Version of Node.js. + * + * @param {string} [siteEnvelope.siteConfig.linuxFxVersion] Linux App Framework + * and version + * + * @param {string} [siteEnvelope.siteConfig.windowsFxVersion] Xenon App + * Framework and version + * + * @param {boolean} [siteEnvelope.siteConfig.requestTracingEnabled] + * true if request tracing is enabled; otherwise, + * false. + * + * @param {date} [siteEnvelope.siteConfig.requestTracingExpirationTime] Request + * tracing expiration time. + * + * @param {boolean} [siteEnvelope.siteConfig.remoteDebuggingEnabled] + * true if remote debugging is enabled; otherwise, + * false. + * + * @param {string} [siteEnvelope.siteConfig.remoteDebuggingVersion] Remote + * debugging version. + * + * @param {boolean} [siteEnvelope.siteConfig.httpLoggingEnabled] + * true if HTTP logging is enabled; otherwise, false. + * + * @param {number} [siteEnvelope.siteConfig.logsDirectorySizeLimit] HTTP logs + * directory size limit. + * + * @param {boolean} [siteEnvelope.siteConfig.detailedErrorLoggingEnabled] + * true if detailed error logging is enabled; otherwise, + * false. + * + * @param {string} [siteEnvelope.siteConfig.publishingUsername] Publishing user + * name. + * + * @param {array} [siteEnvelope.siteConfig.appSettings] Application settings. + * + * @param {object} [siteEnvelope.siteConfig.azureStorageAccounts] User-provided + * Azure storage accounts. + * + * @param {array} [siteEnvelope.siteConfig.connectionStrings] Connection + * strings. + * + * @param {array} [siteEnvelope.siteConfig.handlerMappings] Handler mappings. + * + * @param {string} [siteEnvelope.siteConfig.documentRoot] Document root. + * + * @param {string} [siteEnvelope.siteConfig.scmType] SCM type. Possible values + * include: 'None', 'Dropbox', 'Tfs', 'LocalGit', 'GitHub', 'CodePlexGit', + * 'CodePlexHg', 'BitbucketGit', 'BitbucketHg', 'ExternalGit', 'ExternalHg', + * 'OneDrive', 'VSO' + * + * @param {boolean} [siteEnvelope.siteConfig.use32BitWorkerProcess] + * true to use 32-bit worker process; otherwise, + * false. + * + * @param {boolean} [siteEnvelope.siteConfig.webSocketsEnabled] + * true if WebSocket is enabled; otherwise, false. + * + * @param {boolean} [siteEnvelope.siteConfig.alwaysOn] true if + * Always On is enabled; otherwise, false. + * + * @param {string} [siteEnvelope.siteConfig.javaVersion] Java version. + * + * @param {string} [siteEnvelope.siteConfig.javaContainer] Java container. + * + * @param {string} [siteEnvelope.siteConfig.javaContainerVersion] Java + * container version. + * + * @param {string} [siteEnvelope.siteConfig.appCommandLine] App command line to + * launch. + * + * @param {string} [siteEnvelope.siteConfig.managedPipelineMode] Managed + * pipeline mode. Possible values include: 'Integrated', 'Classic' + * + * @param {array} [siteEnvelope.siteConfig.virtualApplications] Virtual + * applications. + * + * @param {string} [siteEnvelope.siteConfig.loadBalancing] Site load balancing. + * Possible values include: 'WeightedRoundRobin', 'LeastRequests', + * 'LeastResponseTime', 'WeightedTotalTraffic', 'RequestHash' + * + * @param {object} [siteEnvelope.siteConfig.experiments] This is work around + * for polymophic types. + * + * @param {array} [siteEnvelope.siteConfig.experiments.rampUpRules] List of + * ramp-up rules. + * + * @param {object} [siteEnvelope.siteConfig.limits] Site limits. + * + * @param {number} [siteEnvelope.siteConfig.limits.maxPercentageCpu] Maximum + * allowed CPU usage percentage. + * + * @param {number} [siteEnvelope.siteConfig.limits.maxMemoryInMb] Maximum + * allowed memory usage in MB. + * + * @param {number} [siteEnvelope.siteConfig.limits.maxDiskSizeInMb] Maximum + * allowed disk size usage in MB. + * + * @param {boolean} [siteEnvelope.siteConfig.autoHealEnabled] true + * if Auto Heal is enabled; otherwise, false. + * + * @param {object} [siteEnvelope.siteConfig.autoHealRules] Auto Heal rules. + * + * @param {object} [siteEnvelope.siteConfig.autoHealRules.triggers] Conditions + * that describe when to execute the auto-heal actions. + * + * @param {object} [siteEnvelope.siteConfig.autoHealRules.triggers.requests] A + * rule based on total requests. + * + * @param {number} + * [siteEnvelope.siteConfig.autoHealRules.triggers.requests.count] Request + * Count. + * + * @param {string} + * [siteEnvelope.siteConfig.autoHealRules.triggers.requests.timeInterval] Time + * interval. + * + * @param {number} + * [siteEnvelope.siteConfig.autoHealRules.triggers.privateBytesInKB] A rule + * based on private bytes. + * + * @param {array} [siteEnvelope.siteConfig.autoHealRules.triggers.statusCodes] + * A rule based on status codes. + * + * @param {object} + * [siteEnvelope.siteConfig.autoHealRules.triggers.slowRequests] A rule based + * on request execution time. + * + * @param {string} + * [siteEnvelope.siteConfig.autoHealRules.triggers.slowRequests.timeTaken] Time + * taken. + * + * @param {number} + * [siteEnvelope.siteConfig.autoHealRules.triggers.slowRequests.count] Request + * Count. + * + * @param {string} + * [siteEnvelope.siteConfig.autoHealRules.triggers.slowRequests.timeInterval] + * Time interval. + * + * @param {object} [siteEnvelope.siteConfig.autoHealRules.actions] Actions to + * be executed when a rule is triggered. + * + * @param {string} [siteEnvelope.siteConfig.autoHealRules.actions.actionType] + * Predefined action to be taken. Possible values include: 'Recycle', + * 'LogEvent', 'CustomAction' + * + * @param {object} [siteEnvelope.siteConfig.autoHealRules.actions.customAction] + * Custom action to be taken. + * + * @param {string} + * [siteEnvelope.siteConfig.autoHealRules.actions.customAction.exe] Executable + * to be run. + * + * @param {string} + * [siteEnvelope.siteConfig.autoHealRules.actions.customAction.parameters] + * Parameters for the executable. + * + * @param {string} + * [siteEnvelope.siteConfig.autoHealRules.actions.minProcessExecutionTime] + * Minimum time the process must execute + * before taking the action + * + * @param {string} [siteEnvelope.siteConfig.tracingOptions] Tracing options. + * + * @param {string} [siteEnvelope.siteConfig.vnetName] Virtual Network name. + * + * @param {object} [siteEnvelope.siteConfig.cors] Cross-Origin Resource Sharing + * (CORS) settings. + * + * @param {array} [siteEnvelope.siteConfig.cors.allowedOrigins] Gets or sets + * the list of origins that should be allowed to make cross-origin + * calls (for example: http://example.com:12345). Use "*" to allow all. + * + * @param {object} [siteEnvelope.siteConfig.push] Push endpoint settings. + * + * @param {boolean} siteEnvelope.siteConfig.push.isPushEnabled Gets or sets a + * flag indicating whether the Push endpoint is enabled. + * + * @param {string} [siteEnvelope.siteConfig.push.tagWhitelistJson] Gets or sets + * a JSON string containing a list of tags that are whitelisted for use by the + * push registration endpoint. + * + * @param {string} [siteEnvelope.siteConfig.push.tagsRequiringAuth] Gets or + * sets a JSON string containing a list of tags that require user + * authentication to be used in the push registration endpoint. + * Tags can consist of alphanumeric characters and the following: + * '_', '@', '#', '.', ':', '-'. + * Validation should be performed at the PushRequestHandler. + * + * @param {string} [siteEnvelope.siteConfig.push.dynamicTagsJson] Gets or sets + * a JSON string containing a list of dynamic tags that will be evaluated from + * user claims in the push registration endpoint. + * + * @param {string} [siteEnvelope.siteConfig.push.kind] Kind of resource. + * + * @param {object} [siteEnvelope.siteConfig.apiDefinition] Information about + * the formal API definition for the app. + * + * @param {string} [siteEnvelope.siteConfig.apiDefinition.url] The URL of the + * API definition. + * + * @param {string} [siteEnvelope.siteConfig.autoSwapSlotName] Auto-swap slot + * name. + * + * @param {boolean} [siteEnvelope.siteConfig.localMySqlEnabled] + * true to enable local MySQL; otherwise, false. + * + * @param {number} [siteEnvelope.siteConfig.managedServiceIdentityId] Managed + * Service Identity Id + * + * @param {number} [siteEnvelope.siteConfig.xManagedServiceIdentityId] Explicit + * Managed Service Identity Id + * + * @param {array} [siteEnvelope.siteConfig.ipSecurityRestrictions] IP security + * restrictions. + * + * @param {boolean} [siteEnvelope.siteConfig.http20Enabled] Http20Enabled: + * configures a web site to allow clients to connect over http2.0 + * + * @param {string} [siteEnvelope.siteConfig.minTlsVersion] MinTlsVersion: + * configures the minimum version of TLS required for SSL requests. Possible + * values include: '1.0', '1.1', '1.2' + * + * @param {string} [siteEnvelope.siteConfig.ftpsState] State of FTP / FTPS + * service. Possible values include: 'AllAllowed', 'FtpsOnly', 'Disabled' + * + * @param {number} [siteEnvelope.siteConfig.reservedInstanceCount] Number of + * reserved instances. + * This setting only applies to the Consumption Plan + * + * @param {boolean} [siteEnvelope.scmSiteAlsoStopped] true to stop + * SCM (KUDU) site when the app is stopped; otherwise, false. The + * default is false. + * + * @param {object} [siteEnvelope.hostingEnvironmentProfile] App Service + * Environment to use for the app. + * + * @param {string} [siteEnvelope.hostingEnvironmentProfile.id] Resource ID of + * the App Service Environment. + * + * @param {boolean} [siteEnvelope.clientAffinityEnabled] true to + * enable client affinity; false to stop sending session affinity + * cookies, which route client requests in the same session to the same + * instance. Default is true. + * + * @param {boolean} [siteEnvelope.clientCertEnabled] true to + * enable client certificate authentication (TLS mutual authentication); + * otherwise, false. Default is false. + * + * @param {boolean} [siteEnvelope.hostNamesDisabled] true to + * disable the public hostnames of the app; otherwise, false. + * If true, the app is only accessible via API management process. + * + * @param {number} [siteEnvelope.containerSize] Size of the function container. + * + * @param {number} [siteEnvelope.dailyMemoryTimeQuota] Maximum allowed daily + * memory-time quota (applicable on dynamic apps only). + * + * @param {object} [siteEnvelope.cloningInfo] If specified during app creation, + * the app is cloned from a source app. + * + * @param {uuid} [siteEnvelope.cloningInfo.correlationId] Correlation ID of + * cloning operation. This ID ties multiple cloning operations + * together to use the same snapshot. + * + * @param {boolean} [siteEnvelope.cloningInfo.overwrite] true to + * overwrite destination app; otherwise, false. + * + * @param {boolean} [siteEnvelope.cloningInfo.cloneCustomHostNames] + * true to clone custom hostnames from source app; otherwise, + * false. + * + * @param {boolean} [siteEnvelope.cloningInfo.cloneSourceControl] + * true to clone source control from source app; otherwise, + * false. + * + * @param {string} siteEnvelope.cloningInfo.sourceWebAppId ARM resource ID of + * the source app. App resource ID is of the form + * /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName} + * for production slots and + * /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/slots/{slotName} + * for other slots. + * + * @param {string} [siteEnvelope.cloningInfo.hostingEnvironment] App Service + * Environment. + * + * @param {object} [siteEnvelope.cloningInfo.appSettingsOverrides] Application + * setting overrides for cloned app. If specified, these settings override the + * settings cloned + * from source app. Otherwise, application settings from source app are + * retained. + * + * @param {boolean} [siteEnvelope.cloningInfo.configureLoadBalancing] + * true to configure load balancing for source and destination + * app. + * + * @param {string} [siteEnvelope.cloningInfo.trafficManagerProfileId] ARM + * resource ID of the Traffic Manager profile to use, if it exists. Traffic + * Manager resource ID is of the form + * /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/trafficManagerProfiles/{profileName}. + * + * @param {string} [siteEnvelope.cloningInfo.trafficManagerProfileName] Name of + * Traffic Manager profile to create. This is only needed if Traffic Manager + * profile does not already exist. + * + * @param {boolean} [siteEnvelope.httpsOnly] HttpsOnly: configures a web site + * to accept only https requests. Issues redirect for + * http requests + * + * @param {object} [siteEnvelope.identity] + * + * @param {string} [siteEnvelope.identity.type] Type of managed service + * identity. Possible values include: 'SystemAssigned', 'UserAssigned' + * + * @param {array} [siteEnvelope.identity.identityIds] Array of UserAssigned + * managed service identities. + * + * @param {string} [siteEnvelope.kind] Kind of resource. + * + * @param {string} siteEnvelope.location Resource Location. + * + * @param {object} [siteEnvelope.tags] Resource tags. + * + * @param {string} slot Name of the deployment slot to create or update. By + * default, this API attempts to create or modify the production slot. + * + * @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 {Site} - 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. + * + * {Site} [result] - The deserialized result object if an error did not occur. + * See {@link Site} 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. + */ + beginCreateOrUpdateSlot(resourceGroupName: string, name: string, siteEnvelope: models.Site, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginCreateOrUpdateSlot(resourceGroupName: string, name: string, siteEnvelope: models.Site, slot: string, callback: ServiceCallback): void; + beginCreateOrUpdateSlot(resourceGroupName: string, name: string, siteEnvelope: models.Site, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Restores a specific backup to another app (or deployment slot, if + * specified). + * + * Restores a specific backup to another app (or deployment slot, if + * specified). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} backupId ID of the backup. + * + * @param {object} request Information on restore request . + * + * @param {string} request.storageAccountUrl SAS URL to the container. + * + * @param {string} [request.blobName] Name of a blob which contains the backup. + * + * @param {boolean} request.overwrite true if the restore + * operation can overwrite target app; otherwise, false. + * true is needed if trying to restore over an existing app. + * + * @param {string} [request.siteName] Name of an app. + * + * @param {array} [request.databases] Collection of databases which should be + * restored. This list has to match the list of databases included in the + * backup. + * + * @param {boolean} [request.ignoreConflictingHostNames] Changes a logic when + * restoring an app with custom domains. true to remove custom + * domains automatically. If false, custom domains are added to + * the app's object when it is being restored, but that might fail due to + * conflicts during the operation. + * + * @param {boolean} [request.ignoreDatabases] Ignore the databases and only + * restore the site content + * + * @param {string} [request.appServicePlan] Specify app service plan that will + * own restored site. + * + * @param {string} [request.operationType] Operation type. Possible values + * include: 'Default', 'Clone', 'Relocation', 'Snapshot', 'CloudFS' + * + * @param {boolean} [request.adjustConnectionStrings] true if + * SiteConfig.ConnectionStrings should be set in new app; otherwise, + * false. + * + * @param {string} [request.hostingEnvironment] App Service Environment name, + * if needed (only when restoring an app to an App Service Environment). + * + * @param {string} [request.kind] Kind of resource. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will restore a backup of the production slot. + * + * @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. + */ + beginRestoreSlotWithHttpOperationResponse(resourceGroupName: string, name: string, backupId: string, request: models.RestoreRequest, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Restores a specific backup to another app (or deployment slot, if + * specified). + * + * Restores a specific backup to another app (or deployment slot, if + * specified). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} backupId ID of the backup. + * + * @param {object} request Information on restore request . + * + * @param {string} request.storageAccountUrl SAS URL to the container. + * + * @param {string} [request.blobName] Name of a blob which contains the backup. + * + * @param {boolean} request.overwrite true if the restore + * operation can overwrite target app; otherwise, false. + * true is needed if trying to restore over an existing app. + * + * @param {string} [request.siteName] Name of an app. + * + * @param {array} [request.databases] Collection of databases which should be + * restored. This list has to match the list of databases included in the + * backup. + * + * @param {boolean} [request.ignoreConflictingHostNames] Changes a logic when + * restoring an app with custom domains. true to remove custom + * domains automatically. If false, custom domains are added to + * the app's object when it is being restored, but that might fail due to + * conflicts during the operation. + * + * @param {boolean} [request.ignoreDatabases] Ignore the databases and only + * restore the site content + * + * @param {string} [request.appServicePlan] Specify app service plan that will + * own restored site. + * + * @param {string} [request.operationType] Operation type. Possible values + * include: 'Default', 'Clone', 'Relocation', 'Snapshot', 'CloudFS' + * + * @param {boolean} [request.adjustConnectionStrings] true if + * SiteConfig.ConnectionStrings should be set in new app; otherwise, + * false. + * + * @param {string} [request.hostingEnvironment] App Service Environment name, + * if needed (only when restoring an app to an App Service Environment). + * + * @param {string} [request.kind] Kind of resource. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will restore a backup of the production slot. + * + * @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 {null} - 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. + * + * {null} [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. + */ + beginRestoreSlot(resourceGroupName: string, name: string, backupId: string, request: models.RestoreRequest, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginRestoreSlot(resourceGroupName: string, name: string, backupId: string, request: models.RestoreRequest, slot: string, callback: ServiceCallback): void; + beginRestoreSlot(resourceGroupName: string, name: string, backupId: string, request: models.RestoreRequest, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Gets the Git/FTP publishing credentials of an app. + * + * Gets the Git/FTP publishing credentials of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will get the publishing credentials for the production + * slot. + * + * @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. + */ + beginListPublishingCredentialsSlotWithHttpOperationResponse(resourceGroupName: string, name: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets the Git/FTP publishing credentials of an app. + * + * Gets the Git/FTP publishing credentials of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will get the publishing credentials for the production + * slot. + * + * @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 {User} - 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. + * + * {User} [result] - The deserialized result object if an error did not occur. + * See {@link User} 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. + */ + beginListPublishingCredentialsSlot(resourceGroupName: string, name: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginListPublishingCredentialsSlot(resourceGroupName: string, name: string, slot: string, callback: ServiceCallback): void; + beginListPublishingCredentialsSlot(resourceGroupName: string, name: string, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Invoke the MSDeploy web app extension. + * + * Invoke the MSDeploy web app extension. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {string} slot Name of web app slot. If not specified then will + * default to production slot. + * + * @param {object} mSDeploy Details of MSDeploy operation + * + * @param {string} [mSDeploy.packageUri] Package URI + * + * @param {string} [mSDeploy.connectionString] SQL Connection String + * + * @param {string} [mSDeploy.dbType] Database Type + * + * @param {string} [mSDeploy.setParametersXmlFileUri] URI of MSDeploy + * Parameters file. Must not be set if SetParameters is used. + * + * @param {object} [mSDeploy.setParameters] MSDeploy Parameters. Must not be + * set if SetParametersXmlFileUri is used. + * + * @param {boolean} [mSDeploy.skipAppData] Controls whether the MSDeploy + * operation skips the App_Data directory. + * If set to true, the existing App_Data directory on the + * destination + * will not be deleted, and any App_Data directory in the source will be + * ignored. + * Setting is false by default. + * + * @param {boolean} [mSDeploy.appOffline] Sets the AppOffline rule while the + * MSDeploy operation executes. + * Setting is false by default. + * + * @param {string} [mSDeploy.kind] Kind of resource. + * + * @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. + */ + beginCreateMSDeployOperationSlotWithHttpOperationResponse(resourceGroupName: string, name: string, slot: string, mSDeploy: models.MSDeploy, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Invoke the MSDeploy web app extension. + * + * Invoke the MSDeploy web app extension. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {string} slot Name of web app slot. If not specified then will + * default to production slot. + * + * @param {object} mSDeploy Details of MSDeploy operation + * + * @param {string} [mSDeploy.packageUri] Package URI + * + * @param {string} [mSDeploy.connectionString] SQL Connection String + * + * @param {string} [mSDeploy.dbType] Database Type + * + * @param {string} [mSDeploy.setParametersXmlFileUri] URI of MSDeploy + * Parameters file. Must not be set if SetParameters is used. + * + * @param {object} [mSDeploy.setParameters] MSDeploy Parameters. Must not be + * set if SetParametersXmlFileUri is used. + * + * @param {boolean} [mSDeploy.skipAppData] Controls whether the MSDeploy + * operation skips the App_Data directory. + * If set to true, the existing App_Data directory on the + * destination + * will not be deleted, and any App_Data directory in the source will be + * ignored. + * Setting is false by default. + * + * @param {boolean} [mSDeploy.appOffline] Sets the AppOffline rule while the + * MSDeploy operation executes. + * Setting is false by default. + * + * @param {string} [mSDeploy.kind] Kind of resource. + * + * @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 {MSDeployStatus} - 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. + * + * {MSDeployStatus} [result] - The deserialized result object if an error did not occur. + * See {@link MSDeployStatus} 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. + */ + beginCreateMSDeployOperationSlot(resourceGroupName: string, name: string, slot: string, mSDeploy: models.MSDeploy, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginCreateMSDeployOperationSlot(resourceGroupName: string, name: string, slot: string, mSDeploy: models.MSDeploy, callback: ServiceCallback): void; + beginCreateMSDeployOperationSlot(resourceGroupName: string, name: string, slot: string, mSDeploy: models.MSDeploy, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Create function for web site, or a deployment slot. + * + * Create function for web site, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} functionName Function name. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API deletes a deployment for the production slot. + * + * @param {object} functionEnvelope Function details. + * + * @param {string} [functionEnvelope.functionAppId] Function App ID. + * + * @param {string} [functionEnvelope.scriptRootPathHref] Script root path URI. + * + * @param {string} [functionEnvelope.scriptHref] Script URI. + * + * @param {string} [functionEnvelope.configHref] Config URI. + * + * @param {string} [functionEnvelope.secretsFileHref] Secrets file URI. + * + * @param {string} [functionEnvelope.href] Function URI. + * + * @param {object} [functionEnvelope.config] Config information. + * + * @param {object} [functionEnvelope.files] File list. + * + * @param {string} [functionEnvelope.testData] Test data used when testing via + * the Azure Portal. + * + * @param {string} [functionEnvelope.kind] Kind of resource. + * + * @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. + */ + beginCreateInstanceFunctionSlotWithHttpOperationResponse(resourceGroupName: string, name: string, functionName: string, slot: string, functionEnvelope: models.FunctionEnvelope, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Create function for web site, or a deployment slot. + * + * Create function for web site, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} functionName Function name. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API deletes a deployment for the production slot. + * + * @param {object} functionEnvelope Function details. + * + * @param {string} [functionEnvelope.functionAppId] Function App ID. + * + * @param {string} [functionEnvelope.scriptRootPathHref] Script root path URI. + * + * @param {string} [functionEnvelope.scriptHref] Script URI. + * + * @param {string} [functionEnvelope.configHref] Config URI. + * + * @param {string} [functionEnvelope.secretsFileHref] Secrets file URI. + * + * @param {string} [functionEnvelope.href] Function URI. + * + * @param {object} [functionEnvelope.config] Config information. + * + * @param {object} [functionEnvelope.files] File list. + * + * @param {string} [functionEnvelope.testData] Test data used when testing via + * the Azure Portal. + * + * @param {string} [functionEnvelope.kind] Kind of resource. + * + * @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 {FunctionEnvelope} - 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. + * + * {FunctionEnvelope} [result] - The deserialized result object if an error did not occur. + * See {@link FunctionEnvelope} 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. + */ + beginCreateInstanceFunctionSlot(resourceGroupName: string, name: string, functionName: string, slot: string, functionEnvelope: models.FunctionEnvelope, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginCreateInstanceFunctionSlot(resourceGroupName: string, name: string, functionName: string, slot: string, functionEnvelope: models.FunctionEnvelope, callback: ServiceCallback): void; + beginCreateInstanceFunctionSlot(resourceGroupName: string, name: string, functionName: string, slot: string, functionEnvelope: models.FunctionEnvelope, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Invoke the MSDeploy web app extension. + * + * Invoke the MSDeploy web app extension. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {string} slot Name of web app slot. If not specified then will + * default to production slot. + * + * @param {string} instanceId ID of web app instance. + * + * @param {object} mSDeploy Details of MSDeploy operation + * + * @param {string} [mSDeploy.packageUri] Package URI + * + * @param {string} [mSDeploy.connectionString] SQL Connection String + * + * @param {string} [mSDeploy.dbType] Database Type + * + * @param {string} [mSDeploy.setParametersXmlFileUri] URI of MSDeploy + * Parameters file. Must not be set if SetParameters is used. + * + * @param {object} [mSDeploy.setParameters] MSDeploy Parameters. Must not be + * set if SetParametersXmlFileUri is used. + * + * @param {boolean} [mSDeploy.skipAppData] Controls whether the MSDeploy + * operation skips the App_Data directory. + * If set to true, the existing App_Data directory on the + * destination + * will not be deleted, and any App_Data directory in the source will be + * ignored. + * Setting is false by default. + * + * @param {boolean} [mSDeploy.appOffline] Sets the AppOffline rule while the + * MSDeploy operation executes. + * Setting is false by default. + * + * @param {string} [mSDeploy.kind] Kind of resource. + * + * @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. + */ + beginCreateInstanceMSDeployOperationSlotWithHttpOperationResponse(resourceGroupName: string, name: string, slot: string, instanceId: string, mSDeploy: models.MSDeploy, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Invoke the MSDeploy web app extension. + * + * Invoke the MSDeploy web app extension. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {string} slot Name of web app slot. If not specified then will + * default to production slot. + * + * @param {string} instanceId ID of web app instance. + * + * @param {object} mSDeploy Details of MSDeploy operation + * + * @param {string} [mSDeploy.packageUri] Package URI + * + * @param {string} [mSDeploy.connectionString] SQL Connection String + * + * @param {string} [mSDeploy.dbType] Database Type + * + * @param {string} [mSDeploy.setParametersXmlFileUri] URI of MSDeploy + * Parameters file. Must not be set if SetParameters is used. + * + * @param {object} [mSDeploy.setParameters] MSDeploy Parameters. Must not be + * set if SetParametersXmlFileUri is used. + * + * @param {boolean} [mSDeploy.skipAppData] Controls whether the MSDeploy + * operation skips the App_Data directory. + * If set to true, the existing App_Data directory on the + * destination + * will not be deleted, and any App_Data directory in the source will be + * ignored. + * Setting is false by default. + * + * @param {boolean} [mSDeploy.appOffline] Sets the AppOffline rule while the + * MSDeploy operation executes. + * Setting is false by default. + * + * @param {string} [mSDeploy.kind] Kind of resource. + * + * @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 {MSDeployStatus} - 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. + * + * {MSDeployStatus} [result] - The deserialized result object if an error did not occur. + * See {@link MSDeployStatus} 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. + */ + beginCreateInstanceMSDeployOperationSlot(resourceGroupName: string, name: string, slot: string, instanceId: string, mSDeploy: models.MSDeploy, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginCreateInstanceMSDeployOperationSlot(resourceGroupName: string, name: string, slot: string, instanceId: string, mSDeploy: models.MSDeploy, callback: ServiceCallback): void; + beginCreateInstanceMSDeployOperationSlot(resourceGroupName: string, name: string, slot: string, instanceId: string, mSDeploy: models.MSDeploy, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Restores an app from a backup blob in Azure Storage. + * + * Restores an app from a backup blob in Azure Storage. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} request Information on restore request . + * + * @param {string} request.storageAccountUrl SAS URL to the container. + * + * @param {string} [request.blobName] Name of a blob which contains the backup. + * + * @param {boolean} request.overwrite true if the restore + * operation can overwrite target app; otherwise, false. + * true is needed if trying to restore over an existing app. + * + * @param {string} [request.siteName] Name of an app. + * + * @param {array} [request.databases] Collection of databases which should be + * restored. This list has to match the list of databases included in the + * backup. + * + * @param {boolean} [request.ignoreConflictingHostNames] Changes a logic when + * restoring an app with custom domains. true to remove custom + * domains automatically. If false, custom domains are added to + * the app's object when it is being restored, but that might fail due to + * conflicts during the operation. + * + * @param {boolean} [request.ignoreDatabases] Ignore the databases and only + * restore the site content + * + * @param {string} [request.appServicePlan] Specify app service plan that will + * own restored site. + * + * @param {string} [request.operationType] Operation type. Possible values + * include: 'Default', 'Clone', 'Relocation', 'Snapshot', 'CloudFS' + * + * @param {boolean} [request.adjustConnectionStrings] true if + * SiteConfig.ConnectionStrings should be set in new app; otherwise, + * false. + * + * @param {string} [request.hostingEnvironment] App Service Environment name, + * if needed (only when restoring an app to an App Service Environment). + * + * @param {string} [request.kind] Kind of resource. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will restore a backup of the production slot. + * + * @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. + */ + beginRestoreFromBackupBlobSlotWithHttpOperationResponse(resourceGroupName: string, name: string, request: models.RestoreRequest, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Restores an app from a backup blob in Azure Storage. + * + * Restores an app from a backup blob in Azure Storage. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} request Information on restore request . + * + * @param {string} request.storageAccountUrl SAS URL to the container. + * + * @param {string} [request.blobName] Name of a blob which contains the backup. + * + * @param {boolean} request.overwrite true if the restore + * operation can overwrite target app; otherwise, false. + * true is needed if trying to restore over an existing app. + * + * @param {string} [request.siteName] Name of an app. + * + * @param {array} [request.databases] Collection of databases which should be + * restored. This list has to match the list of databases included in the + * backup. + * + * @param {boolean} [request.ignoreConflictingHostNames] Changes a logic when + * restoring an app with custom domains. true to remove custom + * domains automatically. If false, custom domains are added to + * the app's object when it is being restored, but that might fail due to + * conflicts during the operation. + * + * @param {boolean} [request.ignoreDatabases] Ignore the databases and only + * restore the site content + * + * @param {string} [request.appServicePlan] Specify app service plan that will + * own restored site. + * + * @param {string} [request.operationType] Operation type. Possible values + * include: 'Default', 'Clone', 'Relocation', 'Snapshot', 'CloudFS' + * + * @param {boolean} [request.adjustConnectionStrings] true if + * SiteConfig.ConnectionStrings should be set in new app; otherwise, + * false. + * + * @param {string} [request.hostingEnvironment] App Service Environment name, + * if needed (only when restoring an app to an App Service Environment). + * + * @param {string} [request.kind] Kind of resource. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will restore a backup of the production slot. + * + * @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 {null} - 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. + * + * {null} [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. + */ + beginRestoreFromBackupBlobSlot(resourceGroupName: string, name: string, request: models.RestoreRequest, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginRestoreFromBackupBlobSlot(resourceGroupName: string, name: string, request: models.RestoreRequest, slot: string, callback: ServiceCallback): void; + beginRestoreFromBackupBlobSlot(resourceGroupName: string, name: string, request: models.RestoreRequest, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Restores a deleted web app to this web app. + * + * Restores a deleted web app to this web app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {object} restoreRequest Deleted web app restore information. + * + * @param {string} [restoreRequest.deletedSiteId] ARM resource ID of the + * deleted app. Example: + * /subscriptions/{subId}/providers/Microsoft.Web/deletedSites/{deletedSiteId} + * + * @param {boolean} [restoreRequest.recoverConfiguration] If true, deleted site + * configuration, in addition to content, will be restored. + * + * @param {string} [restoreRequest.snapshotTime] Point in time to restore the + * deleted app from, formatted as a DateTime string. + * If unspecified, default value is the time that the app was deleted. + * + * @param {string} [restoreRequest.kind] Kind of resource. + * + * @param {string} slot Name of web app slot. If not specified then will + * default to production slot. + * + * @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. + */ + beginRestoreFromDeletedAppSlotWithHttpOperationResponse(resourceGroupName: string, name: string, restoreRequest: models.DeletedAppRestoreRequest, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Restores a deleted web app to this web app. + * + * Restores a deleted web app to this web app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {object} restoreRequest Deleted web app restore information. + * + * @param {string} [restoreRequest.deletedSiteId] ARM resource ID of the + * deleted app. Example: + * /subscriptions/{subId}/providers/Microsoft.Web/deletedSites/{deletedSiteId} + * + * @param {boolean} [restoreRequest.recoverConfiguration] If true, deleted site + * configuration, in addition to content, will be restored. + * + * @param {string} [restoreRequest.snapshotTime] Point in time to restore the + * deleted app from, formatted as a DateTime string. + * If unspecified, default value is the time that the app was deleted. + * + * @param {string} [restoreRequest.kind] Kind of resource. + * + * @param {string} slot Name of web app slot. If not specified then will + * default to production slot. + * + * @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 {null} - 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. + * + * {null} [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. + */ + beginRestoreFromDeletedAppSlot(resourceGroupName: string, name: string, restoreRequest: models.DeletedAppRestoreRequest, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginRestoreFromDeletedAppSlot(resourceGroupName: string, name: string, restoreRequest: models.DeletedAppRestoreRequest, slot: string, callback: ServiceCallback): void; + beginRestoreFromDeletedAppSlot(resourceGroupName: string, name: string, restoreRequest: models.DeletedAppRestoreRequest, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Restores a web app from a snapshot. + * + * Restores a web app from a snapshot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {object} restoreRequest Snapshot restore settings. Snapshot + * information can be obtained by calling GetDeletedSites or GetSiteSnapshots + * API. + * + * @param {string} [restoreRequest.snapshotTime] Point in time in which the app + * restore should be done, formatted as a DateTime string. + * + * @param {object} [restoreRequest.recoverySource] Optional. Specifies the web + * app that snapshot contents will be retrieved from. + * If empty, the targeted web app will be used as the source. + * + * @param {string} [restoreRequest.recoverySource.location] Geographical + * location of the source web app, e.g. SouthEastAsia, SouthCentralUS + * + * @param {string} [restoreRequest.recoverySource.id] ARM resource ID of the + * source app. + * /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName} + * for production slots and + * /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/slots/{slotName} + * for other slots. + * + * @param {boolean} restoreRequest.overwrite If true the restore + * operation can overwrite source app; otherwise, false. + * + * @param {boolean} [restoreRequest.recoverConfiguration] If true, site + * configuration, in addition to content, will be reverted. + * + * @param {boolean} [restoreRequest.ignoreConflictingHostNames] If true, custom + * hostname conflicts will be ignored when recovering to a target web app. + * This setting is only necessary when RecoverConfiguration is enabled. + * + * @param {string} [restoreRequest.kind] Kind of resource. + * + * @param {string} slot Name of web app slot. If not specified then will + * default to production slot. + * + * @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. + */ + beginRestoreSnapshotSlotWithHttpOperationResponse(resourceGroupName: string, name: string, restoreRequest: models.SnapshotRestoreRequest, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Restores a web app from a snapshot. + * + * Restores a web app from a snapshot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {object} restoreRequest Snapshot restore settings. Snapshot + * information can be obtained by calling GetDeletedSites or GetSiteSnapshots + * API. + * + * @param {string} [restoreRequest.snapshotTime] Point in time in which the app + * restore should be done, formatted as a DateTime string. + * + * @param {object} [restoreRequest.recoverySource] Optional. Specifies the web + * app that snapshot contents will be retrieved from. + * If empty, the targeted web app will be used as the source. + * + * @param {string} [restoreRequest.recoverySource.location] Geographical + * location of the source web app, e.g. SouthEastAsia, SouthCentralUS + * + * @param {string} [restoreRequest.recoverySource.id] ARM resource ID of the + * source app. + * /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName} + * for production slots and + * /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/slots/{slotName} + * for other slots. + * + * @param {boolean} restoreRequest.overwrite If true the restore + * operation can overwrite source app; otherwise, false. + * + * @param {boolean} [restoreRequest.recoverConfiguration] If true, site + * configuration, in addition to content, will be reverted. + * + * @param {boolean} [restoreRequest.ignoreConflictingHostNames] If true, custom + * hostname conflicts will be ignored when recovering to a target web app. + * This setting is only necessary when RecoverConfiguration is enabled. + * + * @param {string} [restoreRequest.kind] Kind of resource. + * + * @param {string} slot Name of web app slot. If not specified then will + * default to production slot. + * + * @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 {null} - 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. + * + * {null} [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. + */ + beginRestoreSnapshotSlot(resourceGroupName: string, name: string, restoreRequest: models.SnapshotRestoreRequest, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginRestoreSnapshotSlot(resourceGroupName: string, name: string, restoreRequest: models.SnapshotRestoreRequest, slot: string, callback: ServiceCallback): void; + beginRestoreSnapshotSlot(resourceGroupName: string, name: string, restoreRequest: models.SnapshotRestoreRequest, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Install site extension on a web site, or a deployment slot. + * + * Install site extension on a web site, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} siteExtensionId Site extension name. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API deletes a deployment for the production slot. + * + * @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. + */ + beginInstallSiteExtensionSlotWithHttpOperationResponse(resourceGroupName: string, name: string, siteExtensionId: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Install site extension on a web site, or a deployment slot. + * + * Install site extension on a web site, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} siteExtensionId Site extension name. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API deletes a deployment for the production slot. + * + * @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 {SiteExtensionInfo} - 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. + * + * {SiteExtensionInfo} [result] - The deserialized result object if an error did not occur. + * See {@link SiteExtensionInfo} 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. + */ + beginInstallSiteExtensionSlot(resourceGroupName: string, name: string, siteExtensionId: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginInstallSiteExtensionSlot(resourceGroupName: string, name: string, siteExtensionId: string, slot: string, callback: ServiceCallback): void; + beginInstallSiteExtensionSlot(resourceGroupName: string, name: string, siteExtensionId: string, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Swaps two deployment slots of an app. + * + * Swaps two deployment slots of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} slotSwapEntity JSON object that contains the target slot + * name. See example. + * + * @param {string} slotSwapEntity.targetSlot Destination deployment slot during + * swap operation. + * + * @param {boolean} slotSwapEntity.preserveVnet true to preserve + * Virtual Network to the slot during swap; otherwise, false. + * + * @param {string} slot Name of the source slot. If a slot is not specified, + * the production slot is used as the source slot. + * + * @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. + */ + beginSwapSlotSlotWithHttpOperationResponse(resourceGroupName: string, name: string, slotSwapEntity: models.CsmSlotEntity, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Swaps two deployment slots of an app. + * + * Swaps two deployment slots of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} slotSwapEntity JSON object that contains the target slot + * name. See example. + * + * @param {string} slotSwapEntity.targetSlot Destination deployment slot during + * swap operation. + * + * @param {boolean} slotSwapEntity.preserveVnet true to preserve + * Virtual Network to the slot during swap; otherwise, false. + * + * @param {string} slot Name of the source slot. If a slot is not specified, + * the production slot is used as the source slot. + * + * @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 {null} - 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. + * + * {null} [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. + */ + beginSwapSlotSlot(resourceGroupName: string, name: string, slotSwapEntity: models.CsmSlotEntity, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginSwapSlotSlot(resourceGroupName: string, name: string, slotSwapEntity: models.CsmSlotEntity, slot: string, callback: ServiceCallback): void; + beginSwapSlotSlot(resourceGroupName: string, name: string, slotSwapEntity: models.CsmSlotEntity, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Updates the source control configuration of an app. + * + * Updates the source control configuration of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} siteSourceControl JSON representation of a SiteSourceControl + * object. See example. + * + * @param {string} [siteSourceControl.repoUrl] Repository or source control + * URL. + * + * @param {string} [siteSourceControl.branch] Name of branch to use for + * deployment. + * + * @param {boolean} [siteSourceControl.isManualIntegration] true + * to limit to manual integration; false to enable continuous + * integration (which configures webhooks into online repos like GitHub). + * + * @param {boolean} [siteSourceControl.deploymentRollbackEnabled] + * true to enable deployment rollback; otherwise, + * false. + * + * @param {boolean} [siteSourceControl.isMercurial] true for a + * Mercurial repository; false for a Git repository. + * + * @param {string} [siteSourceControl.kind] Kind of resource. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will update the source control configuration for the + * production slot. + * + * @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. + */ + beginCreateOrUpdateSourceControlSlotWithHttpOperationResponse(resourceGroupName: string, name: string, siteSourceControl: models.SiteSourceControl, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Updates the source control configuration of an app. + * + * Updates the source control configuration of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} siteSourceControl JSON representation of a SiteSourceControl + * object. See example. + * + * @param {string} [siteSourceControl.repoUrl] Repository or source control + * URL. + * + * @param {string} [siteSourceControl.branch] Name of branch to use for + * deployment. + * + * @param {boolean} [siteSourceControl.isManualIntegration] true + * to limit to manual integration; false to enable continuous + * integration (which configures webhooks into online repos like GitHub). + * + * @param {boolean} [siteSourceControl.deploymentRollbackEnabled] + * true to enable deployment rollback; otherwise, + * false. + * + * @param {boolean} [siteSourceControl.isMercurial] true for a + * Mercurial repository; false for a Git repository. + * + * @param {string} [siteSourceControl.kind] Kind of resource. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will update the source control configuration for the + * production slot. + * + * @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 {SiteSourceControl} - 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. + * + * {SiteSourceControl} [result] - The deserialized result object if an error did not occur. + * See {@link SiteSourceControl} 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. + */ + beginCreateOrUpdateSourceControlSlot(resourceGroupName: string, name: string, siteSourceControl: models.SiteSourceControl, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginCreateOrUpdateSourceControlSlot(resourceGroupName: string, name: string, siteSourceControl: models.SiteSourceControl, slot: string, callback: ServiceCallback): void; + beginCreateOrUpdateSourceControlSlot(resourceGroupName: string, name: string, siteSourceControl: models.SiteSourceControl, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Swaps two deployment slots of an app. + * + * Swaps two deployment slots of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} slotSwapEntity JSON object that contains the target slot + * name. See example. + * + * @param {string} slotSwapEntity.targetSlot Destination deployment slot during + * swap operation. + * + * @param {boolean} slotSwapEntity.preserveVnet true to preserve + * Virtual Network to the slot during swap; otherwise, false. + * + * @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. + */ + beginSwapSlotWithProductionWithHttpOperationResponse(resourceGroupName: string, name: string, slotSwapEntity: models.CsmSlotEntity, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Swaps two deployment slots of an app. + * + * Swaps two deployment slots of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} slotSwapEntity JSON object that contains the target slot + * name. See example. + * + * @param {string} slotSwapEntity.targetSlot Destination deployment slot during + * swap operation. + * + * @param {boolean} slotSwapEntity.preserveVnet true to preserve + * Virtual Network to the slot during swap; otherwise, false. + * + * @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 {null} - 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. + * + * {null} [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. + */ + beginSwapSlotWithProduction(resourceGroupName: string, name: string, slotSwapEntity: models.CsmSlotEntity, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginSwapSlotWithProduction(resourceGroupName: string, name: string, slotSwapEntity: models.CsmSlotEntity, callback: ServiceCallback): void; + beginSwapSlotWithProduction(resourceGroupName: string, name: string, slotSwapEntity: models.CsmSlotEntity, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Updates the source control configuration of an app. + * + * Updates the source control configuration of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} siteSourceControl JSON representation of a SiteSourceControl + * object. See example. + * + * @param {string} [siteSourceControl.repoUrl] Repository or source control + * URL. + * + * @param {string} [siteSourceControl.branch] Name of branch to use for + * deployment. + * + * @param {boolean} [siteSourceControl.isManualIntegration] true + * to limit to manual integration; false to enable continuous + * integration (which configures webhooks into online repos like GitHub). + * + * @param {boolean} [siteSourceControl.deploymentRollbackEnabled] + * true to enable deployment rollback; otherwise, + * false. + * + * @param {boolean} [siteSourceControl.isMercurial] true for a + * Mercurial repository; false for a Git repository. + * + * @param {string} [siteSourceControl.kind] Kind of resource. + * + * @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. + */ + beginCreateOrUpdateSourceControlWithHttpOperationResponse(resourceGroupName: string, name: string, siteSourceControl: models.SiteSourceControl, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Updates the source control configuration of an app. + * + * Updates the source control configuration of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} siteSourceControl JSON representation of a SiteSourceControl + * object. See example. + * + * @param {string} [siteSourceControl.repoUrl] Repository or source control + * URL. + * + * @param {string} [siteSourceControl.branch] Name of branch to use for + * deployment. + * + * @param {boolean} [siteSourceControl.isManualIntegration] true + * to limit to manual integration; false to enable continuous + * integration (which configures webhooks into online repos like GitHub). + * + * @param {boolean} [siteSourceControl.deploymentRollbackEnabled] + * true to enable deployment rollback; otherwise, + * false. + * + * @param {boolean} [siteSourceControl.isMercurial] true for a + * Mercurial repository; false for a Git repository. + * + * @param {string} [siteSourceControl.kind] Kind of resource. + * + * @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 {SiteSourceControl} - 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. + * + * {SiteSourceControl} [result] - The deserialized result object if an error did not occur. + * See {@link SiteSourceControl} 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. + */ + beginCreateOrUpdateSourceControl(resourceGroupName: string, name: string, siteSourceControl: models.SiteSourceControl, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginCreateOrUpdateSourceControl(resourceGroupName: string, name: string, siteSourceControl: models.SiteSourceControl, callback: ServiceCallback): void; + beginCreateOrUpdateSourceControl(resourceGroupName: string, name: string, siteSourceControl: models.SiteSourceControl, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Get all apps for a subscription. + * + * Get all apps for a subscription. + * + * @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 Get all apps for a subscription. + * + * Get all apps for a subscription. + * + * @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 {WebAppCollection} - 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. + * + * {WebAppCollection} [result] - The deserialized result object if an error did not occur. + * See {@link WebAppCollection} 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; + + + /** + * @summary Gets all web, mobile, and API apps in the specified resource group. + * + * Gets all web, mobile, and API apps in the specified resource group. + * + * @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. + */ + listByResourceGroupNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets all web, mobile, and API apps in the specified resource group. + * + * Gets all web, mobile, and API apps in the specified resource group. + * + * @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 {WebAppCollection} - 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. + * + * {WebAppCollection} [result] - The deserialized result object if an error did not occur. + * See {@link WebAppCollection} 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. + */ + listByResourceGroupNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByResourceGroupNext(nextPageLink: string, callback: ServiceCallback): void; + listByResourceGroupNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Gets existing backups of an app. + * + * Gets existing backups of an app. + * + * @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. + */ + listBackupsNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets existing backups of an app. + * + * Gets existing backups of an app. + * + * @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 {BackupItemCollection} - 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. + * + * {BackupItemCollection} [result] - The deserialized result object if an error did not occur. + * See {@link BackupItemCollection} 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. + */ + listBackupsNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listBackupsNext(nextPageLink: string, callback: ServiceCallback): void; + listBackupsNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary List the configurations of an app + * + * List the configurations of an app + * + * @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. + */ + listConfigurationsNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary List the configurations of an app + * + * List the configurations of an app + * + * @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 {SiteConfigResourceCollection} - 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. + * + * {SiteConfigResourceCollection} [result] - The deserialized result object if an error did not occur. + * See {@link SiteConfigResourceCollection} 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. + */ + listConfigurationsNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listConfigurationsNext(nextPageLink: string, callback: ServiceCallback): void; + listConfigurationsNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Gets a list of web app configuration snapshots identifiers. Each + * element of the list contains a timestamp and the ID of the snapshot. + * + * Gets a list of web app configuration snapshots identifiers. Each element of + * the list contains a timestamp and the ID of the snapshot. + * + * @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. + */ + listConfigurationSnapshotInfoNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets a list of web app configuration snapshots identifiers. Each + * element of the list contains a timestamp and the ID of the snapshot. + * + * Gets a list of web app configuration snapshots identifiers. Each element of + * the list contains a timestamp and the ID of the snapshot. + * + * @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 {SiteConfigurationSnapshotInfoCollection} - 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. + * + * {SiteConfigurationSnapshotInfoCollection} [result] - The deserialized result object if an error did not occur. + * See {@link SiteConfigurationSnapshotInfoCollection} 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. + */ + listConfigurationSnapshotInfoNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listConfigurationSnapshotInfoNext(nextPageLink: string, callback: ServiceCallback): void; + listConfigurationSnapshotInfoNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary List continuous web jobs for an app, or a deployment slot. + * + * List continuous web jobs for an app, or a deployment slot. + * + * @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. + */ + listContinuousWebJobsNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary List continuous web jobs for an app, or a deployment slot. + * + * List continuous web jobs for an app, or a deployment slot. + * + * @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 {ContinuousWebJobCollection} - 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. + * + * {ContinuousWebJobCollection} [result] - The deserialized result object if an error did not occur. + * See {@link ContinuousWebJobCollection} 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. + */ + listContinuousWebJobsNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listContinuousWebJobsNext(nextPageLink: string, callback: ServiceCallback): void; + listContinuousWebJobsNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary List deployments for an app, or a deployment slot. + * + * List deployments for an app, or a deployment slot. + * + * @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. + */ + listDeploymentsNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary List deployments for an app, or a deployment slot. + * + * List deployments for an app, or a deployment slot. + * + * @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 {DeploymentCollection} - 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. + * + * {DeploymentCollection} [result] - The deserialized result object if an error did not occur. + * See {@link DeploymentCollection} 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. + */ + listDeploymentsNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listDeploymentsNext(nextPageLink: string, callback: ServiceCallback): void; + listDeploymentsNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Lists ownership identifiers for domain associated with web app. + * + * Lists ownership identifiers for domain associated with web app. + * + * @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. + */ + listDomainOwnershipIdentifiersNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Lists ownership identifiers for domain associated with web app. + * + * Lists ownership identifiers for domain associated with web app. + * + * @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 {IdentifierCollection} - 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. + * + * {IdentifierCollection} [result] - The deserialized result object if an error did not occur. + * See {@link IdentifierCollection} 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. + */ + listDomainOwnershipIdentifiersNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listDomainOwnershipIdentifiersNext(nextPageLink: string, callback: ServiceCallback): void; + listDomainOwnershipIdentifiersNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary List the functions for a web site, or a deployment slot. + * + * List the functions for a web site, or a deployment slot. + * + * @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. + */ + listFunctionsNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary List the functions for a web site, or a deployment slot. + * + * List the functions for a web site, or a deployment slot. + * + * @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 {FunctionEnvelopeCollection} - 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. + * + * {FunctionEnvelopeCollection} [result] - The deserialized result object if an error did not occur. + * See {@link FunctionEnvelopeCollection} 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. + */ + listFunctionsNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listFunctionsNext(nextPageLink: string, callback: ServiceCallback): void; + listFunctionsNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Get hostname bindings for an app or a deployment slot. + * + * Get hostname bindings for an app or a deployment slot. + * + * @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. + */ + listHostNameBindingsNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get hostname bindings for an app or a deployment slot. + * + * Get hostname bindings for an app or a deployment slot. + * + * @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 {HostNameBindingCollection} - 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. + * + * {HostNameBindingCollection} [result] - The deserialized result object if an error did not occur. + * See {@link HostNameBindingCollection} 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. + */ + listHostNameBindingsNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listHostNameBindingsNext(nextPageLink: string, callback: ServiceCallback): void; + listHostNameBindingsNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Gets all scale-out instances of an app. + * + * Gets all scale-out instances of an app. + * + * @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. + */ + listInstanceIdentifiersNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets all scale-out instances of an app. + * + * Gets all scale-out instances of an app. + * + * @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 {WebAppInstanceCollection} - 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. + * + * {WebAppInstanceCollection} [result] - The deserialized result object if an error did not occur. + * See {@link WebAppInstanceCollection} 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. + */ + listInstanceIdentifiersNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listInstanceIdentifiersNext(nextPageLink: string, callback: ServiceCallback): void; + listInstanceIdentifiersNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Get list of processes for a web site, or a deployment slot, or for + * a specific scaled-out instance in a web site. + * + * Get list of processes for a web site, or a deployment slot, or for a + * specific scaled-out instance in a web site. + * + * @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. + */ + listInstanceProcessesNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get list of processes for a web site, or a deployment slot, or for + * a specific scaled-out instance in a web site. + * + * Get list of processes for a web site, or a deployment slot, or for a + * specific scaled-out instance in a web site. + * + * @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 {ProcessInfoCollection} - 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. + * + * {ProcessInfoCollection} [result] - The deserialized result object if an error did not occur. + * See {@link ProcessInfoCollection} 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. + */ + listInstanceProcessesNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listInstanceProcessesNext(nextPageLink: string, callback: ServiceCallback): void; + listInstanceProcessesNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary List module information for a process by its ID for a specific + * scaled-out instance in a web site. + * + * List module information for a process by its ID for a specific scaled-out + * instance in a web site. + * + * @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. + */ + listInstanceProcessModulesNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary List module information for a process by its ID for a specific + * scaled-out instance in a web site. + * + * List module information for a process by its ID for a specific scaled-out + * instance in a web site. + * + * @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 {ProcessModuleInfoCollection} - 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. + * + * {ProcessModuleInfoCollection} [result] - The deserialized result object if an error did not occur. + * See {@link ProcessModuleInfoCollection} 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. + */ + listInstanceProcessModulesNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listInstanceProcessModulesNext(nextPageLink: string, callback: ServiceCallback): void; + listInstanceProcessModulesNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary List the threads in a process by its ID for a specific scaled-out + * instance in a web site. + * + * List the threads in a process by its ID for a specific scaled-out instance + * in a web site. + * + * @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. + */ + listInstanceProcessThreadsNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary List the threads in a process by its ID for a specific scaled-out + * instance in a web site. + * + * List the threads in a process by its ID for a specific scaled-out instance + * in a web site. + * + * @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 {ProcessThreadInfoCollection} - 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. + * + * {ProcessThreadInfoCollection} [result] - The deserialized result object if an error did not occur. + * See {@link ProcessThreadInfoCollection} 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. + */ + listInstanceProcessThreadsNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listInstanceProcessThreadsNext(nextPageLink: string, callback: ServiceCallback): void; + listInstanceProcessThreadsNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Gets all metric definitions of an app (or deployment slot, if + * specified). + * + * Gets all metric definitions of an app (or deployment slot, if specified). + * + * @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. + */ + listMetricDefinitionsNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets all metric definitions of an app (or deployment slot, if + * specified). + * + * Gets all metric definitions of an app (or deployment slot, if specified). + * + * @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 {ResourceMetricDefinitionCollection} - 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. + * + * {ResourceMetricDefinitionCollection} [result] - The deserialized result object if an error did not occur. + * See {@link ResourceMetricDefinitionCollection} 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. + */ + listMetricDefinitionsNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listMetricDefinitionsNext(nextPageLink: string, callback: ServiceCallback): void; + listMetricDefinitionsNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Gets performance metrics of an app (or deployment slot, if + * specified). + * + * Gets performance metrics of an app (or deployment slot, if specified). + * + * @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. + */ + listMetricsNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets performance metrics of an app (or deployment slot, if + * specified). + * + * Gets performance metrics of an app (or deployment slot, if specified). + * + * @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 {ResourceMetricCollection} - 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. + * + * {ResourceMetricCollection} [result] - The deserialized result object if an error did not occur. + * See {@link ResourceMetricCollection} 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. + */ + listMetricsNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listMetricsNext(nextPageLink: string, callback: ServiceCallback): void; + listMetricsNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Gets perfmon counters for web app. + * + * Gets perfmon counters for web app. + * + * @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. + */ + listPerfMonCountersNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets perfmon counters for web app. + * + * Gets perfmon counters for web app. + * + * @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 {PerfMonCounterCollection} - 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. + * + * {PerfMonCounterCollection} [result] - The deserialized result object if an error did not occur. + * See {@link PerfMonCounterCollection} 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. + */ + listPerfMonCountersNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listPerfMonCountersNext(nextPageLink: string, callback: ServiceCallback): void; + listPerfMonCountersNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Get list of processes for a web site, or a deployment slot, or for + * a specific scaled-out instance in a web site. + * + * Get list of processes for a web site, or a deployment slot, or for a + * specific scaled-out instance in a web site. + * + * @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. + */ + listProcessesNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get list of processes for a web site, or a deployment slot, or for + * a specific scaled-out instance in a web site. + * + * Get list of processes for a web site, or a deployment slot, or for a + * specific scaled-out instance in a web site. + * + * @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 {ProcessInfoCollection} - 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. + * + * {ProcessInfoCollection} [result] - The deserialized result object if an error did not occur. + * See {@link ProcessInfoCollection} 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. + */ + listProcessesNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listProcessesNext(nextPageLink: string, callback: ServiceCallback): void; + listProcessesNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary List module information for a process by its ID for a specific + * scaled-out instance in a web site. + * + * List module information for a process by its ID for a specific scaled-out + * instance in a web site. + * + * @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. + */ + listProcessModulesNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary List module information for a process by its ID for a specific + * scaled-out instance in a web site. + * + * List module information for a process by its ID for a specific scaled-out + * instance in a web site. + * + * @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 {ProcessModuleInfoCollection} - 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. + * + * {ProcessModuleInfoCollection} [result] - The deserialized result object if an error did not occur. + * See {@link ProcessModuleInfoCollection} 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. + */ + listProcessModulesNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listProcessModulesNext(nextPageLink: string, callback: ServiceCallback): void; + listProcessModulesNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary List the threads in a process by its ID for a specific scaled-out + * instance in a web site. + * + * List the threads in a process by its ID for a specific scaled-out instance + * in a web site. + * + * @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. + */ + listProcessThreadsNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary List the threads in a process by its ID for a specific scaled-out + * instance in a web site. + * + * List the threads in a process by its ID for a specific scaled-out instance + * in a web site. + * + * @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 {ProcessThreadInfoCollection} - 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. + * + * {ProcessThreadInfoCollection} [result] - The deserialized result object if an error did not occur. + * See {@link ProcessThreadInfoCollection} 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. + */ + listProcessThreadsNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listProcessThreadsNext(nextPageLink: string, callback: ServiceCallback): void; + listProcessThreadsNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Get public certificates for an app or a deployment slot. + * + * Get public certificates for an app or a deployment slot. + * + * @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. + */ + listPublicCertificatesNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get public certificates for an app or a deployment slot. + * + * Get public certificates for an app or a deployment slot. + * + * @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 {PublicCertificateCollection} - 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. + * + * {PublicCertificateCollection} [result] - The deserialized result object if an error did not occur. + * See {@link PublicCertificateCollection} 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. + */ + listPublicCertificatesNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listPublicCertificatesNext(nextPageLink: string, callback: ServiceCallback): void; + listPublicCertificatesNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Get list of siteextensions for a web site, or a deployment slot. + * + * Get list of siteextensions for a web site, or a deployment slot. + * + * @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. + */ + listSiteExtensionsNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get list of siteextensions for a web site, or a deployment slot. + * + * Get list of siteextensions for a web site, or a deployment slot. + * + * @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 {SiteExtensionInfoCollection} - 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. + * + * {SiteExtensionInfoCollection} [result] - The deserialized result object if an error did not occur. + * See {@link SiteExtensionInfoCollection} 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. + */ + listSiteExtensionsNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listSiteExtensionsNext(nextPageLink: string, callback: ServiceCallback): void; + listSiteExtensionsNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Gets an app's deployment slots. + * + * Gets an app's deployment slots. + * + * @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. + */ + listSlotsNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets an app's deployment slots. + * + * Gets an app's deployment slots. + * + * @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 {WebAppCollection} - 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. + * + * {WebAppCollection} [result] - The deserialized result object if an error did not occur. + * See {@link WebAppCollection} 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. + */ + listSlotsNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listSlotsNext(nextPageLink: string, callback: ServiceCallback): void; + listSlotsNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Gets existing backups of an app. + * + * Gets existing backups of an app. + * + * @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. + */ + listBackupsSlotNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets existing backups of an app. + * + * Gets existing backups of an app. + * + * @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 {BackupItemCollection} - 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. + * + * {BackupItemCollection} [result] - The deserialized result object if an error did not occur. + * See {@link BackupItemCollection} 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. + */ + listBackupsSlotNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listBackupsSlotNext(nextPageLink: string, callback: ServiceCallback): void; + listBackupsSlotNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary List the configurations of an app + * + * List the configurations of an app + * + * @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. + */ + listConfigurationsSlotNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary List the configurations of an app + * + * List the configurations of an app + * + * @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 {SiteConfigResourceCollection} - 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. + * + * {SiteConfigResourceCollection} [result] - The deserialized result object if an error did not occur. + * See {@link SiteConfigResourceCollection} 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. + */ + listConfigurationsSlotNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listConfigurationsSlotNext(nextPageLink: string, callback: ServiceCallback): void; + listConfigurationsSlotNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Gets a list of web app configuration snapshots identifiers. Each + * element of the list contains a timestamp and the ID of the snapshot. + * + * Gets a list of web app configuration snapshots identifiers. Each element of + * the list contains a timestamp and the ID of the snapshot. + * + * @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. + */ + listConfigurationSnapshotInfoSlotNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets a list of web app configuration snapshots identifiers. Each + * element of the list contains a timestamp and the ID of the snapshot. + * + * Gets a list of web app configuration snapshots identifiers. Each element of + * the list contains a timestamp and the ID of the snapshot. + * + * @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 {SiteConfigurationSnapshotInfoCollection} - 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. + * + * {SiteConfigurationSnapshotInfoCollection} [result] - The deserialized result object if an error did not occur. + * See {@link SiteConfigurationSnapshotInfoCollection} 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. + */ + listConfigurationSnapshotInfoSlotNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listConfigurationSnapshotInfoSlotNext(nextPageLink: string, callback: ServiceCallback): void; + listConfigurationSnapshotInfoSlotNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary List continuous web jobs for an app, or a deployment slot. + * + * List continuous web jobs for an app, or a deployment slot. + * + * @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. + */ + listContinuousWebJobsSlotNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary List continuous web jobs for an app, or a deployment slot. + * + * List continuous web jobs for an app, or a deployment slot. + * + * @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 {ContinuousWebJobCollection} - 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. + * + * {ContinuousWebJobCollection} [result] - The deserialized result object if an error did not occur. + * See {@link ContinuousWebJobCollection} 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. + */ + listContinuousWebJobsSlotNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listContinuousWebJobsSlotNext(nextPageLink: string, callback: ServiceCallback): void; + listContinuousWebJobsSlotNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary List deployments for an app, or a deployment slot. + * + * List deployments for an app, or a deployment slot. + * + * @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. + */ + listDeploymentsSlotNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary List deployments for an app, or a deployment slot. + * + * List deployments for an app, or a deployment slot. + * + * @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 {DeploymentCollection} - 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. + * + * {DeploymentCollection} [result] - The deserialized result object if an error did not occur. + * See {@link DeploymentCollection} 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. + */ + listDeploymentsSlotNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listDeploymentsSlotNext(nextPageLink: string, callback: ServiceCallback): void; + listDeploymentsSlotNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Lists ownership identifiers for domain associated with web app. + * + * Lists ownership identifiers for domain associated with web app. + * + * @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. + */ + listDomainOwnershipIdentifiersSlotNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Lists ownership identifiers for domain associated with web app. + * + * Lists ownership identifiers for domain associated with web app. + * + * @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 {IdentifierCollection} - 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. + * + * {IdentifierCollection} [result] - The deserialized result object if an error did not occur. + * See {@link IdentifierCollection} 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. + */ + listDomainOwnershipIdentifiersSlotNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listDomainOwnershipIdentifiersSlotNext(nextPageLink: string, callback: ServiceCallback): void; + listDomainOwnershipIdentifiersSlotNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary List the functions for a web site, or a deployment slot. + * + * List the functions for a web site, or a deployment slot. + * + * @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. + */ + listInstanceFunctionsSlotNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary List the functions for a web site, or a deployment slot. + * + * List the functions for a web site, or a deployment slot. + * + * @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 {FunctionEnvelopeCollection} - 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. + * + * {FunctionEnvelopeCollection} [result] - The deserialized result object if an error did not occur. + * See {@link FunctionEnvelopeCollection} 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. + */ + listInstanceFunctionsSlotNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listInstanceFunctionsSlotNext(nextPageLink: string, callback: ServiceCallback): void; + listInstanceFunctionsSlotNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Get hostname bindings for an app or a deployment slot. + * + * Get hostname bindings for an app or a deployment slot. + * + * @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. + */ + listHostNameBindingsSlotNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get hostname bindings for an app or a deployment slot. + * + * Get hostname bindings for an app or a deployment slot. + * + * @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 {HostNameBindingCollection} - 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. + * + * {HostNameBindingCollection} [result] - The deserialized result object if an error did not occur. + * See {@link HostNameBindingCollection} 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. + */ + listHostNameBindingsSlotNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listHostNameBindingsSlotNext(nextPageLink: string, callback: ServiceCallback): void; + listHostNameBindingsSlotNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Gets all scale-out instances of an app. + * + * Gets all scale-out instances of an app. + * + * @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. + */ + listInstanceIdentifiersSlotNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets all scale-out instances of an app. + * + * Gets all scale-out instances of an app. + * + * @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 {WebAppInstanceCollection} - 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. + * + * {WebAppInstanceCollection} [result] - The deserialized result object if an error did not occur. + * See {@link WebAppInstanceCollection} 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. + */ + listInstanceIdentifiersSlotNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listInstanceIdentifiersSlotNext(nextPageLink: string, callback: ServiceCallback): void; + listInstanceIdentifiersSlotNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Get list of processes for a web site, or a deployment slot, or for + * a specific scaled-out instance in a web site. + * + * Get list of processes for a web site, or a deployment slot, or for a + * specific scaled-out instance in a web site. + * + * @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. + */ + listInstanceProcessesSlotNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get list of processes for a web site, or a deployment slot, or for + * a specific scaled-out instance in a web site. + * + * Get list of processes for a web site, or a deployment slot, or for a + * specific scaled-out instance in a web site. + * + * @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 {ProcessInfoCollection} - 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. + * + * {ProcessInfoCollection} [result] - The deserialized result object if an error did not occur. + * See {@link ProcessInfoCollection} 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. + */ + listInstanceProcessesSlotNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listInstanceProcessesSlotNext(nextPageLink: string, callback: ServiceCallback): void; + listInstanceProcessesSlotNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary List module information for a process by its ID for a specific + * scaled-out instance in a web site. + * + * List module information for a process by its ID for a specific scaled-out + * instance in a web site. + * + * @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. + */ + listInstanceProcessModulesSlotNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary List module information for a process by its ID for a specific + * scaled-out instance in a web site. + * + * List module information for a process by its ID for a specific scaled-out + * instance in a web site. + * + * @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 {ProcessModuleInfoCollection} - 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. + * + * {ProcessModuleInfoCollection} [result] - The deserialized result object if an error did not occur. + * See {@link ProcessModuleInfoCollection} 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. + */ + listInstanceProcessModulesSlotNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listInstanceProcessModulesSlotNext(nextPageLink: string, callback: ServiceCallback): void; + listInstanceProcessModulesSlotNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary List the threads in a process by its ID for a specific scaled-out + * instance in a web site. + * + * List the threads in a process by its ID for a specific scaled-out instance + * in a web site. + * + * @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. + */ + listInstanceProcessThreadsSlotNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary List the threads in a process by its ID for a specific scaled-out + * instance in a web site. + * + * List the threads in a process by its ID for a specific scaled-out instance + * in a web site. + * + * @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 {ProcessThreadInfoCollection} - 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. + * + * {ProcessThreadInfoCollection} [result] - The deserialized result object if an error did not occur. + * See {@link ProcessThreadInfoCollection} 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. + */ + listInstanceProcessThreadsSlotNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listInstanceProcessThreadsSlotNext(nextPageLink: string, callback: ServiceCallback): void; + listInstanceProcessThreadsSlotNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Gets all metric definitions of an app (or deployment slot, if + * specified). + * + * Gets all metric definitions of an app (or deployment slot, if specified). + * + * @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. + */ + listMetricDefinitionsSlotNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets all metric definitions of an app (or deployment slot, if + * specified). + * + * Gets all metric definitions of an app (or deployment slot, if specified). + * + * @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 {ResourceMetricDefinitionCollection} - 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. + * + * {ResourceMetricDefinitionCollection} [result] - The deserialized result object if an error did not occur. + * See {@link ResourceMetricDefinitionCollection} 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. + */ + listMetricDefinitionsSlotNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listMetricDefinitionsSlotNext(nextPageLink: string, callback: ServiceCallback): void; + listMetricDefinitionsSlotNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Gets performance metrics of an app (or deployment slot, if + * specified). + * + * Gets performance metrics of an app (or deployment slot, if specified). + * + * @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. + */ + listMetricsSlotNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets performance metrics of an app (or deployment slot, if + * specified). + * + * Gets performance metrics of an app (or deployment slot, if specified). + * + * @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 {ResourceMetricCollection} - 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. + * + * {ResourceMetricCollection} [result] - The deserialized result object if an error did not occur. + * See {@link ResourceMetricCollection} 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. + */ + listMetricsSlotNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listMetricsSlotNext(nextPageLink: string, callback: ServiceCallback): void; + listMetricsSlotNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Gets perfmon counters for web app. + * + * Gets perfmon counters for web app. + * + * @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. + */ + listPerfMonCountersSlotNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets perfmon counters for web app. + * + * Gets perfmon counters for web app. + * + * @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 {PerfMonCounterCollection} - 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. + * + * {PerfMonCounterCollection} [result] - The deserialized result object if an error did not occur. + * See {@link PerfMonCounterCollection} 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. + */ + listPerfMonCountersSlotNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listPerfMonCountersSlotNext(nextPageLink: string, callback: ServiceCallback): void; + listPerfMonCountersSlotNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Get list of processes for a web site, or a deployment slot, or for + * a specific scaled-out instance in a web site. + * + * Get list of processes for a web site, or a deployment slot, or for a + * specific scaled-out instance in a web site. + * + * @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. + */ + listProcessesSlotNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get list of processes for a web site, or a deployment slot, or for + * a specific scaled-out instance in a web site. + * + * Get list of processes for a web site, or a deployment slot, or for a + * specific scaled-out instance in a web site. + * + * @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 {ProcessInfoCollection} - 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. + * + * {ProcessInfoCollection} [result] - The deserialized result object if an error did not occur. + * See {@link ProcessInfoCollection} 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. + */ + listProcessesSlotNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listProcessesSlotNext(nextPageLink: string, callback: ServiceCallback): void; + listProcessesSlotNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary List module information for a process by its ID for a specific + * scaled-out instance in a web site. + * + * List module information for a process by its ID for a specific scaled-out + * instance in a web site. + * + * @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. + */ + listProcessModulesSlotNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary List module information for a process by its ID for a specific + * scaled-out instance in a web site. + * + * List module information for a process by its ID for a specific scaled-out + * instance in a web site. + * + * @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 {ProcessModuleInfoCollection} - 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. + * + * {ProcessModuleInfoCollection} [result] - The deserialized result object if an error did not occur. + * See {@link ProcessModuleInfoCollection} 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. + */ + listProcessModulesSlotNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listProcessModulesSlotNext(nextPageLink: string, callback: ServiceCallback): void; + listProcessModulesSlotNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary List the threads in a process by its ID for a specific scaled-out + * instance in a web site. + * + * List the threads in a process by its ID for a specific scaled-out instance + * in a web site. + * + * @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. + */ + listProcessThreadsSlotNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary List the threads in a process by its ID for a specific scaled-out + * instance in a web site. + * + * List the threads in a process by its ID for a specific scaled-out instance + * in a web site. + * + * @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 {ProcessThreadInfoCollection} - 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. + * + * {ProcessThreadInfoCollection} [result] - The deserialized result object if an error did not occur. + * See {@link ProcessThreadInfoCollection} 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. + */ + listProcessThreadsSlotNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listProcessThreadsSlotNext(nextPageLink: string, callback: ServiceCallback): void; + listProcessThreadsSlotNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Get public certificates for an app or a deployment slot. + * + * Get public certificates for an app or a deployment slot. + * + * @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. + */ + listPublicCertificatesSlotNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get public certificates for an app or a deployment slot. + * + * Get public certificates for an app or a deployment slot. + * + * @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 {PublicCertificateCollection} - 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. + * + * {PublicCertificateCollection} [result] - The deserialized result object if an error did not occur. + * See {@link PublicCertificateCollection} 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. + */ + listPublicCertificatesSlotNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listPublicCertificatesSlotNext(nextPageLink: string, callback: ServiceCallback): void; + listPublicCertificatesSlotNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Get list of siteextensions for a web site, or a deployment slot. + * + * Get list of siteextensions for a web site, or a deployment slot. + * + * @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. + */ + listSiteExtensionsSlotNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get list of siteextensions for a web site, or a deployment slot. + * + * Get list of siteextensions for a web site, or a deployment slot. + * + * @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 {SiteExtensionInfoCollection} - 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. + * + * {SiteExtensionInfoCollection} [result] - The deserialized result object if an error did not occur. + * See {@link SiteExtensionInfoCollection} 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. + */ + listSiteExtensionsSlotNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listSiteExtensionsSlotNext(nextPageLink: string, callback: ServiceCallback): void; + listSiteExtensionsSlotNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Get the difference in configuration settings between two web app + * slots. + * + * Get the difference in configuration settings between two web app slots. + * + * @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. + */ + listSlotDifferencesSlotNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get the difference in configuration settings between two web app + * slots. + * + * Get the difference in configuration settings between two web app slots. + * + * @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 {SlotDifferenceCollection} - 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. + * + * {SlotDifferenceCollection} [result] - The deserialized result object if an error did not occur. + * See {@link SlotDifferenceCollection} 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. + */ + listSlotDifferencesSlotNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listSlotDifferencesSlotNext(nextPageLink: string, callback: ServiceCallback): void; + listSlotDifferencesSlotNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Returns all Snapshots to the user. + * + * Returns all Snapshots to the user. + * + * @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. + */ + listSnapshotsSlotNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Returns all Snapshots to the user. + * + * Returns all Snapshots to the user. + * + * @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 {SnapshotCollection} - 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. + * + * {SnapshotCollection} [result] - The deserialized result object if an error did not occur. + * See {@link SnapshotCollection} 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. + */ + listSnapshotsSlotNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listSnapshotsSlotNext(nextPageLink: string, callback: ServiceCallback): void; + listSnapshotsSlotNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary List triggered web jobs for an app, or a deployment slot. + * + * List triggered web jobs for an app, or a deployment slot. + * + * @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. + */ + listTriggeredWebJobsSlotNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary List triggered web jobs for an app, or a deployment slot. + * + * List triggered web jobs for an app, or a deployment slot. + * + * @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 {TriggeredWebJobCollection} - 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. + * + * {TriggeredWebJobCollection} [result] - The deserialized result object if an error did not occur. + * See {@link TriggeredWebJobCollection} 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. + */ + listTriggeredWebJobsSlotNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listTriggeredWebJobsSlotNext(nextPageLink: string, callback: ServiceCallback): void; + listTriggeredWebJobsSlotNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary List a triggered web job's history for an app, or a deployment + * slot. + * + * List a triggered web job's history for an app, or a deployment slot. + * + * @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. + */ + listTriggeredWebJobHistorySlotNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary List a triggered web job's history for an app, or a deployment + * slot. + * + * List a triggered web job's history for an app, or a deployment slot. + * + * @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 {TriggeredJobHistoryCollection} - 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. + * + * {TriggeredJobHistoryCollection} [result] - The deserialized result object if an error did not occur. + * See {@link TriggeredJobHistoryCollection} 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. + */ + listTriggeredWebJobHistorySlotNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listTriggeredWebJobHistorySlotNext(nextPageLink: string, callback: ServiceCallback): void; + listTriggeredWebJobHistorySlotNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Gets the quota usage information of an app (or deployment slot, if + * specified). + * + * Gets the quota usage information of an app (or deployment slot, if + * specified). + * + * @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. + */ + listUsagesSlotNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets the quota usage information of an app (or deployment slot, if + * specified). + * + * Gets the quota usage information of an app (or deployment slot, if + * specified). + * + * @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 {CsmUsageQuotaCollection} - 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. + * + * {CsmUsageQuotaCollection} [result] - The deserialized result object if an error did not occur. + * See {@link CsmUsageQuotaCollection} 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. + */ + listUsagesSlotNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listUsagesSlotNext(nextPageLink: string, callback: ServiceCallback): void; + listUsagesSlotNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary List webjobs for an app, or a deployment slot. + * + * List webjobs for an app, or a deployment slot. + * + * @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. + */ + listWebJobsSlotNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary List webjobs for an app, or a deployment slot. + * + * List webjobs for an app, or a deployment slot. + * + * @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 {WebJobCollection} - 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. + * + * {WebJobCollection} [result] - The deserialized result object if an error did not occur. + * See {@link WebJobCollection} 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. + */ + listWebJobsSlotNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listWebJobsSlotNext(nextPageLink: string, callback: ServiceCallback): void; + listWebJobsSlotNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Get the difference in configuration settings between two web app + * slots. + * + * Get the difference in configuration settings between two web app slots. + * + * @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. + */ + listSlotDifferencesFromProductionNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get the difference in configuration settings between two web app + * slots. + * + * Get the difference in configuration settings between two web app slots. + * + * @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 {SlotDifferenceCollection} - 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. + * + * {SlotDifferenceCollection} [result] - The deserialized result object if an error did not occur. + * See {@link SlotDifferenceCollection} 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. + */ + listSlotDifferencesFromProductionNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listSlotDifferencesFromProductionNext(nextPageLink: string, callback: ServiceCallback): void; + listSlotDifferencesFromProductionNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Returns all Snapshots to the user. + * + * Returns all Snapshots to the user. + * + * @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. + */ + listSnapshotsNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Returns all Snapshots to the user. + * + * Returns all Snapshots to the user. + * + * @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 {SnapshotCollection} - 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. + * + * {SnapshotCollection} [result] - The deserialized result object if an error did not occur. + * See {@link SnapshotCollection} 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. + */ + listSnapshotsNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listSnapshotsNext(nextPageLink: string, callback: ServiceCallback): void; + listSnapshotsNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary List triggered web jobs for an app, or a deployment slot. + * + * List triggered web jobs for an app, or a deployment slot. + * + * @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. + */ + listTriggeredWebJobsNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary List triggered web jobs for an app, or a deployment slot. + * + * List triggered web jobs for an app, or a deployment slot. + * + * @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 {TriggeredWebJobCollection} - 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. + * + * {TriggeredWebJobCollection} [result] - The deserialized result object if an error did not occur. + * See {@link TriggeredWebJobCollection} 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. + */ + listTriggeredWebJobsNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listTriggeredWebJobsNext(nextPageLink: string, callback: ServiceCallback): void; + listTriggeredWebJobsNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary List a triggered web job's history for an app, or a deployment + * slot. + * + * List a triggered web job's history for an app, or a deployment slot. + * + * @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. + */ + listTriggeredWebJobHistoryNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary List a triggered web job's history for an app, or a deployment + * slot. + * + * List a triggered web job's history for an app, or a deployment slot. + * + * @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 {TriggeredJobHistoryCollection} - 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. + * + * {TriggeredJobHistoryCollection} [result] - The deserialized result object if an error did not occur. + * See {@link TriggeredJobHistoryCollection} 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. + */ + listTriggeredWebJobHistoryNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listTriggeredWebJobHistoryNext(nextPageLink: string, callback: ServiceCallback): void; + listTriggeredWebJobHistoryNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Gets the quota usage information of an app (or deployment slot, if + * specified). + * + * Gets the quota usage information of an app (or deployment slot, if + * specified). + * + * @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. + */ + listUsagesNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets the quota usage information of an app (or deployment slot, if + * specified). + * + * Gets the quota usage information of an app (or deployment slot, if + * specified). + * + * @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 {CsmUsageQuotaCollection} - 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. + * + * {CsmUsageQuotaCollection} [result] - The deserialized result object if an error did not occur. + * See {@link CsmUsageQuotaCollection} 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. + */ + listUsagesNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listUsagesNext(nextPageLink: string, callback: ServiceCallback): void; + listUsagesNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary List webjobs for an app, or a deployment slot. + * + * List webjobs for an app, or a deployment slot. + * + * @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. + */ + listWebJobsNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary List webjobs for an app, or a deployment slot. + * + * List webjobs for an app, or a deployment slot. + * + * @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 {WebJobCollection} - 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. + * + * {WebJobCollection} [result] - The deserialized result object if an error did not occur. + * See {@link WebJobCollection} 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. + */ + listWebJobsNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listWebJobsNext(nextPageLink: string, callback: ServiceCallback): void; + listWebJobsNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + +/** + * @class + * AppServiceEnvironments + * __NOTE__: An instance of this class is automatically created for an + * instance of the WebSiteManagementClient. + */ +export interface AppServiceEnvironments { + + + /** + * @summary Get all App Service Environments for a subscription. + * + * Get all App Service Environments for a subscription. + * + * @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. + */ + listWithHttpOperationResponse(options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get all App Service Environments for a subscription. + * + * Get all App Service Environments for a subscription. + * + * @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 {AppServiceEnvironmentCollection} - 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. + * + * {AppServiceEnvironmentCollection} [result] - The deserialized result object if an error did not occur. + * See {@link AppServiceEnvironmentCollection} 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?: { customHeaders? : { [headerName: string]: string; } }): Promise; + list(callback: ServiceCallback): void; + list(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Get all App Service Environments in a resource group. + * + * Get all App Service Environments in a resource group. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @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. + */ + listByResourceGroupWithHttpOperationResponse(resourceGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get all App Service Environments in a resource group. + * + * Get all App Service Environments in a resource group. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @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 {AppServiceEnvironmentCollection} - 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. + * + * {AppServiceEnvironmentCollection} [result] - The deserialized result object if an error did not occur. + * See {@link AppServiceEnvironmentCollection} 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. + */ + listByResourceGroup(resourceGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByResourceGroup(resourceGroupName: string, callback: ServiceCallback): void; + listByResourceGroup(resourceGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Get the properties of an App Service Environment. + * + * Get the properties of an App Service Environment. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service Environment. + * + * @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. + */ + getWithHttpOperationResponse(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get the properties of an App Service Environment. + * + * Get the properties of an App Service Environment. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service Environment. + * + * @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 {AppServiceEnvironmentResource} - 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. + * + * {AppServiceEnvironmentResource} [result] - The deserialized result object if an error did not occur. + * See {@link AppServiceEnvironmentResource} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + get(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(resourceGroupName: string, name: string, callback: ServiceCallback): void; + get(resourceGroupName: string, name: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Create or update an App Service Environment. + * + * Create or update an App Service Environment. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service Environment. + * + * @param {object} hostingEnvironmentEnvelope Configuration details of the App + * Service Environment. + * + * @param {string} hostingEnvironmentEnvelope.appServiceEnvironmentResourceName + * Name of the App Service Environment. + * + * @param {string} + * hostingEnvironmentEnvelope.appServiceEnvironmentResourceLocation Location of + * the App Service Environment, e.g. "West US". + * + * @param {string} [hostingEnvironmentEnvelope.vnetName] Name of the Virtual + * Network for the App Service Environment. + * + * @param {string} [hostingEnvironmentEnvelope.vnetResourceGroupName] Resource + * group of the Virtual Network. + * + * @param {string} [hostingEnvironmentEnvelope.vnetSubnetName] Subnet of the + * Virtual Network. + * + * @param {object} hostingEnvironmentEnvelope.virtualNetwork Description of the + * Virtual Network. + * + * @param {string} [hostingEnvironmentEnvelope.virtualNetwork.id] Resource id + * of the Virtual Network. + * + * @param {string} [hostingEnvironmentEnvelope.virtualNetwork.subnet] Subnet + * within the Virtual Network. + * + * @param {string} [hostingEnvironmentEnvelope.internalLoadBalancingMode] + * Specifies which endpoints to serve internally in the Virtual Network for the + * App Service Environment. Possible values include: 'None', 'Web', + * 'Publishing' + * + * @param {string} [hostingEnvironmentEnvelope.multiSize] Front-end VM size, + * e.g. "Medium", "Large". + * + * @param {number} [hostingEnvironmentEnvelope.multiRoleCount] Number of + * front-end instances. + * + * @param {array} hostingEnvironmentEnvelope.workerPools Description of worker + * pools with worker size IDs, VM sizes, and number of workers in each pool. + * + * @param {number} [hostingEnvironmentEnvelope.ipsslAddressCount] Number of IP + * SSL addresses reserved for the App Service Environment. + * + * @param {string} [hostingEnvironmentEnvelope.dnsSuffix] DNS suffix of the App + * Service Environment. + * + * @param {array} [hostingEnvironmentEnvelope.networkAccessControlList] Access + * control list for controlling traffic to the App Service Environment. + * + * @param {number} [hostingEnvironmentEnvelope.frontEndScaleFactor] Scale + * factor for front-ends. + * + * @param {string} [hostingEnvironmentEnvelope.apiManagementAccountId] API + * Management Account associated with the App Service Environment. + * + * @param {boolean} [hostingEnvironmentEnvelope.suspended] true if + * the App Service Environment is suspended; otherwise, false. The + * environment can be suspended, e.g. when the management endpoint is no longer + * available + * (most likely because NSG blocked the incoming traffic). + * + * @param {boolean} [hostingEnvironmentEnvelope.dynamicCacheEnabled] True/false + * indicating whether the App Service Environment is suspended. The environment + * can be suspended e.g. when the management endpoint is no longer available + * (most likely because NSG blocked the incoming traffic). + * + * @param {array} [hostingEnvironmentEnvelope.clusterSettings] Custom settings + * for changing the behavior of the App Service Environment. + * + * @param {array} [hostingEnvironmentEnvelope.userWhitelistedIpRanges] User + * added ip ranges to whitelist on ASE db + * + * @param {boolean} [hostingEnvironmentEnvelope.hasLinuxWorkers] Flag that + * displays whether an ASE has linux workers or not + * + * @param {string} [hostingEnvironmentEnvelope.sslCertKeyVaultId] Key Vault ID + * for ILB App Service Environment default SSL certificate + * + * @param {string} [hostingEnvironmentEnvelope.sslCertKeyVaultSecretName] Key + * Vault Secret Name for ILB App Service Environment default SSL certificate + * + * @param {string} [hostingEnvironmentEnvelope.kind] Kind of resource. + * + * @param {string} hostingEnvironmentEnvelope.location Resource Location. + * + * @param {object} [hostingEnvironmentEnvelope.tags] Resource tags. + * + * @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. + */ + createOrUpdateWithHttpOperationResponse(resourceGroupName: string, name: string, hostingEnvironmentEnvelope: models.AppServiceEnvironmentResource, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Create or update an App Service Environment. + * + * Create or update an App Service Environment. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service Environment. + * + * @param {object} hostingEnvironmentEnvelope Configuration details of the App + * Service Environment. + * + * @param {string} hostingEnvironmentEnvelope.appServiceEnvironmentResourceName + * Name of the App Service Environment. + * + * @param {string} + * hostingEnvironmentEnvelope.appServiceEnvironmentResourceLocation Location of + * the App Service Environment, e.g. "West US". + * + * @param {string} [hostingEnvironmentEnvelope.vnetName] Name of the Virtual + * Network for the App Service Environment. + * + * @param {string} [hostingEnvironmentEnvelope.vnetResourceGroupName] Resource + * group of the Virtual Network. + * + * @param {string} [hostingEnvironmentEnvelope.vnetSubnetName] Subnet of the + * Virtual Network. + * + * @param {object} hostingEnvironmentEnvelope.virtualNetwork Description of the + * Virtual Network. + * + * @param {string} [hostingEnvironmentEnvelope.virtualNetwork.id] Resource id + * of the Virtual Network. + * + * @param {string} [hostingEnvironmentEnvelope.virtualNetwork.subnet] Subnet + * within the Virtual Network. + * + * @param {string} [hostingEnvironmentEnvelope.internalLoadBalancingMode] + * Specifies which endpoints to serve internally in the Virtual Network for the + * App Service Environment. Possible values include: 'None', 'Web', + * 'Publishing' + * + * @param {string} [hostingEnvironmentEnvelope.multiSize] Front-end VM size, + * e.g. "Medium", "Large". + * + * @param {number} [hostingEnvironmentEnvelope.multiRoleCount] Number of + * front-end instances. + * + * @param {array} hostingEnvironmentEnvelope.workerPools Description of worker + * pools with worker size IDs, VM sizes, and number of workers in each pool. + * + * @param {number} [hostingEnvironmentEnvelope.ipsslAddressCount] Number of IP + * SSL addresses reserved for the App Service Environment. + * + * @param {string} [hostingEnvironmentEnvelope.dnsSuffix] DNS suffix of the App + * Service Environment. + * + * @param {array} [hostingEnvironmentEnvelope.networkAccessControlList] Access + * control list for controlling traffic to the App Service Environment. + * + * @param {number} [hostingEnvironmentEnvelope.frontEndScaleFactor] Scale + * factor for front-ends. + * + * @param {string} [hostingEnvironmentEnvelope.apiManagementAccountId] API + * Management Account associated with the App Service Environment. + * + * @param {boolean} [hostingEnvironmentEnvelope.suspended] true if + * the App Service Environment is suspended; otherwise, false. The + * environment can be suspended, e.g. when the management endpoint is no longer + * available + * (most likely because NSG blocked the incoming traffic). + * + * @param {boolean} [hostingEnvironmentEnvelope.dynamicCacheEnabled] True/false + * indicating whether the App Service Environment is suspended. The environment + * can be suspended e.g. when the management endpoint is no longer available + * (most likely because NSG blocked the incoming traffic). + * + * @param {array} [hostingEnvironmentEnvelope.clusterSettings] Custom settings + * for changing the behavior of the App Service Environment. + * + * @param {array} [hostingEnvironmentEnvelope.userWhitelistedIpRanges] User + * added ip ranges to whitelist on ASE db + * + * @param {boolean} [hostingEnvironmentEnvelope.hasLinuxWorkers] Flag that + * displays whether an ASE has linux workers or not + * + * @param {string} [hostingEnvironmentEnvelope.sslCertKeyVaultId] Key Vault ID + * for ILB App Service Environment default SSL certificate + * + * @param {string} [hostingEnvironmentEnvelope.sslCertKeyVaultSecretName] Key + * Vault Secret Name for ILB App Service Environment default SSL certificate + * + * @param {string} [hostingEnvironmentEnvelope.kind] Kind of resource. + * + * @param {string} hostingEnvironmentEnvelope.location Resource Location. + * + * @param {object} [hostingEnvironmentEnvelope.tags] Resource tags. + * + * @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 {AppServiceEnvironmentResource} - 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. + * + * {AppServiceEnvironmentResource} [result] - The deserialized result object if an error did not occur. + * See {@link AppServiceEnvironmentResource} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + createOrUpdate(resourceGroupName: string, name: string, hostingEnvironmentEnvelope: models.AppServiceEnvironmentResource, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdate(resourceGroupName: string, name: string, hostingEnvironmentEnvelope: models.AppServiceEnvironmentResource, callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, name: string, hostingEnvironmentEnvelope: models.AppServiceEnvironmentResource, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Delete an App Service Environment. + * + * Delete an App Service Environment. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service Environment. + * + * @param {object} [options] Optional Parameters. + * + * @param {boolean} [options.forceDelete] Specify true to force + * the deletion even if the App Service Environment contains resources. The + * default is false. + * + * @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. + */ + deleteMethodWithHttpOperationResponse(resourceGroupName: string, name: string, options?: { forceDelete? : boolean, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Delete an App Service Environment. + * + * Delete an App Service Environment. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service Environment. + * + * @param {object} [options] Optional Parameters. + * + * @param {boolean} [options.forceDelete] Specify true to force + * the deletion even if the App Service Environment contains resources. The + * default is false. + * + * @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 {null} - 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. + * + * {null} [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. + */ + deleteMethod(resourceGroupName: string, name: string, options?: { forceDelete? : boolean, customHeaders? : { [headerName: string]: string; } }): Promise; + deleteMethod(resourceGroupName: string, name: string, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, name: string, options: { forceDelete? : boolean, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Create or update an App Service Environment. + * + * Create or update an App Service Environment. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service Environment. + * + * @param {object} hostingEnvironmentEnvelope Configuration details of the App + * Service Environment. + * + * @param {string} + * hostingEnvironmentEnvelope.appServiceEnvironmentPatchResourceName Name of + * the App Service Environment. + * + * @param {string} hostingEnvironmentEnvelope.location Location of the App + * Service Environment, e.g. "West US". + * + * @param {string} [hostingEnvironmentEnvelope.vnetName] Name of the Virtual + * Network for the App Service Environment. + * + * @param {string} [hostingEnvironmentEnvelope.vnetResourceGroupName] Resource + * group of the Virtual Network. + * + * @param {string} [hostingEnvironmentEnvelope.vnetSubnetName] Subnet of the + * Virtual Network. + * + * @param {object} hostingEnvironmentEnvelope.virtualNetwork Description of the + * Virtual Network. + * + * @param {string} [hostingEnvironmentEnvelope.virtualNetwork.id] Resource id + * of the Virtual Network. + * + * @param {string} [hostingEnvironmentEnvelope.virtualNetwork.subnet] Subnet + * within the Virtual Network. + * + * @param {string} [hostingEnvironmentEnvelope.internalLoadBalancingMode] + * Specifies which endpoints to serve internally in the Virtual Network for the + * App Service Environment. Possible values include: 'None', 'Web', + * 'Publishing' + * + * @param {string} [hostingEnvironmentEnvelope.multiSize] Front-end VM size, + * e.g. "Medium", "Large". + * + * @param {number} [hostingEnvironmentEnvelope.multiRoleCount] Number of + * front-end instances. + * + * @param {array} hostingEnvironmentEnvelope.workerPools Description of worker + * pools with worker size IDs, VM sizes, and number of workers in each pool. + * + * @param {number} [hostingEnvironmentEnvelope.ipsslAddressCount] Number of IP + * SSL addresses reserved for the App Service Environment. + * + * @param {string} [hostingEnvironmentEnvelope.dnsSuffix] DNS suffix of the App + * Service Environment. + * + * @param {array} [hostingEnvironmentEnvelope.networkAccessControlList] Access + * control list for controlling traffic to the App Service Environment. + * + * @param {number} [hostingEnvironmentEnvelope.frontEndScaleFactor] Scale + * factor for front-ends. + * + * @param {string} [hostingEnvironmentEnvelope.apiManagementAccountId] API + * Management Account associated with the App Service Environment. + * + * @param {boolean} [hostingEnvironmentEnvelope.suspended] true if + * the App Service Environment is suspended; otherwise, false. The + * environment can be suspended, e.g. when the management endpoint is no longer + * available + * (most likely because NSG blocked the incoming traffic). + * + * @param {boolean} [hostingEnvironmentEnvelope.dynamicCacheEnabled] True/false + * indicating whether the App Service Environment is suspended. The environment + * can be suspended e.g. when the management endpoint is no longer available + * (most likely because NSG blocked the incoming traffic). + * + * @param {array} [hostingEnvironmentEnvelope.clusterSettings] Custom settings + * for changing the behavior of the App Service Environment. + * + * @param {array} [hostingEnvironmentEnvelope.userWhitelistedIpRanges] User + * added ip ranges to whitelist on ASE db + * + * @param {boolean} [hostingEnvironmentEnvelope.hasLinuxWorkers] Flag that + * displays whether an ASE has linux workers or not + * + * @param {string} [hostingEnvironmentEnvelope.sslCertKeyVaultId] Key Vault ID + * for ILB App Service Environment default SSL certificate + * + * @param {string} [hostingEnvironmentEnvelope.sslCertKeyVaultSecretName] Key + * Vault Secret Name for ILB App Service Environment default SSL certificate + * + * @param {string} [hostingEnvironmentEnvelope.kind] Kind of resource. + * + * @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. + */ + updateWithHttpOperationResponse(resourceGroupName: string, name: string, hostingEnvironmentEnvelope: models.AppServiceEnvironmentPatchResource, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Create or update an App Service Environment. + * + * Create or update an App Service Environment. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service Environment. + * + * @param {object} hostingEnvironmentEnvelope Configuration details of the App + * Service Environment. + * + * @param {string} + * hostingEnvironmentEnvelope.appServiceEnvironmentPatchResourceName Name of + * the App Service Environment. + * + * @param {string} hostingEnvironmentEnvelope.location Location of the App + * Service Environment, e.g. "West US". + * + * @param {string} [hostingEnvironmentEnvelope.vnetName] Name of the Virtual + * Network for the App Service Environment. + * + * @param {string} [hostingEnvironmentEnvelope.vnetResourceGroupName] Resource + * group of the Virtual Network. + * + * @param {string} [hostingEnvironmentEnvelope.vnetSubnetName] Subnet of the + * Virtual Network. + * + * @param {object} hostingEnvironmentEnvelope.virtualNetwork Description of the + * Virtual Network. + * + * @param {string} [hostingEnvironmentEnvelope.virtualNetwork.id] Resource id + * of the Virtual Network. + * + * @param {string} [hostingEnvironmentEnvelope.virtualNetwork.subnet] Subnet + * within the Virtual Network. + * + * @param {string} [hostingEnvironmentEnvelope.internalLoadBalancingMode] + * Specifies which endpoints to serve internally in the Virtual Network for the + * App Service Environment. Possible values include: 'None', 'Web', + * 'Publishing' + * + * @param {string} [hostingEnvironmentEnvelope.multiSize] Front-end VM size, + * e.g. "Medium", "Large". + * + * @param {number} [hostingEnvironmentEnvelope.multiRoleCount] Number of + * front-end instances. + * + * @param {array} hostingEnvironmentEnvelope.workerPools Description of worker + * pools with worker size IDs, VM sizes, and number of workers in each pool. + * + * @param {number} [hostingEnvironmentEnvelope.ipsslAddressCount] Number of IP + * SSL addresses reserved for the App Service Environment. + * + * @param {string} [hostingEnvironmentEnvelope.dnsSuffix] DNS suffix of the App + * Service Environment. + * + * @param {array} [hostingEnvironmentEnvelope.networkAccessControlList] Access + * control list for controlling traffic to the App Service Environment. + * + * @param {number} [hostingEnvironmentEnvelope.frontEndScaleFactor] Scale + * factor for front-ends. + * + * @param {string} [hostingEnvironmentEnvelope.apiManagementAccountId] API + * Management Account associated with the App Service Environment. + * + * @param {boolean} [hostingEnvironmentEnvelope.suspended] true if + * the App Service Environment is suspended; otherwise, false. The + * environment can be suspended, e.g. when the management endpoint is no longer + * available + * (most likely because NSG blocked the incoming traffic). + * + * @param {boolean} [hostingEnvironmentEnvelope.dynamicCacheEnabled] True/false + * indicating whether the App Service Environment is suspended. The environment + * can be suspended e.g. when the management endpoint is no longer available + * (most likely because NSG blocked the incoming traffic). + * + * @param {array} [hostingEnvironmentEnvelope.clusterSettings] Custom settings + * for changing the behavior of the App Service Environment. + * + * @param {array} [hostingEnvironmentEnvelope.userWhitelistedIpRanges] User + * added ip ranges to whitelist on ASE db + * + * @param {boolean} [hostingEnvironmentEnvelope.hasLinuxWorkers] Flag that + * displays whether an ASE has linux workers or not + * + * @param {string} [hostingEnvironmentEnvelope.sslCertKeyVaultId] Key Vault ID + * for ILB App Service Environment default SSL certificate + * + * @param {string} [hostingEnvironmentEnvelope.sslCertKeyVaultSecretName] Key + * Vault Secret Name for ILB App Service Environment default SSL certificate + * + * @param {string} [hostingEnvironmentEnvelope.kind] Kind of resource. + * + * @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 {AppServiceEnvironmentResource} - 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. + * + * {AppServiceEnvironmentResource} [result] - The deserialized result object if an error did not occur. + * See {@link AppServiceEnvironmentResource} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + update(resourceGroupName: string, name: string, hostingEnvironmentEnvelope: models.AppServiceEnvironmentPatchResource, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + update(resourceGroupName: string, name: string, hostingEnvironmentEnvelope: models.AppServiceEnvironmentPatchResource, callback: ServiceCallback): void; + update(resourceGroupName: string, name: string, hostingEnvironmentEnvelope: models.AppServiceEnvironmentPatchResource, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Get the used, available, and total worker capacity an App Service + * Environment. + * + * Get the used, available, and total worker capacity an App Service + * Environment. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service Environment. + * + * @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. + */ + listCapacitiesWithHttpOperationResponse(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get the used, available, and total worker capacity an App Service + * Environment. + * + * Get the used, available, and total worker capacity an App Service + * Environment. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service Environment. + * + * @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 {StampCapacityCollection} - 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. + * + * {StampCapacityCollection} [result] - The deserialized result object if an error did not occur. + * See {@link StampCapacityCollection} 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. + */ + listCapacities(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listCapacities(resourceGroupName: string, name: string, callback: ServiceCallback): void; + listCapacities(resourceGroupName: string, name: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Get IP addresses assigned to an App Service Environment. + * + * Get IP addresses assigned to an App Service Environment. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service Environment. + * + * @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. + */ + listVipsWithHttpOperationResponse(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get IP addresses assigned to an App Service Environment. + * + * Get IP addresses assigned to an App Service Environment. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service Environment. + * + * @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 {AddressResponse} - 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. + * + * {AddressResponse} [result] - The deserialized result object if an error did not occur. + * See {@link AddressResponse} 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. + */ + listVips(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listVips(resourceGroupName: string, name: string, callback: ServiceCallback): void; + listVips(resourceGroupName: string, name: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Move an App Service Environment to a different VNET. + * + * Move an App Service Environment to a different VNET. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service Environment. + * + * @param {object} vnetInfo Details for the new virtual network. + * + * @param {string} [vnetInfo.id] Resource id of the Virtual Network. + * + * @param {string} [vnetInfo.subnet] Subnet within the Virtual Network. + * + * @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. + */ + changeVnetWithHttpOperationResponse(resourceGroupName: string, name: string, vnetInfo: models.VirtualNetworkProfile, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Move an App Service Environment to a different VNET. + * + * Move an App Service Environment to a different VNET. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service Environment. + * + * @param {object} vnetInfo Details for the new virtual network. + * + * @param {string} [vnetInfo.id] Resource id of the Virtual Network. + * + * @param {string} [vnetInfo.subnet] Subnet within the Virtual Network. + * + * @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 {WebAppCollection} - 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. + * + * {WebAppCollection} [result] - The deserialized result object if an error did not occur. + * See {@link WebAppCollection} 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. + */ + changeVnet(resourceGroupName: string, name: string, vnetInfo: models.VirtualNetworkProfile, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + changeVnet(resourceGroupName: string, name: string, vnetInfo: models.VirtualNetworkProfile, callback: ServiceCallback): void; + changeVnet(resourceGroupName: string, name: string, vnetInfo: models.VirtualNetworkProfile, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Get diagnostic information for an App Service Environment. + * + * Get diagnostic information for an App Service Environment. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service Environment. + * + * @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. + */ + listDiagnosticsWithHttpOperationResponse(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get diagnostic information for an App Service Environment. + * + * Get diagnostic information for an App Service Environment. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service Environment. + * + * @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. + */ + listDiagnostics(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listDiagnostics(resourceGroupName: string, name: string, callback: ServiceCallback): void; + listDiagnostics(resourceGroupName: string, name: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Get a diagnostics item for an App Service Environment. + * + * Get a diagnostics item for an App Service Environment. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service Environment. + * + * @param {string} diagnosticsName Name of the diagnostics item. + * + * @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. + */ + getDiagnosticsItemWithHttpOperationResponse(resourceGroupName: string, name: string, diagnosticsName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get a diagnostics item for an App Service Environment. + * + * Get a diagnostics item for an App Service Environment. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service Environment. + * + * @param {string} diagnosticsName Name of the diagnostics item. + * + * @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 {HostingEnvironmentDiagnostics} - 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. + * + * {HostingEnvironmentDiagnostics} [result] - The deserialized result object if an error did not occur. + * See {@link HostingEnvironmentDiagnostics} 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. + */ + getDiagnosticsItem(resourceGroupName: string, name: string, diagnosticsName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getDiagnosticsItem(resourceGroupName: string, name: string, diagnosticsName: string, callback: ServiceCallback): void; + getDiagnosticsItem(resourceGroupName: string, name: string, diagnosticsName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Get global metric definitions of an App Service Environment. + * + * Get global metric definitions of an App Service Environment. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service Environment. + * + * @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. + */ + listMetricDefinitionsWithHttpOperationResponse(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get global metric definitions of an App Service Environment. + * + * Get global metric definitions of an App Service Environment. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service Environment. + * + * @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 {MetricDefinition} - 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. + * + * {MetricDefinition} [result] - The deserialized result object if an error did not occur. + * See {@link MetricDefinition} 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. + */ + listMetricDefinitions(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listMetricDefinitions(resourceGroupName: string, name: string, callback: ServiceCallback): void; + listMetricDefinitions(resourceGroupName: string, name: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Get global metrics of an App Service Environment. + * + * Get global metrics of an App Service Environment. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service Environment. + * + * @param {object} [options] Optional Parameters. + * + * @param {boolean} [options.details] Specify true to include + * instance details. The default is false. + * + * @param {string} [options.filter] Return only usages/metrics specified in the + * filter. Filter conforms to odata syntax. Example: $filter=(name.value eq + * 'Metric1' or name.value eq 'Metric2') and startTime eq 2014-01-01T00:00:00Z + * and endTime eq 2014-12-31T23:59:59Z and timeGrain eq + * duration'[Hour|Minute|Day]'. + * + * @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. + */ + listMetricsWithHttpOperationResponse(resourceGroupName: string, name: string, options?: { details? : boolean, filter? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get global metrics of an App Service Environment. + * + * Get global metrics of an App Service Environment. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service Environment. + * + * @param {object} [options] Optional Parameters. + * + * @param {boolean} [options.details] Specify true to include + * instance details. The default is false. + * + * @param {string} [options.filter] Return only usages/metrics specified in the + * filter. Filter conforms to odata syntax. Example: $filter=(name.value eq + * 'Metric1' or name.value eq 'Metric2') and startTime eq 2014-01-01T00:00:00Z + * and endTime eq 2014-12-31T23:59:59Z and timeGrain eq + * duration'[Hour|Minute|Day]'. + * + * @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 {ResourceMetricCollection} - 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. + * + * {ResourceMetricCollection} [result] - The deserialized result object if an error did not occur. + * See {@link ResourceMetricCollection} 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. + */ + listMetrics(resourceGroupName: string, name: string, options?: { details? : boolean, filter? : string, customHeaders? : { [headerName: string]: string; } }): Promise; + listMetrics(resourceGroupName: string, name: string, callback: ServiceCallback): void; + listMetrics(resourceGroupName: string, name: string, options: { details? : boolean, filter? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Get all multi-role pools. + * + * Get all multi-role pools. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service Environment. + * + * @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. + */ + listMultiRolePoolsWithHttpOperationResponse(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get all multi-role pools. + * + * Get all multi-role pools. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service Environment. + * + * @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 {WorkerPoolCollection} - 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. + * + * {WorkerPoolCollection} [result] - The deserialized result object if an error did not occur. + * See {@link WorkerPoolCollection} 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. + */ + listMultiRolePools(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listMultiRolePools(resourceGroupName: string, name: string, callback: ServiceCallback): void; + listMultiRolePools(resourceGroupName: string, name: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Get properties of a multi-role pool. + * + * Get properties of a multi-role pool. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service Environment. + * + * @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. + */ + getMultiRolePoolWithHttpOperationResponse(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get properties of a multi-role pool. + * + * Get properties of a multi-role pool. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service Environment. + * + * @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 {WorkerPoolResource} - 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. + * + * {WorkerPoolResource} [result] - The deserialized result object if an error did not occur. + * See {@link WorkerPoolResource} 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. + */ + getMultiRolePool(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getMultiRolePool(resourceGroupName: string, name: string, callback: ServiceCallback): void; + getMultiRolePool(resourceGroupName: string, name: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Create or update a multi-role pool. + * + * Create or update a multi-role pool. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service Environment. + * + * @param {object} multiRolePoolEnvelope Properties of the multi-role pool. + * + * @param {number} [multiRolePoolEnvelope.workerSizeId] Worker size ID for + * referencing this worker pool. + * + * @param {string} [multiRolePoolEnvelope.computeMode] Shared or dedicated app + * hosting. Possible values include: 'Shared', 'Dedicated', 'Dynamic' + * + * @param {string} [multiRolePoolEnvelope.workerSize] VM size of the worker + * pool instances. + * + * @param {number} [multiRolePoolEnvelope.workerCount] Number of instances in + * the worker pool. + * + * @param {object} [multiRolePoolEnvelope.sku] + * + * @param {string} [multiRolePoolEnvelope.sku.name] Name of the resource SKU. + * + * @param {string} [multiRolePoolEnvelope.sku.tier] Service tier of the + * resource SKU. + * + * @param {string} [multiRolePoolEnvelope.sku.size] Size specifier of the + * resource SKU. + * + * @param {string} [multiRolePoolEnvelope.sku.family] Family code of the + * resource SKU. + * + * @param {number} [multiRolePoolEnvelope.sku.capacity] Current number of + * instances assigned to the resource. + * + * @param {object} [multiRolePoolEnvelope.sku.skuCapacity] Min, max, and + * default scale values of the SKU. + * + * @param {number} [multiRolePoolEnvelope.sku.skuCapacity.minimum] Minimum + * number of workers for this App Service plan SKU. + * + * @param {number} [multiRolePoolEnvelope.sku.skuCapacity.maximum] Maximum + * number of workers for this App Service plan SKU. + * + * @param {number} [multiRolePoolEnvelope.sku.skuCapacity.default] Default + * number of workers for this App Service plan SKU. + * + * @param {string} [multiRolePoolEnvelope.sku.skuCapacity.scaleType] Available + * scale configurations for an App Service plan. + * + * @param {array} [multiRolePoolEnvelope.sku.locations] Locations of the SKU. + * + * @param {array} [multiRolePoolEnvelope.sku.capabilities] Capabilities of the + * SKU, e.g., is traffic manager enabled? + * + * @param {string} [multiRolePoolEnvelope.kind] Kind of resource. + * + * @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. + */ + createOrUpdateMultiRolePoolWithHttpOperationResponse(resourceGroupName: string, name: string, multiRolePoolEnvelope: models.WorkerPoolResource, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Create or update a multi-role pool. + * + * Create or update a multi-role pool. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service Environment. + * + * @param {object} multiRolePoolEnvelope Properties of the multi-role pool. + * + * @param {number} [multiRolePoolEnvelope.workerSizeId] Worker size ID for + * referencing this worker pool. + * + * @param {string} [multiRolePoolEnvelope.computeMode] Shared or dedicated app + * hosting. Possible values include: 'Shared', 'Dedicated', 'Dynamic' + * + * @param {string} [multiRolePoolEnvelope.workerSize] VM size of the worker + * pool instances. + * + * @param {number} [multiRolePoolEnvelope.workerCount] Number of instances in + * the worker pool. + * + * @param {object} [multiRolePoolEnvelope.sku] + * + * @param {string} [multiRolePoolEnvelope.sku.name] Name of the resource SKU. + * + * @param {string} [multiRolePoolEnvelope.sku.tier] Service tier of the + * resource SKU. + * + * @param {string} [multiRolePoolEnvelope.sku.size] Size specifier of the + * resource SKU. + * + * @param {string} [multiRolePoolEnvelope.sku.family] Family code of the + * resource SKU. + * + * @param {number} [multiRolePoolEnvelope.sku.capacity] Current number of + * instances assigned to the resource. + * + * @param {object} [multiRolePoolEnvelope.sku.skuCapacity] Min, max, and + * default scale values of the SKU. + * + * @param {number} [multiRolePoolEnvelope.sku.skuCapacity.minimum] Minimum + * number of workers for this App Service plan SKU. + * + * @param {number} [multiRolePoolEnvelope.sku.skuCapacity.maximum] Maximum + * number of workers for this App Service plan SKU. + * + * @param {number} [multiRolePoolEnvelope.sku.skuCapacity.default] Default + * number of workers for this App Service plan SKU. + * + * @param {string} [multiRolePoolEnvelope.sku.skuCapacity.scaleType] Available + * scale configurations for an App Service plan. + * + * @param {array} [multiRolePoolEnvelope.sku.locations] Locations of the SKU. + * + * @param {array} [multiRolePoolEnvelope.sku.capabilities] Capabilities of the + * SKU, e.g., is traffic manager enabled? + * + * @param {string} [multiRolePoolEnvelope.kind] Kind of resource. + * + * @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 {WorkerPoolResource} - 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. + * + * {WorkerPoolResource} [result] - The deserialized result object if an error did not occur. + * See {@link WorkerPoolResource} 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. + */ + createOrUpdateMultiRolePool(resourceGroupName: string, name: string, multiRolePoolEnvelope: models.WorkerPoolResource, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdateMultiRolePool(resourceGroupName: string, name: string, multiRolePoolEnvelope: models.WorkerPoolResource, callback: ServiceCallback): void; + createOrUpdateMultiRolePool(resourceGroupName: string, name: string, multiRolePoolEnvelope: models.WorkerPoolResource, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Create or update a multi-role pool. + * + * Create or update a multi-role pool. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service Environment. + * + * @param {object} multiRolePoolEnvelope Properties of the multi-role pool. + * + * @param {number} [multiRolePoolEnvelope.workerSizeId] Worker size ID for + * referencing this worker pool. + * + * @param {string} [multiRolePoolEnvelope.computeMode] Shared or dedicated app + * hosting. Possible values include: 'Shared', 'Dedicated', 'Dynamic' + * + * @param {string} [multiRolePoolEnvelope.workerSize] VM size of the worker + * pool instances. + * + * @param {number} [multiRolePoolEnvelope.workerCount] Number of instances in + * the worker pool. + * + * @param {object} [multiRolePoolEnvelope.sku] + * + * @param {string} [multiRolePoolEnvelope.sku.name] Name of the resource SKU. + * + * @param {string} [multiRolePoolEnvelope.sku.tier] Service tier of the + * resource SKU. + * + * @param {string} [multiRolePoolEnvelope.sku.size] Size specifier of the + * resource SKU. + * + * @param {string} [multiRolePoolEnvelope.sku.family] Family code of the + * resource SKU. + * + * @param {number} [multiRolePoolEnvelope.sku.capacity] Current number of + * instances assigned to the resource. + * + * @param {object} [multiRolePoolEnvelope.sku.skuCapacity] Min, max, and + * default scale values of the SKU. + * + * @param {number} [multiRolePoolEnvelope.sku.skuCapacity.minimum] Minimum + * number of workers for this App Service plan SKU. + * + * @param {number} [multiRolePoolEnvelope.sku.skuCapacity.maximum] Maximum + * number of workers for this App Service plan SKU. + * + * @param {number} [multiRolePoolEnvelope.sku.skuCapacity.default] Default + * number of workers for this App Service plan SKU. + * + * @param {string} [multiRolePoolEnvelope.sku.skuCapacity.scaleType] Available + * scale configurations for an App Service plan. + * + * @param {array} [multiRolePoolEnvelope.sku.locations] Locations of the SKU. + * + * @param {array} [multiRolePoolEnvelope.sku.capabilities] Capabilities of the + * SKU, e.g., is traffic manager enabled? + * + * @param {string} [multiRolePoolEnvelope.kind] Kind of resource. + * + * @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. + */ + updateMultiRolePoolWithHttpOperationResponse(resourceGroupName: string, name: string, multiRolePoolEnvelope: models.WorkerPoolResource, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Create or update a multi-role pool. + * + * Create or update a multi-role pool. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service Environment. + * + * @param {object} multiRolePoolEnvelope Properties of the multi-role pool. + * + * @param {number} [multiRolePoolEnvelope.workerSizeId] Worker size ID for + * referencing this worker pool. + * + * @param {string} [multiRolePoolEnvelope.computeMode] Shared or dedicated app + * hosting. Possible values include: 'Shared', 'Dedicated', 'Dynamic' + * + * @param {string} [multiRolePoolEnvelope.workerSize] VM size of the worker + * pool instances. + * + * @param {number} [multiRolePoolEnvelope.workerCount] Number of instances in + * the worker pool. + * + * @param {object} [multiRolePoolEnvelope.sku] + * + * @param {string} [multiRolePoolEnvelope.sku.name] Name of the resource SKU. + * + * @param {string} [multiRolePoolEnvelope.sku.tier] Service tier of the + * resource SKU. + * + * @param {string} [multiRolePoolEnvelope.sku.size] Size specifier of the + * resource SKU. + * + * @param {string} [multiRolePoolEnvelope.sku.family] Family code of the + * resource SKU. + * + * @param {number} [multiRolePoolEnvelope.sku.capacity] Current number of + * instances assigned to the resource. + * + * @param {object} [multiRolePoolEnvelope.sku.skuCapacity] Min, max, and + * default scale values of the SKU. + * + * @param {number} [multiRolePoolEnvelope.sku.skuCapacity.minimum] Minimum + * number of workers for this App Service plan SKU. + * + * @param {number} [multiRolePoolEnvelope.sku.skuCapacity.maximum] Maximum + * number of workers for this App Service plan SKU. + * + * @param {number} [multiRolePoolEnvelope.sku.skuCapacity.default] Default + * number of workers for this App Service plan SKU. + * + * @param {string} [multiRolePoolEnvelope.sku.skuCapacity.scaleType] Available + * scale configurations for an App Service plan. + * + * @param {array} [multiRolePoolEnvelope.sku.locations] Locations of the SKU. + * + * @param {array} [multiRolePoolEnvelope.sku.capabilities] Capabilities of the + * SKU, e.g., is traffic manager enabled? + * + * @param {string} [multiRolePoolEnvelope.kind] Kind of resource. + * + * @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 {WorkerPoolResource} - 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. + * + * {WorkerPoolResource} [result] - The deserialized result object if an error did not occur. + * See {@link WorkerPoolResource} 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. + */ + updateMultiRolePool(resourceGroupName: string, name: string, multiRolePoolEnvelope: models.WorkerPoolResource, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + updateMultiRolePool(resourceGroupName: string, name: string, multiRolePoolEnvelope: models.WorkerPoolResource, callback: ServiceCallback): void; + updateMultiRolePool(resourceGroupName: string, name: string, multiRolePoolEnvelope: models.WorkerPoolResource, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Get metric definitions for a specific instance of a multi-role pool + * of an App Service Environment. + * + * Get metric definitions for a specific instance of a multi-role pool of an + * App Service Environment. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service Environment. + * + * @param {string} instance Name of the instance in the multi-role pool. + * + * @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. + */ + listMultiRolePoolInstanceMetricDefinitionsWithHttpOperationResponse(resourceGroupName: string, name: string, instance: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get metric definitions for a specific instance of a multi-role pool + * of an App Service Environment. + * + * Get metric definitions for a specific instance of a multi-role pool of an + * App Service Environment. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service Environment. + * + * @param {string} instance Name of the instance in the multi-role pool. + * + * @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 {ResourceMetricDefinitionCollection} - 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. + * + * {ResourceMetricDefinitionCollection} [result] - The deserialized result object if an error did not occur. + * See {@link ResourceMetricDefinitionCollection} 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. + */ + listMultiRolePoolInstanceMetricDefinitions(resourceGroupName: string, name: string, instance: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listMultiRolePoolInstanceMetricDefinitions(resourceGroupName: string, name: string, instance: string, callback: ServiceCallback): void; + listMultiRolePoolInstanceMetricDefinitions(resourceGroupName: string, name: string, instance: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Get metrics for a specific instance of a multi-role pool of an App + * Service Environment. + * + * Get metrics for a specific instance of a multi-role pool of an App Service + * Environment. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service Environment. + * + * @param {string} instance Name of the instance in the multi-role pool. + * + * @param {object} [options] Optional Parameters. + * + * @param {boolean} [options.details] Specify true to include + * instance details. The default is false. + * + * @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. + */ + listMultiRolePoolInstanceMetricsWithHttpOperationResponse(resourceGroupName: string, name: string, instance: string, options?: { details? : boolean, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get metrics for a specific instance of a multi-role pool of an App + * Service Environment. + * + * Get metrics for a specific instance of a multi-role pool of an App Service + * Environment. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service Environment. + * + * @param {string} instance Name of the instance in the multi-role pool. + * + * @param {object} [options] Optional Parameters. + * + * @param {boolean} [options.details] Specify true to include + * instance details. The default is false. + * + * @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 {ResourceMetricCollection} - 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. + * + * {ResourceMetricCollection} [result] - The deserialized result object if an error did not occur. + * See {@link ResourceMetricCollection} 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. + */ + listMultiRolePoolInstanceMetrics(resourceGroupName: string, name: string, instance: string, options?: { details? : boolean, customHeaders? : { [headerName: string]: string; } }): Promise; + listMultiRolePoolInstanceMetrics(resourceGroupName: string, name: string, instance: string, callback: ServiceCallback): void; + listMultiRolePoolInstanceMetrics(resourceGroupName: string, name: string, instance: string, options: { details? : boolean, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Get metric definitions for a multi-role pool of an App Service + * Environment. + * + * Get metric definitions for a multi-role pool of an App Service Environment. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service Environment. + * + * @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. + */ + listMultiRoleMetricDefinitionsWithHttpOperationResponse(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get metric definitions for a multi-role pool of an App Service + * Environment. + * + * Get metric definitions for a multi-role pool of an App Service Environment. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service Environment. + * + * @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 {ResourceMetricDefinitionCollection} - 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. + * + * {ResourceMetricDefinitionCollection} [result] - The deserialized result object if an error did not occur. + * See {@link ResourceMetricDefinitionCollection} 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. + */ + listMultiRoleMetricDefinitions(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listMultiRoleMetricDefinitions(resourceGroupName: string, name: string, callback: ServiceCallback): void; + listMultiRoleMetricDefinitions(resourceGroupName: string, name: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Get metrics for a multi-role pool of an App Service Environment. + * + * Get metrics for a multi-role pool of an App Service Environment. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service Environment. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.startTime] Beginning time of the metrics query. + * + * @param {string} [options.endTime] End time of the metrics query. + * + * @param {string} [options.timeGrain] Time granularity of the metrics query. + * + * @param {boolean} [options.details] Specify true to include + * instance details. The default is false. + * + * @param {string} [options.filter] Return only usages/metrics specified in the + * filter. Filter conforms to odata syntax. Example: $filter=(name.value eq + * 'Metric1' or name.value eq 'Metric2') and startTime eq 2014-01-01T00:00:00Z + * and endTime eq 2014-12-31T23:59:59Z and timeGrain eq + * duration'[Hour|Minute|Day]'. + * + * @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. + */ + listMultiRoleMetricsWithHttpOperationResponse(resourceGroupName: string, name: string, options?: { startTime? : string, endTime? : string, timeGrain? : string, details? : boolean, filter? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get metrics for a multi-role pool of an App Service Environment. + * + * Get metrics for a multi-role pool of an App Service Environment. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service Environment. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.startTime] Beginning time of the metrics query. + * + * @param {string} [options.endTime] End time of the metrics query. + * + * @param {string} [options.timeGrain] Time granularity of the metrics query. + * + * @param {boolean} [options.details] Specify true to include + * instance details. The default is false. + * + * @param {string} [options.filter] Return only usages/metrics specified in the + * filter. Filter conforms to odata syntax. Example: $filter=(name.value eq + * 'Metric1' or name.value eq 'Metric2') and startTime eq 2014-01-01T00:00:00Z + * and endTime eq 2014-12-31T23:59:59Z and timeGrain eq + * duration'[Hour|Minute|Day]'. + * + * @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 {ResourceMetricCollection} - 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. + * + * {ResourceMetricCollection} [result] - The deserialized result object if an error did not occur. + * See {@link ResourceMetricCollection} 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. + */ + listMultiRoleMetrics(resourceGroupName: string, name: string, options?: { startTime? : string, endTime? : string, timeGrain? : string, details? : boolean, filter? : string, customHeaders? : { [headerName: string]: string; } }): Promise; + listMultiRoleMetrics(resourceGroupName: string, name: string, callback: ServiceCallback): void; + listMultiRoleMetrics(resourceGroupName: string, name: string, options: { startTime? : string, endTime? : string, timeGrain? : string, details? : boolean, filter? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Get available SKUs for scaling a multi-role pool. + * + * Get available SKUs for scaling a multi-role pool. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service Environment. + * + * @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. + */ + listMultiRolePoolSkusWithHttpOperationResponse(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get available SKUs for scaling a multi-role pool. + * + * Get available SKUs for scaling a multi-role pool. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service Environment. + * + * @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 {SkuInfoCollection} - 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. + * + * {SkuInfoCollection} [result] - The deserialized result object if an error did not occur. + * See {@link SkuInfoCollection} 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. + */ + listMultiRolePoolSkus(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listMultiRolePoolSkus(resourceGroupName: string, name: string, callback: ServiceCallback): void; + listMultiRolePoolSkus(resourceGroupName: string, name: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Get usage metrics for a multi-role pool of an App Service + * Environment. + * + * Get usage metrics for a multi-role pool of an App Service Environment. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service Environment. + * + * @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. + */ + listMultiRoleUsagesWithHttpOperationResponse(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get usage metrics for a multi-role pool of an App Service + * Environment. + * + * Get usage metrics for a multi-role pool of an App Service Environment. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service Environment. + * + * @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 {UsageCollection} - 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. + * + * {UsageCollection} [result] - The deserialized result object if an error did not occur. + * See {@link UsageCollection} 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. + */ + listMultiRoleUsages(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listMultiRoleUsages(resourceGroupName: string, name: string, callback: ServiceCallback): void; + listMultiRoleUsages(resourceGroupName: string, name: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary List all currently running operations on the App Service + * Environment. + * + * List all currently running operations on the App Service Environment. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service Environment. + * + * @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. + */ + listOperationsWithHttpOperationResponse(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary List all currently running operations on the App Service + * Environment. + * + * List all currently running operations on the App Service Environment. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service Environment. + * + * @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. + */ + listOperations(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listOperations(resourceGroupName: string, name: string, callback: ServiceCallback): void; + listOperations(resourceGroupName: string, name: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Reboot all machines in an App Service Environment. + * + * Reboot all machines in an App Service Environment. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service Environment. + * + * @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. + */ + rebootWithHttpOperationResponse(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Reboot all machines in an App Service Environment. + * + * Reboot all machines in an App Service Environment. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service Environment. + * + * @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 {null} - 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. + * + * {null} [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. + */ + reboot(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + reboot(resourceGroupName: string, name: string, callback: ServiceCallback): void; + reboot(resourceGroupName: string, name: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Resume an App Service Environment. + * + * Resume an App Service Environment. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service Environment. + * + * @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. + */ + resumeWithHttpOperationResponse(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Resume an App Service Environment. + * + * Resume an App Service Environment. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service Environment. + * + * @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 {WebAppCollection} - 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. + * + * {WebAppCollection} [result] - The deserialized result object if an error did not occur. + * See {@link WebAppCollection} 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. + */ + resume(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + resume(resourceGroupName: string, name: string, callback: ServiceCallback): void; + resume(resourceGroupName: string, name: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Get all App Service plans in an App Service Environment. + * + * Get all App Service plans in an App Service Environment. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service Environment. + * + * @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. + */ + listAppServicePlansWithHttpOperationResponse(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get all App Service plans in an App Service Environment. + * + * Get all App Service plans in an App Service Environment. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service Environment. + * + * @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 {AppServicePlanCollection} - 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. + * + * {AppServicePlanCollection} [result] - The deserialized result object if an error did not occur. + * See {@link AppServicePlanCollection} 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. + */ + listAppServicePlans(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listAppServicePlans(resourceGroupName: string, name: string, callback: ServiceCallback): void; + listAppServicePlans(resourceGroupName: string, name: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Get all apps in an App Service Environment. + * + * Get all apps in an App Service Environment. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service Environment. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.propertiesToInclude] Comma separated list of app + * properties to include. + * + * @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. + */ + listWebAppsWithHttpOperationResponse(resourceGroupName: string, name: string, options?: { propertiesToInclude? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get all apps in an App Service Environment. + * + * Get all apps in an App Service Environment. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service Environment. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.propertiesToInclude] Comma separated list of app + * properties to include. + * + * @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 {WebAppCollection} - 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. + * + * {WebAppCollection} [result] - The deserialized result object if an error did not occur. + * See {@link WebAppCollection} 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. + */ + listWebApps(resourceGroupName: string, name: string, options?: { propertiesToInclude? : string, customHeaders? : { [headerName: string]: string; } }): Promise; + listWebApps(resourceGroupName: string, name: string, callback: ServiceCallback): void; + listWebApps(resourceGroupName: string, name: string, options: { propertiesToInclude? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Suspend an App Service Environment. + * + * Suspend an App Service Environment. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service Environment. + * + * @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. + */ + suspendWithHttpOperationResponse(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Suspend an App Service Environment. + * + * Suspend an App Service Environment. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service Environment. + * + * @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 {WebAppCollection} - 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. + * + * {WebAppCollection} [result] - The deserialized result object if an error did not occur. + * See {@link WebAppCollection} 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. + */ + suspend(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + suspend(resourceGroupName: string, name: string, callback: ServiceCallback): void; + suspend(resourceGroupName: string, name: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Get global usage metrics of an App Service Environment. + * + * Get global usage metrics of an App Service Environment. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service Environment. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.filter] Return only usages/metrics specified in the + * filter. Filter conforms to odata syntax. Example: $filter=(name.value eq + * 'Metric1' or name.value eq 'Metric2') and startTime eq 2014-01-01T00:00:00Z + * and endTime eq 2014-12-31T23:59:59Z and timeGrain eq + * duration'[Hour|Minute|Day]'. + * + * @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. + */ + listUsagesWithHttpOperationResponse(resourceGroupName: string, name: string, options?: { filter? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get global usage metrics of an App Service Environment. + * + * Get global usage metrics of an App Service Environment. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service Environment. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.filter] Return only usages/metrics specified in the + * filter. Filter conforms to odata syntax. Example: $filter=(name.value eq + * 'Metric1' or name.value eq 'Metric2') and startTime eq 2014-01-01T00:00:00Z + * and endTime eq 2014-12-31T23:59:59Z and timeGrain eq + * duration'[Hour|Minute|Day]'. + * + * @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 {CsmUsageQuotaCollection} - 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. + * + * {CsmUsageQuotaCollection} [result] - The deserialized result object if an error did not occur. + * See {@link CsmUsageQuotaCollection} 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. + */ + listUsages(resourceGroupName: string, name: string, options?: { filter? : string, customHeaders? : { [headerName: string]: string; } }): Promise; + listUsages(resourceGroupName: string, name: string, callback: ServiceCallback): void; + listUsages(resourceGroupName: string, name: string, options: { filter? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Get all worker pools of an App Service Environment. + * + * Get all worker pools of an App Service Environment. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service Environment. + * + * @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. + */ + listWorkerPoolsWithHttpOperationResponse(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get all worker pools of an App Service Environment. + * + * Get all worker pools of an App Service Environment. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service Environment. + * + * @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 {WorkerPoolCollection} - 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. + * + * {WorkerPoolCollection} [result] - The deserialized result object if an error did not occur. + * See {@link WorkerPoolCollection} 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. + */ + listWorkerPools(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listWorkerPools(resourceGroupName: string, name: string, callback: ServiceCallback): void; + listWorkerPools(resourceGroupName: string, name: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Get properties of a worker pool. + * + * Get properties of a worker pool. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service Environment. + * + * @param {string} workerPoolName Name of the worker pool. + * + * @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. + */ + getWorkerPoolWithHttpOperationResponse(resourceGroupName: string, name: string, workerPoolName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get properties of a worker pool. + * + * Get properties of a worker pool. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service Environment. + * + * @param {string} workerPoolName Name of the worker pool. + * + * @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 {WorkerPoolResource} - 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. + * + * {WorkerPoolResource} [result] - The deserialized result object if an error did not occur. + * See {@link WorkerPoolResource} 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. + */ + getWorkerPool(resourceGroupName: string, name: string, workerPoolName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getWorkerPool(resourceGroupName: string, name: string, workerPoolName: string, callback: ServiceCallback): void; + getWorkerPool(resourceGroupName: string, name: string, workerPoolName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Create or update a worker pool. + * + * Create or update a worker pool. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service Environment. + * + * @param {string} workerPoolName Name of the worker pool. + * + * @param {object} workerPoolEnvelope Properties of the worker pool. + * + * @param {number} [workerPoolEnvelope.workerSizeId] Worker size ID for + * referencing this worker pool. + * + * @param {string} [workerPoolEnvelope.computeMode] Shared or dedicated app + * hosting. Possible values include: 'Shared', 'Dedicated', 'Dynamic' + * + * @param {string} [workerPoolEnvelope.workerSize] VM size of the worker pool + * instances. + * + * @param {number} [workerPoolEnvelope.workerCount] Number of instances in the + * worker pool. + * + * @param {object} [workerPoolEnvelope.sku] + * + * @param {string} [workerPoolEnvelope.sku.name] Name of the resource SKU. + * + * @param {string} [workerPoolEnvelope.sku.tier] Service tier of the resource + * SKU. + * + * @param {string} [workerPoolEnvelope.sku.size] Size specifier of the resource + * SKU. + * + * @param {string} [workerPoolEnvelope.sku.family] Family code of the resource + * SKU. + * + * @param {number} [workerPoolEnvelope.sku.capacity] Current number of + * instances assigned to the resource. + * + * @param {object} [workerPoolEnvelope.sku.skuCapacity] Min, max, and default + * scale values of the SKU. + * + * @param {number} [workerPoolEnvelope.sku.skuCapacity.minimum] Minimum number + * of workers for this App Service plan SKU. + * + * @param {number} [workerPoolEnvelope.sku.skuCapacity.maximum] Maximum number + * of workers for this App Service plan SKU. + * + * @param {number} [workerPoolEnvelope.sku.skuCapacity.default] Default number + * of workers for this App Service plan SKU. + * + * @param {string} [workerPoolEnvelope.sku.skuCapacity.scaleType] Available + * scale configurations for an App Service plan. + * + * @param {array} [workerPoolEnvelope.sku.locations] Locations of the SKU. + * + * @param {array} [workerPoolEnvelope.sku.capabilities] Capabilities of the + * SKU, e.g., is traffic manager enabled? + * + * @param {string} [workerPoolEnvelope.kind] Kind of resource. + * + * @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. + */ + createOrUpdateWorkerPoolWithHttpOperationResponse(resourceGroupName: string, name: string, workerPoolName: string, workerPoolEnvelope: models.WorkerPoolResource, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Create or update a worker pool. + * + * Create or update a worker pool. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service Environment. + * + * @param {string} workerPoolName Name of the worker pool. + * + * @param {object} workerPoolEnvelope Properties of the worker pool. + * + * @param {number} [workerPoolEnvelope.workerSizeId] Worker size ID for + * referencing this worker pool. + * + * @param {string} [workerPoolEnvelope.computeMode] Shared or dedicated app + * hosting. Possible values include: 'Shared', 'Dedicated', 'Dynamic' + * + * @param {string} [workerPoolEnvelope.workerSize] VM size of the worker pool + * instances. + * + * @param {number} [workerPoolEnvelope.workerCount] Number of instances in the + * worker pool. + * + * @param {object} [workerPoolEnvelope.sku] + * + * @param {string} [workerPoolEnvelope.sku.name] Name of the resource SKU. + * + * @param {string} [workerPoolEnvelope.sku.tier] Service tier of the resource + * SKU. + * + * @param {string} [workerPoolEnvelope.sku.size] Size specifier of the resource + * SKU. + * + * @param {string} [workerPoolEnvelope.sku.family] Family code of the resource + * SKU. + * + * @param {number} [workerPoolEnvelope.sku.capacity] Current number of + * instances assigned to the resource. + * + * @param {object} [workerPoolEnvelope.sku.skuCapacity] Min, max, and default + * scale values of the SKU. + * + * @param {number} [workerPoolEnvelope.sku.skuCapacity.minimum] Minimum number + * of workers for this App Service plan SKU. + * + * @param {number} [workerPoolEnvelope.sku.skuCapacity.maximum] Maximum number + * of workers for this App Service plan SKU. + * + * @param {number} [workerPoolEnvelope.sku.skuCapacity.default] Default number + * of workers for this App Service plan SKU. + * + * @param {string} [workerPoolEnvelope.sku.skuCapacity.scaleType] Available + * scale configurations for an App Service plan. + * + * @param {array} [workerPoolEnvelope.sku.locations] Locations of the SKU. + * + * @param {array} [workerPoolEnvelope.sku.capabilities] Capabilities of the + * SKU, e.g., is traffic manager enabled? + * + * @param {string} [workerPoolEnvelope.kind] Kind of resource. + * + * @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 {WorkerPoolResource} - 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. + * + * {WorkerPoolResource} [result] - The deserialized result object if an error did not occur. + * See {@link WorkerPoolResource} 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. + */ + createOrUpdateWorkerPool(resourceGroupName: string, name: string, workerPoolName: string, workerPoolEnvelope: models.WorkerPoolResource, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdateWorkerPool(resourceGroupName: string, name: string, workerPoolName: string, workerPoolEnvelope: models.WorkerPoolResource, callback: ServiceCallback): void; + createOrUpdateWorkerPool(resourceGroupName: string, name: string, workerPoolName: string, workerPoolEnvelope: models.WorkerPoolResource, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Create or update a worker pool. + * + * Create or update a worker pool. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service Environment. + * + * @param {string} workerPoolName Name of the worker pool. + * + * @param {object} workerPoolEnvelope Properties of the worker pool. + * + * @param {number} [workerPoolEnvelope.workerSizeId] Worker size ID for + * referencing this worker pool. + * + * @param {string} [workerPoolEnvelope.computeMode] Shared or dedicated app + * hosting. Possible values include: 'Shared', 'Dedicated', 'Dynamic' + * + * @param {string} [workerPoolEnvelope.workerSize] VM size of the worker pool + * instances. + * + * @param {number} [workerPoolEnvelope.workerCount] Number of instances in the + * worker pool. + * + * @param {object} [workerPoolEnvelope.sku] + * + * @param {string} [workerPoolEnvelope.sku.name] Name of the resource SKU. + * + * @param {string} [workerPoolEnvelope.sku.tier] Service tier of the resource + * SKU. + * + * @param {string} [workerPoolEnvelope.sku.size] Size specifier of the resource + * SKU. + * + * @param {string} [workerPoolEnvelope.sku.family] Family code of the resource + * SKU. + * + * @param {number} [workerPoolEnvelope.sku.capacity] Current number of + * instances assigned to the resource. + * + * @param {object} [workerPoolEnvelope.sku.skuCapacity] Min, max, and default + * scale values of the SKU. + * + * @param {number} [workerPoolEnvelope.sku.skuCapacity.minimum] Minimum number + * of workers for this App Service plan SKU. + * + * @param {number} [workerPoolEnvelope.sku.skuCapacity.maximum] Maximum number + * of workers for this App Service plan SKU. + * + * @param {number} [workerPoolEnvelope.sku.skuCapacity.default] Default number + * of workers for this App Service plan SKU. + * + * @param {string} [workerPoolEnvelope.sku.skuCapacity.scaleType] Available + * scale configurations for an App Service plan. + * + * @param {array} [workerPoolEnvelope.sku.locations] Locations of the SKU. + * + * @param {array} [workerPoolEnvelope.sku.capabilities] Capabilities of the + * SKU, e.g., is traffic manager enabled? + * + * @param {string} [workerPoolEnvelope.kind] Kind of resource. + * + * @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. + */ + updateWorkerPoolWithHttpOperationResponse(resourceGroupName: string, name: string, workerPoolName: string, workerPoolEnvelope: models.WorkerPoolResource, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Create or update a worker pool. + * + * Create or update a worker pool. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service Environment. + * + * @param {string} workerPoolName Name of the worker pool. + * + * @param {object} workerPoolEnvelope Properties of the worker pool. + * + * @param {number} [workerPoolEnvelope.workerSizeId] Worker size ID for + * referencing this worker pool. + * + * @param {string} [workerPoolEnvelope.computeMode] Shared or dedicated app + * hosting. Possible values include: 'Shared', 'Dedicated', 'Dynamic' + * + * @param {string} [workerPoolEnvelope.workerSize] VM size of the worker pool + * instances. + * + * @param {number} [workerPoolEnvelope.workerCount] Number of instances in the + * worker pool. + * + * @param {object} [workerPoolEnvelope.sku] + * + * @param {string} [workerPoolEnvelope.sku.name] Name of the resource SKU. + * + * @param {string} [workerPoolEnvelope.sku.tier] Service tier of the resource + * SKU. + * + * @param {string} [workerPoolEnvelope.sku.size] Size specifier of the resource + * SKU. + * + * @param {string} [workerPoolEnvelope.sku.family] Family code of the resource + * SKU. + * + * @param {number} [workerPoolEnvelope.sku.capacity] Current number of + * instances assigned to the resource. + * + * @param {object} [workerPoolEnvelope.sku.skuCapacity] Min, max, and default + * scale values of the SKU. + * + * @param {number} [workerPoolEnvelope.sku.skuCapacity.minimum] Minimum number + * of workers for this App Service plan SKU. + * + * @param {number} [workerPoolEnvelope.sku.skuCapacity.maximum] Maximum number + * of workers for this App Service plan SKU. + * + * @param {number} [workerPoolEnvelope.sku.skuCapacity.default] Default number + * of workers for this App Service plan SKU. + * + * @param {string} [workerPoolEnvelope.sku.skuCapacity.scaleType] Available + * scale configurations for an App Service plan. + * + * @param {array} [workerPoolEnvelope.sku.locations] Locations of the SKU. + * + * @param {array} [workerPoolEnvelope.sku.capabilities] Capabilities of the + * SKU, e.g., is traffic manager enabled? + * + * @param {string} [workerPoolEnvelope.kind] Kind of resource. + * + * @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 {WorkerPoolResource} - 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. + * + * {WorkerPoolResource} [result] - The deserialized result object if an error did not occur. + * See {@link WorkerPoolResource} 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. + */ + updateWorkerPool(resourceGroupName: string, name: string, workerPoolName: string, workerPoolEnvelope: models.WorkerPoolResource, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + updateWorkerPool(resourceGroupName: string, name: string, workerPoolName: string, workerPoolEnvelope: models.WorkerPoolResource, callback: ServiceCallback): void; + updateWorkerPool(resourceGroupName: string, name: string, workerPoolName: string, workerPoolEnvelope: models.WorkerPoolResource, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Get metric definitions for a specific instance of a worker pool of + * an App Service Environment. + * + * Get metric definitions for a specific instance of a worker pool of an App + * Service Environment. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service Environment. + * + * @param {string} workerPoolName Name of the worker pool. + * + * @param {string} instance Name of the instance in the worker pool. + * + * @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. + */ + listWorkerPoolInstanceMetricDefinitionsWithHttpOperationResponse(resourceGroupName: string, name: string, workerPoolName: string, instance: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get metric definitions for a specific instance of a worker pool of + * an App Service Environment. + * + * Get metric definitions for a specific instance of a worker pool of an App + * Service Environment. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service Environment. + * + * @param {string} workerPoolName Name of the worker pool. + * + * @param {string} instance Name of the instance in the worker pool. + * + * @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 {ResourceMetricDefinitionCollection} - 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. + * + * {ResourceMetricDefinitionCollection} [result] - The deserialized result object if an error did not occur. + * See {@link ResourceMetricDefinitionCollection} 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. + */ + listWorkerPoolInstanceMetricDefinitions(resourceGroupName: string, name: string, workerPoolName: string, instance: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listWorkerPoolInstanceMetricDefinitions(resourceGroupName: string, name: string, workerPoolName: string, instance: string, callback: ServiceCallback): void; + listWorkerPoolInstanceMetricDefinitions(resourceGroupName: string, name: string, workerPoolName: string, instance: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Get metrics for a specific instance of a worker pool of an App + * Service Environment. + * + * Get metrics for a specific instance of a worker pool of an App Service + * Environment. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service Environment. + * + * @param {string} workerPoolName Name of the worker pool. + * + * @param {string} instance Name of the instance in the worker pool. + * + * @param {object} [options] Optional Parameters. + * + * @param {boolean} [options.details] Specify true to include + * instance details. The default is false. + * + * @param {string} [options.filter] Return only usages/metrics specified in the + * filter. Filter conforms to odata syntax. Example: $filter=(name.value eq + * 'Metric1' or name.value eq 'Metric2') and startTime eq 2014-01-01T00:00:00Z + * and endTime eq 2014-12-31T23:59:59Z and timeGrain eq + * duration'[Hour|Minute|Day]'. + * + * @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. + */ + listWorkerPoolInstanceMetricsWithHttpOperationResponse(resourceGroupName: string, name: string, workerPoolName: string, instance: string, options?: { details? : boolean, filter? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get metrics for a specific instance of a worker pool of an App + * Service Environment. + * + * Get metrics for a specific instance of a worker pool of an App Service + * Environment. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service Environment. + * + * @param {string} workerPoolName Name of the worker pool. + * + * @param {string} instance Name of the instance in the worker pool. + * + * @param {object} [options] Optional Parameters. + * + * @param {boolean} [options.details] Specify true to include + * instance details. The default is false. + * + * @param {string} [options.filter] Return only usages/metrics specified in the + * filter. Filter conforms to odata syntax. Example: $filter=(name.value eq + * 'Metric1' or name.value eq 'Metric2') and startTime eq 2014-01-01T00:00:00Z + * and endTime eq 2014-12-31T23:59:59Z and timeGrain eq + * duration'[Hour|Minute|Day]'. + * + * @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 {ResourceMetricCollection} - 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. + * + * {ResourceMetricCollection} [result] - The deserialized result object if an error did not occur. + * See {@link ResourceMetricCollection} 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. + */ + listWorkerPoolInstanceMetrics(resourceGroupName: string, name: string, workerPoolName: string, instance: string, options?: { details? : boolean, filter? : string, customHeaders? : { [headerName: string]: string; } }): Promise; + listWorkerPoolInstanceMetrics(resourceGroupName: string, name: string, workerPoolName: string, instance: string, callback: ServiceCallback): void; + listWorkerPoolInstanceMetrics(resourceGroupName: string, name: string, workerPoolName: string, instance: string, options: { details? : boolean, filter? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Get metric definitions for a worker pool of an App Service + * Environment. + * + * Get metric definitions for a worker pool of an App Service Environment. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service Environment. + * + * @param {string} workerPoolName Name of the worker pool. + * + * @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. + */ + listWebWorkerMetricDefinitionsWithHttpOperationResponse(resourceGroupName: string, name: string, workerPoolName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get metric definitions for a worker pool of an App Service + * Environment. + * + * Get metric definitions for a worker pool of an App Service Environment. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service Environment. + * + * @param {string} workerPoolName Name of the worker pool. + * + * @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 {ResourceMetricDefinitionCollection} - 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. + * + * {ResourceMetricDefinitionCollection} [result] - The deserialized result object if an error did not occur. + * See {@link ResourceMetricDefinitionCollection} 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. + */ + listWebWorkerMetricDefinitions(resourceGroupName: string, name: string, workerPoolName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listWebWorkerMetricDefinitions(resourceGroupName: string, name: string, workerPoolName: string, callback: ServiceCallback): void; + listWebWorkerMetricDefinitions(resourceGroupName: string, name: string, workerPoolName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Get metrics for a worker pool of a AppServiceEnvironment (App + * Service Environment). + * + * Get metrics for a worker pool of a AppServiceEnvironment (App Service + * Environment). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service Environment. + * + * @param {string} workerPoolName Name of worker pool + * + * @param {object} [options] Optional Parameters. + * + * @param {boolean} [options.details] Specify true to include + * instance details. The default is false. + * + * @param {string} [options.filter] Return only usages/metrics specified in the + * filter. Filter conforms to odata syntax. Example: $filter=(name.value eq + * 'Metric1' or name.value eq 'Metric2') and startTime eq 2014-01-01T00:00:00Z + * and endTime eq 2014-12-31T23:59:59Z and timeGrain eq + * duration'[Hour|Minute|Day]'. + * + * @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. + */ + listWebWorkerMetricsWithHttpOperationResponse(resourceGroupName: string, name: string, workerPoolName: string, options?: { details? : boolean, filter? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get metrics for a worker pool of a AppServiceEnvironment (App + * Service Environment). + * + * Get metrics for a worker pool of a AppServiceEnvironment (App Service + * Environment). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service Environment. + * + * @param {string} workerPoolName Name of worker pool + * + * @param {object} [options] Optional Parameters. + * + * @param {boolean} [options.details] Specify true to include + * instance details. The default is false. + * + * @param {string} [options.filter] Return only usages/metrics specified in the + * filter. Filter conforms to odata syntax. Example: $filter=(name.value eq + * 'Metric1' or name.value eq 'Metric2') and startTime eq 2014-01-01T00:00:00Z + * and endTime eq 2014-12-31T23:59:59Z and timeGrain eq + * duration'[Hour|Minute|Day]'. + * + * @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 {ResourceMetricCollection} - 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. + * + * {ResourceMetricCollection} [result] - The deserialized result object if an error did not occur. + * See {@link ResourceMetricCollection} 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. + */ + listWebWorkerMetrics(resourceGroupName: string, name: string, workerPoolName: string, options?: { details? : boolean, filter? : string, customHeaders? : { [headerName: string]: string; } }): Promise; + listWebWorkerMetrics(resourceGroupName: string, name: string, workerPoolName: string, callback: ServiceCallback): void; + listWebWorkerMetrics(resourceGroupName: string, name: string, workerPoolName: string, options: { details? : boolean, filter? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Get available SKUs for scaling a worker pool. + * + * Get available SKUs for scaling a worker pool. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service Environment. + * + * @param {string} workerPoolName Name of the worker pool. + * + * @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. + */ + listWorkerPoolSkusWithHttpOperationResponse(resourceGroupName: string, name: string, workerPoolName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get available SKUs for scaling a worker pool. + * + * Get available SKUs for scaling a worker pool. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service Environment. + * + * @param {string} workerPoolName Name of the worker pool. + * + * @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 {SkuInfoCollection} - 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. + * + * {SkuInfoCollection} [result] - The deserialized result object if an error did not occur. + * See {@link SkuInfoCollection} 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. + */ + listWorkerPoolSkus(resourceGroupName: string, name: string, workerPoolName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listWorkerPoolSkus(resourceGroupName: string, name: string, workerPoolName: string, callback: ServiceCallback): void; + listWorkerPoolSkus(resourceGroupName: string, name: string, workerPoolName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Get usage metrics for a worker pool of an App Service Environment. + * + * Get usage metrics for a worker pool of an App Service Environment. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service Environment. + * + * @param {string} workerPoolName Name of the worker pool. + * + * @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. + */ + listWebWorkerUsagesWithHttpOperationResponse(resourceGroupName: string, name: string, workerPoolName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get usage metrics for a worker pool of an App Service Environment. + * + * Get usage metrics for a worker pool of an App Service Environment. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service Environment. + * + * @param {string} workerPoolName Name of the worker pool. + * + * @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 {UsageCollection} - 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. + * + * {UsageCollection} [result] - The deserialized result object if an error did not occur. + * See {@link UsageCollection} 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. + */ + listWebWorkerUsages(resourceGroupName: string, name: string, workerPoolName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listWebWorkerUsages(resourceGroupName: string, name: string, workerPoolName: string, callback: ServiceCallback): void; + listWebWorkerUsages(resourceGroupName: string, name: string, workerPoolName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Create or update an App Service Environment. + * + * Create or update an App Service Environment. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service Environment. + * + * @param {object} hostingEnvironmentEnvelope Configuration details of the App + * Service Environment. + * + * @param {string} hostingEnvironmentEnvelope.appServiceEnvironmentResourceName + * Name of the App Service Environment. + * + * @param {string} + * hostingEnvironmentEnvelope.appServiceEnvironmentResourceLocation Location of + * the App Service Environment, e.g. "West US". + * + * @param {string} [hostingEnvironmentEnvelope.vnetName] Name of the Virtual + * Network for the App Service Environment. + * + * @param {string} [hostingEnvironmentEnvelope.vnetResourceGroupName] Resource + * group of the Virtual Network. + * + * @param {string} [hostingEnvironmentEnvelope.vnetSubnetName] Subnet of the + * Virtual Network. + * + * @param {object} hostingEnvironmentEnvelope.virtualNetwork Description of the + * Virtual Network. + * + * @param {string} [hostingEnvironmentEnvelope.virtualNetwork.id] Resource id + * of the Virtual Network. + * + * @param {string} [hostingEnvironmentEnvelope.virtualNetwork.subnet] Subnet + * within the Virtual Network. + * + * @param {string} [hostingEnvironmentEnvelope.internalLoadBalancingMode] + * Specifies which endpoints to serve internally in the Virtual Network for the + * App Service Environment. Possible values include: 'None', 'Web', + * 'Publishing' + * + * @param {string} [hostingEnvironmentEnvelope.multiSize] Front-end VM size, + * e.g. "Medium", "Large". + * + * @param {number} [hostingEnvironmentEnvelope.multiRoleCount] Number of + * front-end instances. + * + * @param {array} hostingEnvironmentEnvelope.workerPools Description of worker + * pools with worker size IDs, VM sizes, and number of workers in each pool. + * + * @param {number} [hostingEnvironmentEnvelope.ipsslAddressCount] Number of IP + * SSL addresses reserved for the App Service Environment. + * + * @param {string} [hostingEnvironmentEnvelope.dnsSuffix] DNS suffix of the App + * Service Environment. + * + * @param {array} [hostingEnvironmentEnvelope.networkAccessControlList] Access + * control list for controlling traffic to the App Service Environment. + * + * @param {number} [hostingEnvironmentEnvelope.frontEndScaleFactor] Scale + * factor for front-ends. + * + * @param {string} [hostingEnvironmentEnvelope.apiManagementAccountId] API + * Management Account associated with the App Service Environment. + * + * @param {boolean} [hostingEnvironmentEnvelope.suspended] true if + * the App Service Environment is suspended; otherwise, false. The + * environment can be suspended, e.g. when the management endpoint is no longer + * available + * (most likely because NSG blocked the incoming traffic). + * + * @param {boolean} [hostingEnvironmentEnvelope.dynamicCacheEnabled] True/false + * indicating whether the App Service Environment is suspended. The environment + * can be suspended e.g. when the management endpoint is no longer available + * (most likely because NSG blocked the incoming traffic). + * + * @param {array} [hostingEnvironmentEnvelope.clusterSettings] Custom settings + * for changing the behavior of the App Service Environment. + * + * @param {array} [hostingEnvironmentEnvelope.userWhitelistedIpRanges] User + * added ip ranges to whitelist on ASE db + * + * @param {boolean} [hostingEnvironmentEnvelope.hasLinuxWorkers] Flag that + * displays whether an ASE has linux workers or not + * + * @param {string} [hostingEnvironmentEnvelope.sslCertKeyVaultId] Key Vault ID + * for ILB App Service Environment default SSL certificate + * + * @param {string} [hostingEnvironmentEnvelope.sslCertKeyVaultSecretName] Key + * Vault Secret Name for ILB App Service Environment default SSL certificate + * + * @param {string} [hostingEnvironmentEnvelope.kind] Kind of resource. + * + * @param {string} hostingEnvironmentEnvelope.location Resource Location. + * + * @param {object} [hostingEnvironmentEnvelope.tags] Resource tags. + * + * @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. + */ + beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, name: string, hostingEnvironmentEnvelope: models.AppServiceEnvironmentResource, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Create or update an App Service Environment. + * + * Create or update an App Service Environment. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service Environment. + * + * @param {object} hostingEnvironmentEnvelope Configuration details of the App + * Service Environment. + * + * @param {string} hostingEnvironmentEnvelope.appServiceEnvironmentResourceName + * Name of the App Service Environment. + * + * @param {string} + * hostingEnvironmentEnvelope.appServiceEnvironmentResourceLocation Location of + * the App Service Environment, e.g. "West US". + * + * @param {string} [hostingEnvironmentEnvelope.vnetName] Name of the Virtual + * Network for the App Service Environment. + * + * @param {string} [hostingEnvironmentEnvelope.vnetResourceGroupName] Resource + * group of the Virtual Network. + * + * @param {string} [hostingEnvironmentEnvelope.vnetSubnetName] Subnet of the + * Virtual Network. + * + * @param {object} hostingEnvironmentEnvelope.virtualNetwork Description of the + * Virtual Network. + * + * @param {string} [hostingEnvironmentEnvelope.virtualNetwork.id] Resource id + * of the Virtual Network. + * + * @param {string} [hostingEnvironmentEnvelope.virtualNetwork.subnet] Subnet + * within the Virtual Network. + * + * @param {string} [hostingEnvironmentEnvelope.internalLoadBalancingMode] + * Specifies which endpoints to serve internally in the Virtual Network for the + * App Service Environment. Possible values include: 'None', 'Web', + * 'Publishing' + * + * @param {string} [hostingEnvironmentEnvelope.multiSize] Front-end VM size, + * e.g. "Medium", "Large". + * + * @param {number} [hostingEnvironmentEnvelope.multiRoleCount] Number of + * front-end instances. + * + * @param {array} hostingEnvironmentEnvelope.workerPools Description of worker + * pools with worker size IDs, VM sizes, and number of workers in each pool. + * + * @param {number} [hostingEnvironmentEnvelope.ipsslAddressCount] Number of IP + * SSL addresses reserved for the App Service Environment. + * + * @param {string} [hostingEnvironmentEnvelope.dnsSuffix] DNS suffix of the App + * Service Environment. + * + * @param {array} [hostingEnvironmentEnvelope.networkAccessControlList] Access + * control list for controlling traffic to the App Service Environment. + * + * @param {number} [hostingEnvironmentEnvelope.frontEndScaleFactor] Scale + * factor for front-ends. + * + * @param {string} [hostingEnvironmentEnvelope.apiManagementAccountId] API + * Management Account associated with the App Service Environment. + * + * @param {boolean} [hostingEnvironmentEnvelope.suspended] true if + * the App Service Environment is suspended; otherwise, false. The + * environment can be suspended, e.g. when the management endpoint is no longer + * available + * (most likely because NSG blocked the incoming traffic). + * + * @param {boolean} [hostingEnvironmentEnvelope.dynamicCacheEnabled] True/false + * indicating whether the App Service Environment is suspended. The environment + * can be suspended e.g. when the management endpoint is no longer available + * (most likely because NSG blocked the incoming traffic). + * + * @param {array} [hostingEnvironmentEnvelope.clusterSettings] Custom settings + * for changing the behavior of the App Service Environment. + * + * @param {array} [hostingEnvironmentEnvelope.userWhitelistedIpRanges] User + * added ip ranges to whitelist on ASE db + * + * @param {boolean} [hostingEnvironmentEnvelope.hasLinuxWorkers] Flag that + * displays whether an ASE has linux workers or not + * + * @param {string} [hostingEnvironmentEnvelope.sslCertKeyVaultId] Key Vault ID + * for ILB App Service Environment default SSL certificate + * + * @param {string} [hostingEnvironmentEnvelope.sslCertKeyVaultSecretName] Key + * Vault Secret Name for ILB App Service Environment default SSL certificate + * + * @param {string} [hostingEnvironmentEnvelope.kind] Kind of resource. + * + * @param {string} hostingEnvironmentEnvelope.location Resource Location. + * + * @param {object} [hostingEnvironmentEnvelope.tags] Resource tags. + * + * @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 {AppServiceEnvironmentResource} - 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. + * + * {AppServiceEnvironmentResource} [result] - The deserialized result object if an error did not occur. + * See {@link AppServiceEnvironmentResource} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + beginCreateOrUpdate(resourceGroupName: string, name: string, hostingEnvironmentEnvelope: models.AppServiceEnvironmentResource, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginCreateOrUpdate(resourceGroupName: string, name: string, hostingEnvironmentEnvelope: models.AppServiceEnvironmentResource, callback: ServiceCallback): void; + beginCreateOrUpdate(resourceGroupName: string, name: string, hostingEnvironmentEnvelope: models.AppServiceEnvironmentResource, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Delete an App Service Environment. + * + * Delete an App Service Environment. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service Environment. + * + * @param {object} [options] Optional Parameters. + * + * @param {boolean} [options.forceDelete] Specify true to force + * the deletion even if the App Service Environment contains resources. The + * default is false. + * + * @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. + */ + beginDeleteMethodWithHttpOperationResponse(resourceGroupName: string, name: string, options?: { forceDelete? : boolean, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Delete an App Service Environment. + * + * Delete an App Service Environment. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service Environment. + * + * @param {object} [options] Optional Parameters. + * + * @param {boolean} [options.forceDelete] Specify true to force + * the deletion even if the App Service Environment contains resources. The + * default is false. + * + * @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 {null} - 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. + * + * {null} [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. + */ + beginDeleteMethod(resourceGroupName: string, name: string, options?: { forceDelete? : boolean, customHeaders? : { [headerName: string]: string; } }): Promise; + beginDeleteMethod(resourceGroupName: string, name: string, callback: ServiceCallback): void; + beginDeleteMethod(resourceGroupName: string, name: string, options: { forceDelete? : boolean, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Move an App Service Environment to a different VNET. + * + * Move an App Service Environment to a different VNET. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service Environment. + * + * @param {object} vnetInfo Details for the new virtual network. + * + * @param {string} [vnetInfo.id] Resource id of the Virtual Network. + * + * @param {string} [vnetInfo.subnet] Subnet within the Virtual Network. + * + * @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. + */ + beginChangeVnetWithHttpOperationResponse(resourceGroupName: string, name: string, vnetInfo: models.VirtualNetworkProfile, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Move an App Service Environment to a different VNET. + * + * Move an App Service Environment to a different VNET. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service Environment. + * + * @param {object} vnetInfo Details for the new virtual network. + * + * @param {string} [vnetInfo.id] Resource id of the Virtual Network. + * + * @param {string} [vnetInfo.subnet] Subnet within the Virtual Network. + * + * @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 {WebAppCollection} - 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. + * + * {WebAppCollection} [result] - The deserialized result object if an error did not occur. + * See {@link WebAppCollection} 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. + */ + beginChangeVnet(resourceGroupName: string, name: string, vnetInfo: models.VirtualNetworkProfile, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginChangeVnet(resourceGroupName: string, name: string, vnetInfo: models.VirtualNetworkProfile, callback: ServiceCallback): void; + beginChangeVnet(resourceGroupName: string, name: string, vnetInfo: models.VirtualNetworkProfile, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Create or update a multi-role pool. + * + * Create or update a multi-role pool. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service Environment. + * + * @param {object} multiRolePoolEnvelope Properties of the multi-role pool. + * + * @param {number} [multiRolePoolEnvelope.workerSizeId] Worker size ID for + * referencing this worker pool. + * + * @param {string} [multiRolePoolEnvelope.computeMode] Shared or dedicated app + * hosting. Possible values include: 'Shared', 'Dedicated', 'Dynamic' + * + * @param {string} [multiRolePoolEnvelope.workerSize] VM size of the worker + * pool instances. + * + * @param {number} [multiRolePoolEnvelope.workerCount] Number of instances in + * the worker pool. + * + * @param {object} [multiRolePoolEnvelope.sku] + * + * @param {string} [multiRolePoolEnvelope.sku.name] Name of the resource SKU. + * + * @param {string} [multiRolePoolEnvelope.sku.tier] Service tier of the + * resource SKU. + * + * @param {string} [multiRolePoolEnvelope.sku.size] Size specifier of the + * resource SKU. + * + * @param {string} [multiRolePoolEnvelope.sku.family] Family code of the + * resource SKU. + * + * @param {number} [multiRolePoolEnvelope.sku.capacity] Current number of + * instances assigned to the resource. + * + * @param {object} [multiRolePoolEnvelope.sku.skuCapacity] Min, max, and + * default scale values of the SKU. + * + * @param {number} [multiRolePoolEnvelope.sku.skuCapacity.minimum] Minimum + * number of workers for this App Service plan SKU. + * + * @param {number} [multiRolePoolEnvelope.sku.skuCapacity.maximum] Maximum + * number of workers for this App Service plan SKU. + * + * @param {number} [multiRolePoolEnvelope.sku.skuCapacity.default] Default + * number of workers for this App Service plan SKU. + * + * @param {string} [multiRolePoolEnvelope.sku.skuCapacity.scaleType] Available + * scale configurations for an App Service plan. + * + * @param {array} [multiRolePoolEnvelope.sku.locations] Locations of the SKU. + * + * @param {array} [multiRolePoolEnvelope.sku.capabilities] Capabilities of the + * SKU, e.g., is traffic manager enabled? + * + * @param {string} [multiRolePoolEnvelope.kind] Kind of resource. + * + * @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. + */ + beginCreateOrUpdateMultiRolePoolWithHttpOperationResponse(resourceGroupName: string, name: string, multiRolePoolEnvelope: models.WorkerPoolResource, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Create or update a multi-role pool. + * + * Create or update a multi-role pool. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service Environment. + * + * @param {object} multiRolePoolEnvelope Properties of the multi-role pool. + * + * @param {number} [multiRolePoolEnvelope.workerSizeId] Worker size ID for + * referencing this worker pool. + * + * @param {string} [multiRolePoolEnvelope.computeMode] Shared or dedicated app + * hosting. Possible values include: 'Shared', 'Dedicated', 'Dynamic' + * + * @param {string} [multiRolePoolEnvelope.workerSize] VM size of the worker + * pool instances. + * + * @param {number} [multiRolePoolEnvelope.workerCount] Number of instances in + * the worker pool. + * + * @param {object} [multiRolePoolEnvelope.sku] + * + * @param {string} [multiRolePoolEnvelope.sku.name] Name of the resource SKU. + * + * @param {string} [multiRolePoolEnvelope.sku.tier] Service tier of the + * resource SKU. + * + * @param {string} [multiRolePoolEnvelope.sku.size] Size specifier of the + * resource SKU. + * + * @param {string} [multiRolePoolEnvelope.sku.family] Family code of the + * resource SKU. + * + * @param {number} [multiRolePoolEnvelope.sku.capacity] Current number of + * instances assigned to the resource. + * + * @param {object} [multiRolePoolEnvelope.sku.skuCapacity] Min, max, and + * default scale values of the SKU. + * + * @param {number} [multiRolePoolEnvelope.sku.skuCapacity.minimum] Minimum + * number of workers for this App Service plan SKU. + * + * @param {number} [multiRolePoolEnvelope.sku.skuCapacity.maximum] Maximum + * number of workers for this App Service plan SKU. + * + * @param {number} [multiRolePoolEnvelope.sku.skuCapacity.default] Default + * number of workers for this App Service plan SKU. + * + * @param {string} [multiRolePoolEnvelope.sku.skuCapacity.scaleType] Available + * scale configurations for an App Service plan. + * + * @param {array} [multiRolePoolEnvelope.sku.locations] Locations of the SKU. + * + * @param {array} [multiRolePoolEnvelope.sku.capabilities] Capabilities of the + * SKU, e.g., is traffic manager enabled? + * + * @param {string} [multiRolePoolEnvelope.kind] Kind of resource. + * + * @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 {WorkerPoolResource} - 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. + * + * {WorkerPoolResource} [result] - The deserialized result object if an error did not occur. + * See {@link WorkerPoolResource} 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. + */ + beginCreateOrUpdateMultiRolePool(resourceGroupName: string, name: string, multiRolePoolEnvelope: models.WorkerPoolResource, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginCreateOrUpdateMultiRolePool(resourceGroupName: string, name: string, multiRolePoolEnvelope: models.WorkerPoolResource, callback: ServiceCallback): void; + beginCreateOrUpdateMultiRolePool(resourceGroupName: string, name: string, multiRolePoolEnvelope: models.WorkerPoolResource, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Resume an App Service Environment. + * + * Resume an App Service Environment. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service Environment. + * + * @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. + */ + beginResumeWithHttpOperationResponse(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Resume an App Service Environment. + * + * Resume an App Service Environment. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service Environment. + * + * @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 {WebAppCollection} - 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. + * + * {WebAppCollection} [result] - The deserialized result object if an error did not occur. + * See {@link WebAppCollection} 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. + */ + beginResume(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginResume(resourceGroupName: string, name: string, callback: ServiceCallback): void; + beginResume(resourceGroupName: string, name: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Suspend an App Service Environment. + * + * Suspend an App Service Environment. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service Environment. + * + * @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. + */ + beginSuspendWithHttpOperationResponse(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Suspend an App Service Environment. + * + * Suspend an App Service Environment. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service Environment. + * + * @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 {WebAppCollection} - 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. + * + * {WebAppCollection} [result] - The deserialized result object if an error did not occur. + * See {@link WebAppCollection} 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. + */ + beginSuspend(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginSuspend(resourceGroupName: string, name: string, callback: ServiceCallback): void; + beginSuspend(resourceGroupName: string, name: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Create or update a worker pool. + * + * Create or update a worker pool. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service Environment. + * + * @param {string} workerPoolName Name of the worker pool. + * + * @param {object} workerPoolEnvelope Properties of the worker pool. + * + * @param {number} [workerPoolEnvelope.workerSizeId] Worker size ID for + * referencing this worker pool. + * + * @param {string} [workerPoolEnvelope.computeMode] Shared or dedicated app + * hosting. Possible values include: 'Shared', 'Dedicated', 'Dynamic' + * + * @param {string} [workerPoolEnvelope.workerSize] VM size of the worker pool + * instances. + * + * @param {number} [workerPoolEnvelope.workerCount] Number of instances in the + * worker pool. + * + * @param {object} [workerPoolEnvelope.sku] + * + * @param {string} [workerPoolEnvelope.sku.name] Name of the resource SKU. + * + * @param {string} [workerPoolEnvelope.sku.tier] Service tier of the resource + * SKU. + * + * @param {string} [workerPoolEnvelope.sku.size] Size specifier of the resource + * SKU. + * + * @param {string} [workerPoolEnvelope.sku.family] Family code of the resource + * SKU. + * + * @param {number} [workerPoolEnvelope.sku.capacity] Current number of + * instances assigned to the resource. + * + * @param {object} [workerPoolEnvelope.sku.skuCapacity] Min, max, and default + * scale values of the SKU. + * + * @param {number} [workerPoolEnvelope.sku.skuCapacity.minimum] Minimum number + * of workers for this App Service plan SKU. + * + * @param {number} [workerPoolEnvelope.sku.skuCapacity.maximum] Maximum number + * of workers for this App Service plan SKU. + * + * @param {number} [workerPoolEnvelope.sku.skuCapacity.default] Default number + * of workers for this App Service plan SKU. + * + * @param {string} [workerPoolEnvelope.sku.skuCapacity.scaleType] Available + * scale configurations for an App Service plan. + * + * @param {array} [workerPoolEnvelope.sku.locations] Locations of the SKU. + * + * @param {array} [workerPoolEnvelope.sku.capabilities] Capabilities of the + * SKU, e.g., is traffic manager enabled? + * + * @param {string} [workerPoolEnvelope.kind] Kind of resource. + * + * @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. + */ + beginCreateOrUpdateWorkerPoolWithHttpOperationResponse(resourceGroupName: string, name: string, workerPoolName: string, workerPoolEnvelope: models.WorkerPoolResource, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Create or update a worker pool. + * + * Create or update a worker pool. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service Environment. + * + * @param {string} workerPoolName Name of the worker pool. + * + * @param {object} workerPoolEnvelope Properties of the worker pool. + * + * @param {number} [workerPoolEnvelope.workerSizeId] Worker size ID for + * referencing this worker pool. + * + * @param {string} [workerPoolEnvelope.computeMode] Shared or dedicated app + * hosting. Possible values include: 'Shared', 'Dedicated', 'Dynamic' + * + * @param {string} [workerPoolEnvelope.workerSize] VM size of the worker pool + * instances. + * + * @param {number} [workerPoolEnvelope.workerCount] Number of instances in the + * worker pool. + * + * @param {object} [workerPoolEnvelope.sku] + * + * @param {string} [workerPoolEnvelope.sku.name] Name of the resource SKU. + * + * @param {string} [workerPoolEnvelope.sku.tier] Service tier of the resource + * SKU. + * + * @param {string} [workerPoolEnvelope.sku.size] Size specifier of the resource + * SKU. + * + * @param {string} [workerPoolEnvelope.sku.family] Family code of the resource + * SKU. + * + * @param {number} [workerPoolEnvelope.sku.capacity] Current number of + * instances assigned to the resource. + * + * @param {object} [workerPoolEnvelope.sku.skuCapacity] Min, max, and default + * scale values of the SKU. + * + * @param {number} [workerPoolEnvelope.sku.skuCapacity.minimum] Minimum number + * of workers for this App Service plan SKU. + * + * @param {number} [workerPoolEnvelope.sku.skuCapacity.maximum] Maximum number + * of workers for this App Service plan SKU. + * + * @param {number} [workerPoolEnvelope.sku.skuCapacity.default] Default number + * of workers for this App Service plan SKU. + * + * @param {string} [workerPoolEnvelope.sku.skuCapacity.scaleType] Available + * scale configurations for an App Service plan. + * + * @param {array} [workerPoolEnvelope.sku.locations] Locations of the SKU. + * + * @param {array} [workerPoolEnvelope.sku.capabilities] Capabilities of the + * SKU, e.g., is traffic manager enabled? + * + * @param {string} [workerPoolEnvelope.kind] Kind of resource. + * + * @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 {WorkerPoolResource} - 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. + * + * {WorkerPoolResource} [result] - The deserialized result object if an error did not occur. + * See {@link WorkerPoolResource} 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. + */ + beginCreateOrUpdateWorkerPool(resourceGroupName: string, name: string, workerPoolName: string, workerPoolEnvelope: models.WorkerPoolResource, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginCreateOrUpdateWorkerPool(resourceGroupName: string, name: string, workerPoolName: string, workerPoolEnvelope: models.WorkerPoolResource, callback: ServiceCallback): void; + beginCreateOrUpdateWorkerPool(resourceGroupName: string, name: string, workerPoolName: string, workerPoolEnvelope: models.WorkerPoolResource, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Get all App Service Environments for a subscription. + * + * Get all App Service Environments for a subscription. + * + * @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 Get all App Service Environments for a subscription. + * + * Get all App Service Environments for a subscription. + * + * @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 {AppServiceEnvironmentCollection} - 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. + * + * {AppServiceEnvironmentCollection} [result] - The deserialized result object if an error did not occur. + * See {@link AppServiceEnvironmentCollection} 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; + + + /** + * @summary Get all App Service Environments in a resource group. + * + * Get all App Service Environments in a resource group. + * + * @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. + */ + listByResourceGroupNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get all App Service Environments in a resource group. + * + * Get all App Service Environments in a resource group. + * + * @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 {AppServiceEnvironmentCollection} - 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. + * + * {AppServiceEnvironmentCollection} [result] - The deserialized result object if an error did not occur. + * See {@link AppServiceEnvironmentCollection} 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. + */ + listByResourceGroupNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByResourceGroupNext(nextPageLink: string, callback: ServiceCallback): void; + listByResourceGroupNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Get the used, available, and total worker capacity an App Service + * Environment. + * + * Get the used, available, and total worker capacity an App Service + * Environment. + * + * @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. + */ + listCapacitiesNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get the used, available, and total worker capacity an App Service + * Environment. + * + * Get the used, available, and total worker capacity an App Service + * Environment. + * + * @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 {StampCapacityCollection} - 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. + * + * {StampCapacityCollection} [result] - The deserialized result object if an error did not occur. + * See {@link StampCapacityCollection} 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. + */ + listCapacitiesNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listCapacitiesNext(nextPageLink: string, callback: ServiceCallback): void; + listCapacitiesNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Move an App Service Environment to a different VNET. + * + * Move an App Service Environment to a different VNET. + * + * @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. + */ + changeVnetNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Move an App Service Environment to a different VNET. + * + * Move an App Service Environment to a different VNET. + * + * @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 {WebAppCollection} - 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. + * + * {WebAppCollection} [result] - The deserialized result object if an error did not occur. + * See {@link WebAppCollection} 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. + */ + changeVnetNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + changeVnetNext(nextPageLink: string, callback: ServiceCallback): void; + changeVnetNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Get global metrics of an App Service Environment. + * + * Get global metrics of an App Service Environment. + * + * @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. + */ + listMetricsNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get global metrics of an App Service Environment. + * + * Get global metrics of an App Service Environment. + * + * @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 {ResourceMetricCollection} - 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. + * + * {ResourceMetricCollection} [result] - The deserialized result object if an error did not occur. + * See {@link ResourceMetricCollection} 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. + */ + listMetricsNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listMetricsNext(nextPageLink: string, callback: ServiceCallback): void; + listMetricsNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Get all multi-role pools. + * + * Get all multi-role pools. + * + * @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. + */ + listMultiRolePoolsNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get all multi-role pools. + * + * Get all multi-role pools. + * + * @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 {WorkerPoolCollection} - 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. + * + * {WorkerPoolCollection} [result] - The deserialized result object if an error did not occur. + * See {@link WorkerPoolCollection} 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. + */ + listMultiRolePoolsNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listMultiRolePoolsNext(nextPageLink: string, callback: ServiceCallback): void; + listMultiRolePoolsNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Get metric definitions for a specific instance of a multi-role pool + * of an App Service Environment. + * + * Get metric definitions for a specific instance of a multi-role pool of an + * App Service Environment. + * + * @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. + */ + listMultiRolePoolInstanceMetricDefinitionsNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get metric definitions for a specific instance of a multi-role pool + * of an App Service Environment. + * + * Get metric definitions for a specific instance of a multi-role pool of an + * App Service Environment. + * + * @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 {ResourceMetricDefinitionCollection} - 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. + * + * {ResourceMetricDefinitionCollection} [result] - The deserialized result object if an error did not occur. + * See {@link ResourceMetricDefinitionCollection} 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. + */ + listMultiRolePoolInstanceMetricDefinitionsNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listMultiRolePoolInstanceMetricDefinitionsNext(nextPageLink: string, callback: ServiceCallback): void; + listMultiRolePoolInstanceMetricDefinitionsNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Get metrics for a specific instance of a multi-role pool of an App + * Service Environment. + * + * Get metrics for a specific instance of a multi-role pool of an App Service + * Environment. + * + * @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. + */ + listMultiRolePoolInstanceMetricsNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get metrics for a specific instance of a multi-role pool of an App + * Service Environment. + * + * Get metrics for a specific instance of a multi-role pool of an App Service + * Environment. + * + * @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 {ResourceMetricCollection} - 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. + * + * {ResourceMetricCollection} [result] - The deserialized result object if an error did not occur. + * See {@link ResourceMetricCollection} 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. + */ + listMultiRolePoolInstanceMetricsNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listMultiRolePoolInstanceMetricsNext(nextPageLink: string, callback: ServiceCallback): void; + listMultiRolePoolInstanceMetricsNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Get metric definitions for a multi-role pool of an App Service + * Environment. + * + * Get metric definitions for a multi-role pool of an App Service Environment. + * + * @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. + */ + listMultiRoleMetricDefinitionsNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get metric definitions for a multi-role pool of an App Service + * Environment. + * + * Get metric definitions for a multi-role pool of an App Service Environment. + * + * @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 {ResourceMetricDefinitionCollection} - 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. + * + * {ResourceMetricDefinitionCollection} [result] - The deserialized result object if an error did not occur. + * See {@link ResourceMetricDefinitionCollection} 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. + */ + listMultiRoleMetricDefinitionsNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listMultiRoleMetricDefinitionsNext(nextPageLink: string, callback: ServiceCallback): void; + listMultiRoleMetricDefinitionsNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Get metrics for a multi-role pool of an App Service Environment. + * + * Get metrics for a multi-role pool of an App Service Environment. + * + * @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. + */ + listMultiRoleMetricsNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get metrics for a multi-role pool of an App Service Environment. + * + * Get metrics for a multi-role pool of an App Service Environment. + * + * @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 {ResourceMetricCollection} - 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. + * + * {ResourceMetricCollection} [result] - The deserialized result object if an error did not occur. + * See {@link ResourceMetricCollection} 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. + */ + listMultiRoleMetricsNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listMultiRoleMetricsNext(nextPageLink: string, callback: ServiceCallback): void; + listMultiRoleMetricsNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Get available SKUs for scaling a multi-role pool. + * + * Get available SKUs for scaling a multi-role pool. + * + * @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. + */ + listMultiRolePoolSkusNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get available SKUs for scaling a multi-role pool. + * + * Get available SKUs for scaling a multi-role pool. + * + * @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 {SkuInfoCollection} - 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. + * + * {SkuInfoCollection} [result] - The deserialized result object if an error did not occur. + * See {@link SkuInfoCollection} 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. + */ + listMultiRolePoolSkusNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listMultiRolePoolSkusNext(nextPageLink: string, callback: ServiceCallback): void; + listMultiRolePoolSkusNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Get usage metrics for a multi-role pool of an App Service + * Environment. + * + * Get usage metrics for a multi-role pool of an App Service Environment. + * + * @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. + */ + listMultiRoleUsagesNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get usage metrics for a multi-role pool of an App Service + * Environment. + * + * Get usage metrics for a multi-role pool of an App Service Environment. + * + * @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 {UsageCollection} - 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. + * + * {UsageCollection} [result] - The deserialized result object if an error did not occur. + * See {@link UsageCollection} 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. + */ + listMultiRoleUsagesNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listMultiRoleUsagesNext(nextPageLink: string, callback: ServiceCallback): void; + listMultiRoleUsagesNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Resume an App Service Environment. + * + * Resume an App Service Environment. + * + * @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. + */ + resumeNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Resume an App Service Environment. + * + * Resume an App Service Environment. + * + * @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 {WebAppCollection} - 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. + * + * {WebAppCollection} [result] - The deserialized result object if an error did not occur. + * See {@link WebAppCollection} 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. + */ + resumeNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + resumeNext(nextPageLink: string, callback: ServiceCallback): void; + resumeNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Get all App Service plans in an App Service Environment. + * + * Get all App Service plans in an App Service Environment. + * + * @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. + */ + listAppServicePlansNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get all App Service plans in an App Service Environment. + * + * Get all App Service plans in an App Service Environment. + * + * @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 {AppServicePlanCollection} - 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. + * + * {AppServicePlanCollection} [result] - The deserialized result object if an error did not occur. + * See {@link AppServicePlanCollection} 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. + */ + listAppServicePlansNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listAppServicePlansNext(nextPageLink: string, callback: ServiceCallback): void; + listAppServicePlansNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Get all apps in an App Service Environment. + * + * Get all apps in an App Service Environment. + * + * @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. + */ + listWebAppsNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get all apps in an App Service Environment. + * + * Get all apps in an App Service Environment. + * + * @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 {WebAppCollection} - 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. + * + * {WebAppCollection} [result] - The deserialized result object if an error did not occur. + * See {@link WebAppCollection} 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. + */ + listWebAppsNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listWebAppsNext(nextPageLink: string, callback: ServiceCallback): void; + listWebAppsNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Suspend an App Service Environment. + * + * Suspend an App Service Environment. + * + * @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. + */ + suspendNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Suspend an App Service Environment. + * + * Suspend an App Service Environment. + * + * @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 {WebAppCollection} - 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. + * + * {WebAppCollection} [result] - The deserialized result object if an error did not occur. + * See {@link WebAppCollection} 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. + */ + suspendNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + suspendNext(nextPageLink: string, callback: ServiceCallback): void; + suspendNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Get global usage metrics of an App Service Environment. + * + * Get global usage metrics of an App Service Environment. + * + * @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. + */ + listUsagesNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get global usage metrics of an App Service Environment. + * + * Get global usage metrics of an App Service Environment. + * + * @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 {CsmUsageQuotaCollection} - 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. + * + * {CsmUsageQuotaCollection} [result] - The deserialized result object if an error did not occur. + * See {@link CsmUsageQuotaCollection} 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. + */ + listUsagesNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listUsagesNext(nextPageLink: string, callback: ServiceCallback): void; + listUsagesNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Get all worker pools of an App Service Environment. + * + * Get all worker pools of an App Service Environment. + * + * @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. + */ + listWorkerPoolsNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get all worker pools of an App Service Environment. + * + * Get all worker pools of an App Service Environment. + * + * @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 {WorkerPoolCollection} - 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. + * + * {WorkerPoolCollection} [result] - The deserialized result object if an error did not occur. + * See {@link WorkerPoolCollection} 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. + */ + listWorkerPoolsNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listWorkerPoolsNext(nextPageLink: string, callback: ServiceCallback): void; + listWorkerPoolsNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Get metric definitions for a specific instance of a worker pool of + * an App Service Environment. + * + * Get metric definitions for a specific instance of a worker pool of an App + * Service Environment. + * + * @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. + */ + listWorkerPoolInstanceMetricDefinitionsNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get metric definitions for a specific instance of a worker pool of + * an App Service Environment. + * + * Get metric definitions for a specific instance of a worker pool of an App + * Service Environment. + * + * @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 {ResourceMetricDefinitionCollection} - 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. + * + * {ResourceMetricDefinitionCollection} [result] - The deserialized result object if an error did not occur. + * See {@link ResourceMetricDefinitionCollection} 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. + */ + listWorkerPoolInstanceMetricDefinitionsNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listWorkerPoolInstanceMetricDefinitionsNext(nextPageLink: string, callback: ServiceCallback): void; + listWorkerPoolInstanceMetricDefinitionsNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Get metrics for a specific instance of a worker pool of an App + * Service Environment. + * + * Get metrics for a specific instance of a worker pool of an App Service + * Environment. + * + * @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. + */ + listWorkerPoolInstanceMetricsNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get metrics for a specific instance of a worker pool of an App + * Service Environment. + * + * Get metrics for a specific instance of a worker pool of an App Service + * Environment. + * + * @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 {ResourceMetricCollection} - 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. + * + * {ResourceMetricCollection} [result] - The deserialized result object if an error did not occur. + * See {@link ResourceMetricCollection} 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. + */ + listWorkerPoolInstanceMetricsNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listWorkerPoolInstanceMetricsNext(nextPageLink: string, callback: ServiceCallback): void; + listWorkerPoolInstanceMetricsNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Get metric definitions for a worker pool of an App Service + * Environment. + * + * Get metric definitions for a worker pool of an App Service Environment. + * + * @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. + */ + listWebWorkerMetricDefinitionsNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get metric definitions for a worker pool of an App Service + * Environment. + * + * Get metric definitions for a worker pool of an App Service Environment. + * + * @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 {ResourceMetricDefinitionCollection} - 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. + * + * {ResourceMetricDefinitionCollection} [result] - The deserialized result object if an error did not occur. + * See {@link ResourceMetricDefinitionCollection} 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. + */ + listWebWorkerMetricDefinitionsNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listWebWorkerMetricDefinitionsNext(nextPageLink: string, callback: ServiceCallback): void; + listWebWorkerMetricDefinitionsNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Get metrics for a worker pool of a AppServiceEnvironment (App + * Service Environment). + * + * Get metrics for a worker pool of a AppServiceEnvironment (App Service + * Environment). + * + * @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. + */ + listWebWorkerMetricsNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get metrics for a worker pool of a AppServiceEnvironment (App + * Service Environment). + * + * Get metrics for a worker pool of a AppServiceEnvironment (App Service + * Environment). + * + * @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 {ResourceMetricCollection} - 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. + * + * {ResourceMetricCollection} [result] - The deserialized result object if an error did not occur. + * See {@link ResourceMetricCollection} 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. + */ + listWebWorkerMetricsNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listWebWorkerMetricsNext(nextPageLink: string, callback: ServiceCallback): void; + listWebWorkerMetricsNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Get available SKUs for scaling a worker pool. + * + * Get available SKUs for scaling a worker pool. + * + * @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. + */ + listWorkerPoolSkusNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get available SKUs for scaling a worker pool. + * + * Get available SKUs for scaling a worker pool. + * + * @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 {SkuInfoCollection} - 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. + * + * {SkuInfoCollection} [result] - The deserialized result object if an error did not occur. + * See {@link SkuInfoCollection} 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. + */ + listWorkerPoolSkusNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listWorkerPoolSkusNext(nextPageLink: string, callback: ServiceCallback): void; + listWorkerPoolSkusNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Get usage metrics for a worker pool of an App Service Environment. + * + * Get usage metrics for a worker pool of an App Service Environment. + * + * @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. + */ + listWebWorkerUsagesNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get usage metrics for a worker pool of an App Service Environment. + * + * Get usage metrics for a worker pool of an App Service Environment. + * + * @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 {UsageCollection} - 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. + * + * {UsageCollection} [result] - The deserialized result object if an error did not occur. + * See {@link UsageCollection} 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. + */ + listWebWorkerUsagesNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listWebWorkerUsagesNext(nextPageLink: string, callback: ServiceCallback): void; + listWebWorkerUsagesNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Move an App Service Environment to a different VNET. + * + * Move an App Service Environment to a different VNET. + * + * @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. + */ + beginChangeVnetNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Move an App Service Environment to a different VNET. + * + * Move an App Service Environment to a different VNET. + * + * @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 {WebAppCollection} - 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. + * + * {WebAppCollection} [result] - The deserialized result object if an error did not occur. + * See {@link WebAppCollection} 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. + */ + beginChangeVnetNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginChangeVnetNext(nextPageLink: string, callback: ServiceCallback): void; + beginChangeVnetNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Resume an App Service Environment. + * + * Resume an App Service Environment. + * + * @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. + */ + beginResumeNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Resume an App Service Environment. + * + * Resume an App Service Environment. + * + * @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 {WebAppCollection} - 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. + * + * {WebAppCollection} [result] - The deserialized result object if an error did not occur. + * See {@link WebAppCollection} 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. + */ + beginResumeNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginResumeNext(nextPageLink: string, callback: ServiceCallback): void; + beginResumeNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Suspend an App Service Environment. + * + * Suspend an App Service Environment. + * + * @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. + */ + beginSuspendNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Suspend an App Service Environment. + * + * Suspend an App Service Environment. + * + * @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 {WebAppCollection} - 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. + * + * {WebAppCollection} [result] - The deserialized result object if an error did not occur. + * See {@link WebAppCollection} 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. + */ + beginSuspendNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginSuspendNext(nextPageLink: string, callback: ServiceCallback): void; + beginSuspendNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + +/** + * @class + * AppServicePlans + * __NOTE__: An instance of this class is automatically created for an + * instance of the WebSiteManagementClient. + */ +export interface AppServicePlans { + + + /** + * @summary Get all App Service plans for a subcription. + * + * Get all App Service plans for a subcription. + * + * @param {object} [options] Optional Parameters. + * + * @param {boolean} [options.detailed] Specify true to return all + * App Service plan properties. The default is false, which + * returns a subset of the properties. + * Retrieval of all properties may increase the API latency. + * + * @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?: { detailed? : boolean, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get all App Service plans for a subcription. + * + * Get all App Service plans for a subcription. + * + * @param {object} [options] Optional Parameters. + * + * @param {boolean} [options.detailed] Specify true to return all + * App Service plan properties. The default is false, which + * returns a subset of the properties. + * Retrieval of all properties may increase the API latency. + * + * @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 {AppServicePlanCollection} - 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. + * + * {AppServicePlanCollection} [result] - The deserialized result object if an error did not occur. + * See {@link AppServicePlanCollection} 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?: { detailed? : boolean, customHeaders? : { [headerName: string]: string; } }): Promise; + list(callback: ServiceCallback): void; + list(options: { detailed? : boolean, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Get all App Service plans in a resource group. + * + * Get all App Service plans in a resource group. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @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. + */ + listByResourceGroupWithHttpOperationResponse(resourceGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get all App Service plans in a resource group. + * + * Get all App Service plans in a resource group. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @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 {AppServicePlanCollection} - 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. + * + * {AppServicePlanCollection} [result] - The deserialized result object if an error did not occur. + * See {@link AppServicePlanCollection} 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. + */ + listByResourceGroup(resourceGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByResourceGroup(resourceGroupName: string, callback: ServiceCallback): void; + listByResourceGroup(resourceGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Get an App Service plan. + * + * Get an App Service plan. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service plan. + * + * @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. + */ + getWithHttpOperationResponse(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get an App Service plan. + * + * Get an App Service plan. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service plan. + * + * @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 {AppServicePlan} - 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. + * + * {AppServicePlan} [result] - The deserialized result object if an error did not occur. + * See {@link AppServicePlan} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + get(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + get(resourceGroupName: string, name: string, callback: ServiceCallback): void; + get(resourceGroupName: string, name: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Creates or updates an App Service Plan. + * + * Creates or updates an App Service Plan. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service plan. + * + * @param {object} appServicePlan Details of the App Service plan. + * + * @param {string} [appServicePlan.workerTierName] Target worker tier assigned + * to the App Service plan. + * + * @param {string} [appServicePlan.adminSiteName] App Service plan + * administration site. + * + * @param {object} [appServicePlan.hostingEnvironmentProfile] Specification for + * the App Service Environment to use for the App Service plan. + * + * @param {string} [appServicePlan.hostingEnvironmentProfile.id] Resource ID of + * the App Service Environment. + * + * @param {boolean} [appServicePlan.perSiteScaling] If true, apps + * assigned to this App Service plan can be scaled independently. + * If false, apps assigned to this App Service plan will scale to + * all instances of the plan. + * + * @param {boolean} [appServicePlan.isSpot] If true, this App + * Service Plan owns spot instances. + * + * @param {date} [appServicePlan.spotExpirationTime] The time when the server + * farm expires. Valid only if it is a spot server farm. + * + * @param {date} [appServicePlan.freeOfferExpirationTime] The time when the + * server farm free offer expires. + * + * @param {boolean} [appServicePlan.reserved] If Linux app service plan + * true, false otherwise. + * + * @param {boolean} [appServicePlan.isXenon] Obsolete: If Hyper-V container app + * service plan true, false otherwise. + * + * @param {boolean} [appServicePlan.hyperV] If Hyper-V container app service + * plan true, false otherwise. + * + * @param {number} [appServicePlan.targetWorkerCount] Scaling worker count. + * + * @param {number} [appServicePlan.targetWorkerSizeId] Scaling worker size ID. + * + * @param {object} [appServicePlan.sku] + * + * @param {string} [appServicePlan.sku.name] Name of the resource SKU. + * + * @param {string} [appServicePlan.sku.tier] Service tier of the resource SKU. + * + * @param {string} [appServicePlan.sku.size] Size specifier of the resource + * SKU. + * + * @param {string} [appServicePlan.sku.family] Family code of the resource SKU. + * + * @param {number} [appServicePlan.sku.capacity] Current number of instances + * assigned to the resource. + * + * @param {object} [appServicePlan.sku.skuCapacity] Min, max, and default scale + * values of the SKU. + * + * @param {number} [appServicePlan.sku.skuCapacity.minimum] Minimum number of + * workers for this App Service plan SKU. + * + * @param {number} [appServicePlan.sku.skuCapacity.maximum] Maximum number of + * workers for this App Service plan SKU. + * + * @param {number} [appServicePlan.sku.skuCapacity.default] Default number of + * workers for this App Service plan SKU. + * + * @param {string} [appServicePlan.sku.skuCapacity.scaleType] Available scale + * configurations for an App Service plan. + * + * @param {array} [appServicePlan.sku.locations] Locations of the SKU. + * + * @param {array} [appServicePlan.sku.capabilities] Capabilities of the SKU, + * e.g., is traffic manager enabled? + * + * @param {string} [appServicePlan.kind] Kind of resource. + * + * @param {string} appServicePlan.location Resource Location. + * + * @param {object} [appServicePlan.tags] Resource tags. + * + * @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. + */ + createOrUpdateWithHttpOperationResponse(resourceGroupName: string, name: string, appServicePlan: models.AppServicePlan, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Creates or updates an App Service Plan. + * + * Creates or updates an App Service Plan. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service plan. + * + * @param {object} appServicePlan Details of the App Service plan. + * + * @param {string} [appServicePlan.workerTierName] Target worker tier assigned + * to the App Service plan. + * + * @param {string} [appServicePlan.adminSiteName] App Service plan + * administration site. + * + * @param {object} [appServicePlan.hostingEnvironmentProfile] Specification for + * the App Service Environment to use for the App Service plan. + * + * @param {string} [appServicePlan.hostingEnvironmentProfile.id] Resource ID of + * the App Service Environment. + * + * @param {boolean} [appServicePlan.perSiteScaling] If true, apps + * assigned to this App Service plan can be scaled independently. + * If false, apps assigned to this App Service plan will scale to + * all instances of the plan. + * + * @param {boolean} [appServicePlan.isSpot] If true, this App + * Service Plan owns spot instances. + * + * @param {date} [appServicePlan.spotExpirationTime] The time when the server + * farm expires. Valid only if it is a spot server farm. + * + * @param {date} [appServicePlan.freeOfferExpirationTime] The time when the + * server farm free offer expires. + * + * @param {boolean} [appServicePlan.reserved] If Linux app service plan + * true, false otherwise. + * + * @param {boolean} [appServicePlan.isXenon] Obsolete: If Hyper-V container app + * service plan true, false otherwise. + * + * @param {boolean} [appServicePlan.hyperV] If Hyper-V container app service + * plan true, false otherwise. + * + * @param {number} [appServicePlan.targetWorkerCount] Scaling worker count. + * + * @param {number} [appServicePlan.targetWorkerSizeId] Scaling worker size ID. + * + * @param {object} [appServicePlan.sku] + * + * @param {string} [appServicePlan.sku.name] Name of the resource SKU. + * + * @param {string} [appServicePlan.sku.tier] Service tier of the resource SKU. + * + * @param {string} [appServicePlan.sku.size] Size specifier of the resource + * SKU. + * + * @param {string} [appServicePlan.sku.family] Family code of the resource SKU. + * + * @param {number} [appServicePlan.sku.capacity] Current number of instances + * assigned to the resource. + * + * @param {object} [appServicePlan.sku.skuCapacity] Min, max, and default scale + * values of the SKU. + * + * @param {number} [appServicePlan.sku.skuCapacity.minimum] Minimum number of + * workers for this App Service plan SKU. + * + * @param {number} [appServicePlan.sku.skuCapacity.maximum] Maximum number of + * workers for this App Service plan SKU. + * + * @param {number} [appServicePlan.sku.skuCapacity.default] Default number of + * workers for this App Service plan SKU. + * + * @param {string} [appServicePlan.sku.skuCapacity.scaleType] Available scale + * configurations for an App Service plan. + * + * @param {array} [appServicePlan.sku.locations] Locations of the SKU. + * + * @param {array} [appServicePlan.sku.capabilities] Capabilities of the SKU, + * e.g., is traffic manager enabled? + * + * @param {string} [appServicePlan.kind] Kind of resource. + * + * @param {string} appServicePlan.location Resource Location. + * + * @param {object} [appServicePlan.tags] Resource tags. + * + * @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 {AppServicePlan} - 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. + * + * {AppServicePlan} [result] - The deserialized result object if an error did not occur. + * See {@link AppServicePlan} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + createOrUpdate(resourceGroupName: string, name: string, appServicePlan: models.AppServicePlan, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdate(resourceGroupName: string, name: string, appServicePlan: models.AppServicePlan, callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, name: string, appServicePlan: models.AppServicePlan, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Delete an App Service plan. + * + * Delete an App Service plan. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service plan. + * + * @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. + */ + deleteMethodWithHttpOperationResponse(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Delete an App Service plan. + * + * Delete an App Service plan. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service plan. + * + * @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 {null} - 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. + * + * {null} [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. + */ + deleteMethod(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteMethod(resourceGroupName: string, name: string, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, name: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Creates or updates an App Service Plan. + * + * Creates or updates an App Service Plan. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service plan. + * + * @param {object} appServicePlan Details of the App Service plan. + * + * @param {string} [appServicePlan.workerTierName] Target worker tier assigned + * to the App Service plan. + * + * @param {string} [appServicePlan.adminSiteName] App Service plan + * administration site. + * + * @param {object} [appServicePlan.hostingEnvironmentProfile] Specification for + * the App Service Environment to use for the App Service plan. + * + * @param {string} [appServicePlan.hostingEnvironmentProfile.id] Resource ID of + * the App Service Environment. + * + * @param {boolean} [appServicePlan.perSiteScaling] If true, apps + * assigned to this App Service plan can be scaled independently. + * If false, apps assigned to this App Service plan will scale to + * all instances of the plan. + * + * @param {boolean} [appServicePlan.isSpot] If true, this App + * Service Plan owns spot instances. + * + * @param {date} [appServicePlan.spotExpirationTime] The time when the server + * farm expires. Valid only if it is a spot server farm. + * + * @param {date} [appServicePlan.freeOfferExpirationTime] The time when the + * server farm free offer expires. + * + * @param {boolean} [appServicePlan.reserved] If Linux app service plan + * true, false otherwise. + * + * @param {boolean} [appServicePlan.isXenon] Obsolete: If Hyper-V container app + * service plan true, false otherwise. + * + * @param {boolean} [appServicePlan.hyperV] If Hyper-V container app service + * plan true, false otherwise. + * + * @param {number} [appServicePlan.targetWorkerCount] Scaling worker count. + * + * @param {number} [appServicePlan.targetWorkerSizeId] Scaling worker size ID. + * + * @param {string} [appServicePlan.kind] Kind of resource. + * + * @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. + */ + updateWithHttpOperationResponse(resourceGroupName: string, name: string, appServicePlan: models.AppServicePlanPatchResource, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Creates or updates an App Service Plan. + * + * Creates or updates an App Service Plan. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service plan. + * + * @param {object} appServicePlan Details of the App Service plan. + * + * @param {string} [appServicePlan.workerTierName] Target worker tier assigned + * to the App Service plan. + * + * @param {string} [appServicePlan.adminSiteName] App Service plan + * administration site. + * + * @param {object} [appServicePlan.hostingEnvironmentProfile] Specification for + * the App Service Environment to use for the App Service plan. + * + * @param {string} [appServicePlan.hostingEnvironmentProfile.id] Resource ID of + * the App Service Environment. + * + * @param {boolean} [appServicePlan.perSiteScaling] If true, apps + * assigned to this App Service plan can be scaled independently. + * If false, apps assigned to this App Service plan will scale to + * all instances of the plan. + * + * @param {boolean} [appServicePlan.isSpot] If true, this App + * Service Plan owns spot instances. + * + * @param {date} [appServicePlan.spotExpirationTime] The time when the server + * farm expires. Valid only if it is a spot server farm. + * + * @param {date} [appServicePlan.freeOfferExpirationTime] The time when the + * server farm free offer expires. + * + * @param {boolean} [appServicePlan.reserved] If Linux app service plan + * true, false otherwise. + * + * @param {boolean} [appServicePlan.isXenon] Obsolete: If Hyper-V container app + * service plan true, false otherwise. + * + * @param {boolean} [appServicePlan.hyperV] If Hyper-V container app service + * plan true, false otherwise. + * + * @param {number} [appServicePlan.targetWorkerCount] Scaling worker count. + * + * @param {number} [appServicePlan.targetWorkerSizeId] Scaling worker size ID. + * + * @param {string} [appServicePlan.kind] Kind of resource. + * + * @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 {AppServicePlan} - 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. + * + * {AppServicePlan} [result] - The deserialized result object if an error did not occur. + * See {@link AppServicePlan} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + update(resourceGroupName: string, name: string, appServicePlan: models.AppServicePlanPatchResource, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + update(resourceGroupName: string, name: string, appServicePlan: models.AppServicePlanPatchResource, callback: ServiceCallback): void; + update(resourceGroupName: string, name: string, appServicePlan: models.AppServicePlanPatchResource, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary List all capabilities of an App Service plan. + * + * List all capabilities of an App Service plan. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service plan. + * + * @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. + */ + listCapabilitiesWithHttpOperationResponse(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary List all capabilities of an App Service plan. + * + * List all capabilities of an App Service plan. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service plan. + * + * @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. + */ + listCapabilities(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listCapabilities(resourceGroupName: string, name: string, callback: ServiceCallback): void; + listCapabilities(resourceGroupName: string, name: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Retrieve a Hybrid Connection in use in an App Service plan. + * + * Retrieve a Hybrid Connection in use in an App Service plan. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service plan. + * + * @param {string} namespaceName Name of the Service Bus namespace. + * + * @param {string} relayName Name of the Service Bus relay. + * + * @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. + */ + getHybridConnectionWithHttpOperationResponse(resourceGroupName: string, name: string, namespaceName: string, relayName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Retrieve a Hybrid Connection in use in an App Service plan. + * + * Retrieve a Hybrid Connection in use in an App Service plan. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service plan. + * + * @param {string} namespaceName Name of the Service Bus namespace. + * + * @param {string} relayName Name of the Service Bus relay. + * + * @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 {HybridConnection} - 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. + * + * {HybridConnection} [result] - The deserialized result object if an error did not occur. + * See {@link HybridConnection} 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. + */ + getHybridConnection(resourceGroupName: string, name: string, namespaceName: string, relayName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getHybridConnection(resourceGroupName: string, name: string, namespaceName: string, relayName: string, callback: ServiceCallback): void; + getHybridConnection(resourceGroupName: string, name: string, namespaceName: string, relayName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Delete a Hybrid Connection in use in an App Service plan. + * + * Delete a Hybrid Connection in use in an App Service plan. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service plan. + * + * @param {string} namespaceName Name of the Service Bus namespace. + * + * @param {string} relayName Name of the Service Bus relay. + * + * @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. + */ + deleteHybridConnectionWithHttpOperationResponse(resourceGroupName: string, name: string, namespaceName: string, relayName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Delete a Hybrid Connection in use in an App Service plan. + * + * Delete a Hybrid Connection in use in an App Service plan. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service plan. + * + * @param {string} namespaceName Name of the Service Bus namespace. + * + * @param {string} relayName Name of the Service Bus relay. + * + * @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 {null} - 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. + * + * {null} [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. + */ + deleteHybridConnection(resourceGroupName: string, name: string, namespaceName: string, relayName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteHybridConnection(resourceGroupName: string, name: string, namespaceName: string, relayName: string, callback: ServiceCallback): void; + deleteHybridConnection(resourceGroupName: string, name: string, namespaceName: string, relayName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Get the send key name and value of a Hybrid Connection. + * + * Get the send key name and value of a Hybrid Connection. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service plan. + * + * @param {string} namespaceName The name of the Service Bus namespace. + * + * @param {string} relayName The name of the Service Bus relay. + * + * @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. + */ + listHybridConnectionKeysWithHttpOperationResponse(resourceGroupName: string, name: string, namespaceName: string, relayName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get the send key name and value of a Hybrid Connection. + * + * Get the send key name and value of a Hybrid Connection. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service plan. + * + * @param {string} namespaceName The name of the Service Bus namespace. + * + * @param {string} relayName The name of the Service Bus relay. + * + * @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 {HybridConnectionKey} - 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. + * + * {HybridConnectionKey} [result] - The deserialized result object if an error did not occur. + * See {@link HybridConnectionKey} 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. + */ + listHybridConnectionKeys(resourceGroupName: string, name: string, namespaceName: string, relayName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listHybridConnectionKeys(resourceGroupName: string, name: string, namespaceName: string, relayName: string, callback: ServiceCallback): void; + listHybridConnectionKeys(resourceGroupName: string, name: string, namespaceName: string, relayName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Get all apps that use a Hybrid Connection in an App Service Plan. + * + * Get all apps that use a Hybrid Connection in an App Service Plan. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service plan. + * + * @param {string} namespaceName Name of the Hybrid Connection namespace. + * + * @param {string} relayName Name of the Hybrid Connection relay. + * + * @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. + */ + listWebAppsByHybridConnectionWithHttpOperationResponse(resourceGroupName: string, name: string, namespaceName: string, relayName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get all apps that use a Hybrid Connection in an App Service Plan. + * + * Get all apps that use a Hybrid Connection in an App Service Plan. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service plan. + * + * @param {string} namespaceName Name of the Hybrid Connection namespace. + * + * @param {string} relayName Name of the Hybrid Connection relay. + * + * @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 {ResourceCollection} - 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. + * + * {ResourceCollection} [result] - The deserialized result object if an error did not occur. + * See {@link ResourceCollection} 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. + */ + listWebAppsByHybridConnection(resourceGroupName: string, name: string, namespaceName: string, relayName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listWebAppsByHybridConnection(resourceGroupName: string, name: string, namespaceName: string, relayName: string, callback: ServiceCallback): void; + listWebAppsByHybridConnection(resourceGroupName: string, name: string, namespaceName: string, relayName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Get the maximum number of Hybrid Connections allowed in an App + * Service plan. + * + * Get the maximum number of Hybrid Connections allowed in an App Service plan. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service plan. + * + * @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. + */ + getHybridConnectionPlanLimitWithHttpOperationResponse(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get the maximum number of Hybrid Connections allowed in an App + * Service plan. + * + * Get the maximum number of Hybrid Connections allowed in an App Service plan. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service plan. + * + * @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 {HybridConnectionLimits} - 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. + * + * {HybridConnectionLimits} [result] - The deserialized result object if an error did not occur. + * See {@link HybridConnectionLimits} 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. + */ + getHybridConnectionPlanLimit(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getHybridConnectionPlanLimit(resourceGroupName: string, name: string, callback: ServiceCallback): void; + getHybridConnectionPlanLimit(resourceGroupName: string, name: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Retrieve all Hybrid Connections in use in an App Service plan. + * + * Retrieve all Hybrid Connections in use in an App Service plan. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service plan. + * + * @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. + */ + listHybridConnectionsWithHttpOperationResponse(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Retrieve all Hybrid Connections in use in an App Service plan. + * + * Retrieve all Hybrid Connections in use in an App Service plan. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service plan. + * + * @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 {HybridConnectionCollection} - 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. + * + * {HybridConnectionCollection} [result] - The deserialized result object if an error did not occur. + * See {@link HybridConnectionCollection} 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. + */ + listHybridConnections(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listHybridConnections(resourceGroupName: string, name: string, callback: ServiceCallback): void; + listHybridConnections(resourceGroupName: string, name: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Get metrics that can be queried for an App Service plan, and their + * definitions. + * + * Get metrics that can be queried for an App Service plan, and their + * definitions. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service plan. + * + * @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. + */ + listMetricDefintionsWithHttpOperationResponse(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get metrics that can be queried for an App Service plan, and their + * definitions. + * + * Get metrics that can be queried for an App Service plan, and their + * definitions. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service plan. + * + * @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 {ResourceMetricDefinitionCollection} - 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. + * + * {ResourceMetricDefinitionCollection} [result] - The deserialized result object if an error did not occur. + * See {@link ResourceMetricDefinitionCollection} 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. + */ + listMetricDefintions(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listMetricDefintions(resourceGroupName: string, name: string, callback: ServiceCallback): void; + listMetricDefintions(resourceGroupName: string, name: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Get metrics for an App Serice plan. + * + * Get metrics for an App Serice plan. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service plan. + * + * @param {object} [options] Optional Parameters. + * + * @param {boolean} [options.details] Specify true to include + * instance details. The default is false. + * + * @param {string} [options.filter] Return only usages/metrics specified in the + * filter. Filter conforms to odata syntax. Example: $filter=(name.value eq + * 'Metric1' or name.value eq 'Metric2') and startTime eq 2014-01-01T00:00:00Z + * and endTime eq 2014-12-31T23:59:59Z and timeGrain eq + * duration'[Hour|Minute|Day]'. + * + * @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. + */ + listMetricsWithHttpOperationResponse(resourceGroupName: string, name: string, options?: { details? : boolean, filter? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get metrics for an App Serice plan. + * + * Get metrics for an App Serice plan. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service plan. + * + * @param {object} [options] Optional Parameters. + * + * @param {boolean} [options.details] Specify true to include + * instance details. The default is false. + * + * @param {string} [options.filter] Return only usages/metrics specified in the + * filter. Filter conforms to odata syntax. Example: $filter=(name.value eq + * 'Metric1' or name.value eq 'Metric2') and startTime eq 2014-01-01T00:00:00Z + * and endTime eq 2014-12-31T23:59:59Z and timeGrain eq + * duration'[Hour|Minute|Day]'. + * + * @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 {ResourceMetricCollection} - 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. + * + * {ResourceMetricCollection} [result] - The deserialized result object if an error did not occur. + * See {@link ResourceMetricCollection} 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. + */ + listMetrics(resourceGroupName: string, name: string, options?: { details? : boolean, filter? : string, customHeaders? : { [headerName: string]: string; } }): Promise; + listMetrics(resourceGroupName: string, name: string, callback: ServiceCallback): void; + listMetrics(resourceGroupName: string, name: string, options: { details? : boolean, filter? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Restart all apps in an App Service plan. + * + * Restart all apps in an App Service plan. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service plan. + * + * @param {object} [options] Optional Parameters. + * + * @param {boolean} [options.softRestart] Specify true to performa + * a soft restart, applies the configuration settings and restarts the apps if + * necessary. The default is false, which always restarts and + * reprovisions the apps + * + * @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. + */ + restartWebAppsWithHttpOperationResponse(resourceGroupName: string, name: string, options?: { softRestart? : boolean, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Restart all apps in an App Service plan. + * + * Restart all apps in an App Service plan. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service plan. + * + * @param {object} [options] Optional Parameters. + * + * @param {boolean} [options.softRestart] Specify true to performa + * a soft restart, applies the configuration settings and restarts the apps if + * necessary. The default is false, which always restarts and + * reprovisions the apps + * + * @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 {null} - 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. + * + * {null} [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. + */ + restartWebApps(resourceGroupName: string, name: string, options?: { softRestart? : boolean, customHeaders? : { [headerName: string]: string; } }): Promise; + restartWebApps(resourceGroupName: string, name: string, callback: ServiceCallback): void; + restartWebApps(resourceGroupName: string, name: string, options: { softRestart? : boolean, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Get all apps associated with an App Service plan. + * + * Get all apps associated with an App Service plan. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service plan. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.skipToken] Skip to a web app in the list of webapps + * associated with app service plan. If specified, the resulting list will + * contain web apps starting from (including) the skipToken. Otherwise, the + * resulting list contains web apps from the start of the list + * + * @param {string} [options.filter] Supported filter: $filter=state eq running. + * Returns only web apps that are currently running + * + * @param {string} [options.top] List page size. If specified, results are + * paged. + * + * @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. + */ + listWebAppsWithHttpOperationResponse(resourceGroupName: string, name: string, options?: { skipToken? : string, filter? : string, top? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get all apps associated with an App Service plan. + * + * Get all apps associated with an App Service plan. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service plan. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.skipToken] Skip to a web app in the list of webapps + * associated with app service plan. If specified, the resulting list will + * contain web apps starting from (including) the skipToken. Otherwise, the + * resulting list contains web apps from the start of the list + * + * @param {string} [options.filter] Supported filter: $filter=state eq running. + * Returns only web apps that are currently running + * + * @param {string} [options.top] List page size. If specified, results are + * paged. + * + * @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 {WebAppCollection} - 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. + * + * {WebAppCollection} [result] - The deserialized result object if an error did not occur. + * See {@link WebAppCollection} 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. + */ + listWebApps(resourceGroupName: string, name: string, options?: { skipToken? : string, filter? : string, top? : string, customHeaders? : { [headerName: string]: string; } }): Promise; + listWebApps(resourceGroupName: string, name: string, callback: ServiceCallback): void; + listWebApps(resourceGroupName: string, name: string, options: { skipToken? : string, filter? : string, top? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Gets all selectable sku's for a given App Service Plan + * + * Gets all selectable sku's for a given App Service Plan + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of App Service Plan + * + * @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. + */ + getServerFarmSkusWithHttpOperationResponse(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets all selectable sku's for a given App Service Plan + * + * Gets all selectable sku's for a given App Service Plan + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of App Service Plan + * + * @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 {Object} - 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. + * + * {Object} [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. + */ + getServerFarmSkus(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getServerFarmSkus(resourceGroupName: string, name: string, callback: ServiceCallback): void; + getServerFarmSkus(resourceGroupName: string, name: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Gets server farm usage information + * + * Gets server farm usage information + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of App Service Plan + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.filter] Return only usages/metrics specified in the + * filter. Filter conforms to odata syntax. Example: $filter=(name.value eq + * 'Metric1' or name.value eq 'Metric2'). + * + * @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. + */ + listUsagesWithHttpOperationResponse(resourceGroupName: string, name: string, options?: { filter? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets server farm usage information + * + * Gets server farm usage information + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of App Service Plan + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.filter] Return only usages/metrics specified in the + * filter. Filter conforms to odata syntax. Example: $filter=(name.value eq + * 'Metric1' or name.value eq 'Metric2'). + * + * @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 {CsmUsageQuotaCollection} - 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. + * + * {CsmUsageQuotaCollection} [result] - The deserialized result object if an error did not occur. + * See {@link CsmUsageQuotaCollection} 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. + */ + listUsages(resourceGroupName: string, name: string, options?: { filter? : string, customHeaders? : { [headerName: string]: string; } }): Promise; + listUsages(resourceGroupName: string, name: string, callback: ServiceCallback): void; + listUsages(resourceGroupName: string, name: string, options: { filter? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Get all Virtual Networks associated with an App Service plan. + * + * Get all Virtual Networks associated with an App Service plan. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service plan. + * + * @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. + */ + listVnetsWithHttpOperationResponse(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get all Virtual Networks associated with an App Service plan. + * + * Get all Virtual Networks associated with an App Service plan. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service plan. + * + * @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. + */ + listVnets(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listVnets(resourceGroupName: string, name: string, callback: ServiceCallback): void; + listVnets(resourceGroupName: string, name: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Get a Virtual Network associated with an App Service plan. + * + * Get a Virtual Network associated with an App Service plan. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service plan. + * + * @param {string} vnetName Name of the Virtual Network. + * + * @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. + */ + getVnetFromServerFarmWithHttpOperationResponse(resourceGroupName: string, name: string, vnetName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get a Virtual Network associated with an App Service plan. + * + * Get a Virtual Network associated with an App Service plan. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service plan. + * + * @param {string} vnetName Name of the Virtual Network. + * + * @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 {VnetInfo} - 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. + * + * {VnetInfo} [result] - The deserialized result object if an error did not occur. + * See {@link VnetInfo} 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. + */ + getVnetFromServerFarm(resourceGroupName: string, name: string, vnetName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getVnetFromServerFarm(resourceGroupName: string, name: string, vnetName: string, callback: ServiceCallback): void; + getVnetFromServerFarm(resourceGroupName: string, name: string, vnetName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Get a Virtual Network gateway. + * + * Get a Virtual Network gateway. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service plan. + * + * @param {string} vnetName Name of the Virtual Network. + * + * @param {string} gatewayName Name of the gateway. Only the 'primary' gateway + * is supported. + * + * @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. + */ + getVnetGatewayWithHttpOperationResponse(resourceGroupName: string, name: string, vnetName: string, gatewayName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get a Virtual Network gateway. + * + * Get a Virtual Network gateway. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service plan. + * + * @param {string} vnetName Name of the Virtual Network. + * + * @param {string} gatewayName Name of the gateway. Only the 'primary' gateway + * is supported. + * + * @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 {VnetGateway} - 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. + * + * {VnetGateway} [result] - The deserialized result object if an error did not occur. + * See {@link VnetGateway} 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. + */ + getVnetGateway(resourceGroupName: string, name: string, vnetName: string, gatewayName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getVnetGateway(resourceGroupName: string, name: string, vnetName: string, gatewayName: string, callback: ServiceCallback): void; + getVnetGateway(resourceGroupName: string, name: string, vnetName: string, gatewayName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Update a Virtual Network gateway. + * + * Update a Virtual Network gateway. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service plan. + * + * @param {string} vnetName Name of the Virtual Network. + * + * @param {string} gatewayName Name of the gateway. Only the 'primary' gateway + * is supported. + * + * @param {object} connectionEnvelope Definition of the gateway. + * + * @param {string} [connectionEnvelope.vnetName] The Virtual Network name. + * + * @param {string} connectionEnvelope.vpnPackageUri The URI where the VPN + * package can be downloaded. + * + * @param {string} [connectionEnvelope.kind] Kind of resource. + * + * @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. + */ + updateVnetGatewayWithHttpOperationResponse(resourceGroupName: string, name: string, vnetName: string, gatewayName: string, connectionEnvelope: models.VnetGateway, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Update a Virtual Network gateway. + * + * Update a Virtual Network gateway. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service plan. + * + * @param {string} vnetName Name of the Virtual Network. + * + * @param {string} gatewayName Name of the gateway. Only the 'primary' gateway + * is supported. + * + * @param {object} connectionEnvelope Definition of the gateway. + * + * @param {string} [connectionEnvelope.vnetName] The Virtual Network name. + * + * @param {string} connectionEnvelope.vpnPackageUri The URI where the VPN + * package can be downloaded. + * + * @param {string} [connectionEnvelope.kind] Kind of resource. + * + * @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 {VnetGateway} - 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. + * + * {VnetGateway} [result] - The deserialized result object if an error did not occur. + * See {@link VnetGateway} 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. + */ + updateVnetGateway(resourceGroupName: string, name: string, vnetName: string, gatewayName: string, connectionEnvelope: models.VnetGateway, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + updateVnetGateway(resourceGroupName: string, name: string, vnetName: string, gatewayName: string, connectionEnvelope: models.VnetGateway, callback: ServiceCallback): void; + updateVnetGateway(resourceGroupName: string, name: string, vnetName: string, gatewayName: string, connectionEnvelope: models.VnetGateway, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Get all routes that are associated with a Virtual Network in an App + * Service plan. + * + * Get all routes that are associated with a Virtual Network in an App Service + * plan. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service plan. + * + * @param {string} vnetName Name of the Virtual Network. + * + * @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. + */ + listRoutesForVnetWithHttpOperationResponse(resourceGroupName: string, name: string, vnetName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get all routes that are associated with a Virtual Network in an App + * Service plan. + * + * Get all routes that are associated with a Virtual Network in an App Service + * plan. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service plan. + * + * @param {string} vnetName Name of the Virtual Network. + * + * @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. + */ + listRoutesForVnet(resourceGroupName: string, name: string, vnetName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listRoutesForVnet(resourceGroupName: string, name: string, vnetName: string, callback: ServiceCallback): void; + listRoutesForVnet(resourceGroupName: string, name: string, vnetName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Get a Virtual Network route in an App Service plan. + * + * Get a Virtual Network route in an App Service plan. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service plan. + * + * @param {string} vnetName Name of the Virtual Network. + * + * @param {string} routeName Name of the Virtual Network route. + * + * @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. + */ + getRouteForVnetWithHttpOperationResponse(resourceGroupName: string, name: string, vnetName: string, routeName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get a Virtual Network route in an App Service plan. + * + * Get a Virtual Network route in an App Service plan. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service plan. + * + * @param {string} vnetName Name of the Virtual Network. + * + * @param {string} routeName Name of the Virtual Network route. + * + * @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. + */ + getRouteForVnet(resourceGroupName: string, name: string, vnetName: string, routeName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getRouteForVnet(resourceGroupName: string, name: string, vnetName: string, routeName: string, callback: ServiceCallback): void; + getRouteForVnet(resourceGroupName: string, name: string, vnetName: string, routeName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Create or update a Virtual Network route in an App Service plan. + * + * Create or update a Virtual Network route in an App Service plan. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service plan. + * + * @param {string} vnetName Name of the Virtual Network. + * + * @param {string} routeName Name of the Virtual Network route. + * + * @param {object} route Definition of the Virtual Network route. + * + * @param {string} [route.startAddress] The starting address for this route. + * This may also include a CIDR notation, in which case the end address must + * not be specified. + * + * @param {string} [route.endAddress] The ending address for this route. If the + * start address is specified in CIDR notation, this must be omitted. + * + * @param {string} [route.routeType] The type of route this is: + * DEFAULT - By default, every app has routes to the local address ranges + * specified by RFC1918 + * INHERITED - Routes inherited from the real Virtual Network routes + * STATIC - Static route set on the app only + * + * These values will be used for syncing an app's routes with those from a + * Virtual Network. Possible values include: 'DEFAULT', 'INHERITED', 'STATIC' + * + * @param {string} [route.kind] Kind of resource. + * + * @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. + */ + createOrUpdateVnetRouteWithHttpOperationResponse(resourceGroupName: string, name: string, vnetName: string, routeName: string, route: models.VnetRoute, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Create or update a Virtual Network route in an App Service plan. + * + * Create or update a Virtual Network route in an App Service plan. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service plan. + * + * @param {string} vnetName Name of the Virtual Network. + * + * @param {string} routeName Name of the Virtual Network route. + * + * @param {object} route Definition of the Virtual Network route. + * + * @param {string} [route.startAddress] The starting address for this route. + * This may also include a CIDR notation, in which case the end address must + * not be specified. + * + * @param {string} [route.endAddress] The ending address for this route. If the + * start address is specified in CIDR notation, this must be omitted. + * + * @param {string} [route.routeType] The type of route this is: + * DEFAULT - By default, every app has routes to the local address ranges + * specified by RFC1918 + * INHERITED - Routes inherited from the real Virtual Network routes + * STATIC - Static route set on the app only + * + * These values will be used for syncing an app's routes with those from a + * Virtual Network. Possible values include: 'DEFAULT', 'INHERITED', 'STATIC' + * + * @param {string} [route.kind] Kind of resource. + * + * @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 {VnetRoute} - 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. + * + * {VnetRoute} [result] - The deserialized result object if an error did not occur. + * See {@link VnetRoute} 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. + */ + createOrUpdateVnetRoute(resourceGroupName: string, name: string, vnetName: string, routeName: string, route: models.VnetRoute, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdateVnetRoute(resourceGroupName: string, name: string, vnetName: string, routeName: string, route: models.VnetRoute, callback: ServiceCallback): void; + createOrUpdateVnetRoute(resourceGroupName: string, name: string, vnetName: string, routeName: string, route: models.VnetRoute, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Delete a Virtual Network route in an App Service plan. + * + * Delete a Virtual Network route in an App Service plan. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service plan. + * + * @param {string} vnetName Name of the Virtual Network. + * + * @param {string} routeName Name of the Virtual Network route. + * + * @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. + */ + deleteVnetRouteWithHttpOperationResponse(resourceGroupName: string, name: string, vnetName: string, routeName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Delete a Virtual Network route in an App Service plan. + * + * Delete a Virtual Network route in an App Service plan. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service plan. + * + * @param {string} vnetName Name of the Virtual Network. + * + * @param {string} routeName Name of the Virtual Network route. + * + * @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 {null} - 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. + * + * {null} [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. + */ + deleteVnetRoute(resourceGroupName: string, name: string, vnetName: string, routeName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteVnetRoute(resourceGroupName: string, name: string, vnetName: string, routeName: string, callback: ServiceCallback): void; + deleteVnetRoute(resourceGroupName: string, name: string, vnetName: string, routeName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Create or update a Virtual Network route in an App Service plan. + * + * Create or update a Virtual Network route in an App Service plan. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service plan. + * + * @param {string} vnetName Name of the Virtual Network. + * + * @param {string} routeName Name of the Virtual Network route. + * + * @param {object} route Definition of the Virtual Network route. + * + * @param {string} [route.startAddress] The starting address for this route. + * This may also include a CIDR notation, in which case the end address must + * not be specified. + * + * @param {string} [route.endAddress] The ending address for this route. If the + * start address is specified in CIDR notation, this must be omitted. + * + * @param {string} [route.routeType] The type of route this is: + * DEFAULT - By default, every app has routes to the local address ranges + * specified by RFC1918 + * INHERITED - Routes inherited from the real Virtual Network routes + * STATIC - Static route set on the app only + * + * These values will be used for syncing an app's routes with those from a + * Virtual Network. Possible values include: 'DEFAULT', 'INHERITED', 'STATIC' + * + * @param {string} [route.kind] Kind of resource. + * + * @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. + */ + updateVnetRouteWithHttpOperationResponse(resourceGroupName: string, name: string, vnetName: string, routeName: string, route: models.VnetRoute, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Create or update a Virtual Network route in an App Service plan. + * + * Create or update a Virtual Network route in an App Service plan. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service plan. + * + * @param {string} vnetName Name of the Virtual Network. + * + * @param {string} routeName Name of the Virtual Network route. + * + * @param {object} route Definition of the Virtual Network route. + * + * @param {string} [route.startAddress] The starting address for this route. + * This may also include a CIDR notation, in which case the end address must + * not be specified. + * + * @param {string} [route.endAddress] The ending address for this route. If the + * start address is specified in CIDR notation, this must be omitted. + * + * @param {string} [route.routeType] The type of route this is: + * DEFAULT - By default, every app has routes to the local address ranges + * specified by RFC1918 + * INHERITED - Routes inherited from the real Virtual Network routes + * STATIC - Static route set on the app only + * + * These values will be used for syncing an app's routes with those from a + * Virtual Network. Possible values include: 'DEFAULT', 'INHERITED', 'STATIC' + * + * @param {string} [route.kind] Kind of resource. + * + * @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 {VnetRoute} - 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. + * + * {VnetRoute} [result] - The deserialized result object if an error did not occur. + * See {@link VnetRoute} 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. + */ + updateVnetRoute(resourceGroupName: string, name: string, vnetName: string, routeName: string, route: models.VnetRoute, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + updateVnetRoute(resourceGroupName: string, name: string, vnetName: string, routeName: string, route: models.VnetRoute, callback: ServiceCallback): void; + updateVnetRoute(resourceGroupName: string, name: string, vnetName: string, routeName: string, route: models.VnetRoute, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Reboot a worker machine in an App Service plan. + * + * Reboot a worker machine in an App Service plan. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service plan. + * + * @param {string} workerName Name of worker machine, which typically starts + * with RD. + * + * @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. + */ + rebootWorkerWithHttpOperationResponse(resourceGroupName: string, name: string, workerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Reboot a worker machine in an App Service plan. + * + * Reboot a worker machine in an App Service plan. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service plan. + * + * @param {string} workerName Name of worker machine, which typically starts + * with RD. + * + * @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 {null} - 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. + * + * {null} [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. + */ + rebootWorker(resourceGroupName: string, name: string, workerName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + rebootWorker(resourceGroupName: string, name: string, workerName: string, callback: ServiceCallback): void; + rebootWorker(resourceGroupName: string, name: string, workerName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Creates or updates an App Service Plan. + * + * Creates or updates an App Service Plan. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service plan. + * + * @param {object} appServicePlan Details of the App Service plan. + * + * @param {string} [appServicePlan.workerTierName] Target worker tier assigned + * to the App Service plan. + * + * @param {string} [appServicePlan.adminSiteName] App Service plan + * administration site. + * + * @param {object} [appServicePlan.hostingEnvironmentProfile] Specification for + * the App Service Environment to use for the App Service plan. + * + * @param {string} [appServicePlan.hostingEnvironmentProfile.id] Resource ID of + * the App Service Environment. + * + * @param {boolean} [appServicePlan.perSiteScaling] If true, apps + * assigned to this App Service plan can be scaled independently. + * If false, apps assigned to this App Service plan will scale to + * all instances of the plan. + * + * @param {boolean} [appServicePlan.isSpot] If true, this App + * Service Plan owns spot instances. + * + * @param {date} [appServicePlan.spotExpirationTime] The time when the server + * farm expires. Valid only if it is a spot server farm. + * + * @param {date} [appServicePlan.freeOfferExpirationTime] The time when the + * server farm free offer expires. + * + * @param {boolean} [appServicePlan.reserved] If Linux app service plan + * true, false otherwise. + * + * @param {boolean} [appServicePlan.isXenon] Obsolete: If Hyper-V container app + * service plan true, false otherwise. + * + * @param {boolean} [appServicePlan.hyperV] If Hyper-V container app service + * plan true, false otherwise. + * + * @param {number} [appServicePlan.targetWorkerCount] Scaling worker count. + * + * @param {number} [appServicePlan.targetWorkerSizeId] Scaling worker size ID. + * + * @param {object} [appServicePlan.sku] + * + * @param {string} [appServicePlan.sku.name] Name of the resource SKU. + * + * @param {string} [appServicePlan.sku.tier] Service tier of the resource SKU. + * + * @param {string} [appServicePlan.sku.size] Size specifier of the resource + * SKU. + * + * @param {string} [appServicePlan.sku.family] Family code of the resource SKU. + * + * @param {number} [appServicePlan.sku.capacity] Current number of instances + * assigned to the resource. + * + * @param {object} [appServicePlan.sku.skuCapacity] Min, max, and default scale + * values of the SKU. + * + * @param {number} [appServicePlan.sku.skuCapacity.minimum] Minimum number of + * workers for this App Service plan SKU. + * + * @param {number} [appServicePlan.sku.skuCapacity.maximum] Maximum number of + * workers for this App Service plan SKU. + * + * @param {number} [appServicePlan.sku.skuCapacity.default] Default number of + * workers for this App Service plan SKU. + * + * @param {string} [appServicePlan.sku.skuCapacity.scaleType] Available scale + * configurations for an App Service plan. + * + * @param {array} [appServicePlan.sku.locations] Locations of the SKU. + * + * @param {array} [appServicePlan.sku.capabilities] Capabilities of the SKU, + * e.g., is traffic manager enabled? + * + * @param {string} [appServicePlan.kind] Kind of resource. + * + * @param {string} appServicePlan.location Resource Location. + * + * @param {object} [appServicePlan.tags] Resource tags. + * + * @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. + */ + beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, name: string, appServicePlan: models.AppServicePlan, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Creates or updates an App Service Plan. + * + * Creates or updates an App Service Plan. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the App Service plan. + * + * @param {object} appServicePlan Details of the App Service plan. + * + * @param {string} [appServicePlan.workerTierName] Target worker tier assigned + * to the App Service plan. + * + * @param {string} [appServicePlan.adminSiteName] App Service plan + * administration site. + * + * @param {object} [appServicePlan.hostingEnvironmentProfile] Specification for + * the App Service Environment to use for the App Service plan. + * + * @param {string} [appServicePlan.hostingEnvironmentProfile.id] Resource ID of + * the App Service Environment. + * + * @param {boolean} [appServicePlan.perSiteScaling] If true, apps + * assigned to this App Service plan can be scaled independently. + * If false, apps assigned to this App Service plan will scale to + * all instances of the plan. + * + * @param {boolean} [appServicePlan.isSpot] If true, this App + * Service Plan owns spot instances. + * + * @param {date} [appServicePlan.spotExpirationTime] The time when the server + * farm expires. Valid only if it is a spot server farm. + * + * @param {date} [appServicePlan.freeOfferExpirationTime] The time when the + * server farm free offer expires. + * + * @param {boolean} [appServicePlan.reserved] If Linux app service plan + * true, false otherwise. + * + * @param {boolean} [appServicePlan.isXenon] Obsolete: If Hyper-V container app + * service plan true, false otherwise. + * + * @param {boolean} [appServicePlan.hyperV] If Hyper-V container app service + * plan true, false otherwise. + * + * @param {number} [appServicePlan.targetWorkerCount] Scaling worker count. + * + * @param {number} [appServicePlan.targetWorkerSizeId] Scaling worker size ID. + * + * @param {object} [appServicePlan.sku] + * + * @param {string} [appServicePlan.sku.name] Name of the resource SKU. + * + * @param {string} [appServicePlan.sku.tier] Service tier of the resource SKU. + * + * @param {string} [appServicePlan.sku.size] Size specifier of the resource + * SKU. + * + * @param {string} [appServicePlan.sku.family] Family code of the resource SKU. + * + * @param {number} [appServicePlan.sku.capacity] Current number of instances + * assigned to the resource. + * + * @param {object} [appServicePlan.sku.skuCapacity] Min, max, and default scale + * values of the SKU. + * + * @param {number} [appServicePlan.sku.skuCapacity.minimum] Minimum number of + * workers for this App Service plan SKU. + * + * @param {number} [appServicePlan.sku.skuCapacity.maximum] Maximum number of + * workers for this App Service plan SKU. + * + * @param {number} [appServicePlan.sku.skuCapacity.default] Default number of + * workers for this App Service plan SKU. + * + * @param {string} [appServicePlan.sku.skuCapacity.scaleType] Available scale + * configurations for an App Service plan. + * + * @param {array} [appServicePlan.sku.locations] Locations of the SKU. + * + * @param {array} [appServicePlan.sku.capabilities] Capabilities of the SKU, + * e.g., is traffic manager enabled? + * + * @param {string} [appServicePlan.kind] Kind of resource. + * + * @param {string} appServicePlan.location Resource Location. + * + * @param {object} [appServicePlan.tags] Resource tags. + * + * @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 {AppServicePlan} - 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. + * + * {AppServicePlan} [result] - The deserialized result object if an error did not occur. + * See {@link AppServicePlan} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + beginCreateOrUpdate(resourceGroupName: string, name: string, appServicePlan: models.AppServicePlan, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginCreateOrUpdate(resourceGroupName: string, name: string, appServicePlan: models.AppServicePlan, callback: ServiceCallback): void; + beginCreateOrUpdate(resourceGroupName: string, name: string, appServicePlan: models.AppServicePlan, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Get all App Service plans for a subcription. + * + * Get all App Service plans for a subcription. + * + * @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 Get all App Service plans for a subcription. + * + * Get all App Service plans for a subcription. + * + * @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 {AppServicePlanCollection} - 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. + * + * {AppServicePlanCollection} [result] - The deserialized result object if an error did not occur. + * See {@link AppServicePlanCollection} 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; + + + /** + * @summary Get all App Service plans in a resource group. + * + * Get all App Service plans in a resource group. + * + * @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. + */ + listByResourceGroupNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get all App Service plans in a resource group. + * + * Get all App Service plans in a resource group. + * + * @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 {AppServicePlanCollection} - 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. + * + * {AppServicePlanCollection} [result] - The deserialized result object if an error did not occur. + * See {@link AppServicePlanCollection} 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. + */ + listByResourceGroupNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByResourceGroupNext(nextPageLink: string, callback: ServiceCallback): void; + listByResourceGroupNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Get all apps that use a Hybrid Connection in an App Service Plan. + * + * Get all apps that use a Hybrid Connection in an App Service Plan. + * + * @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. + */ + listWebAppsByHybridConnectionNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get all apps that use a Hybrid Connection in an App Service Plan. + * + * Get all apps that use a Hybrid Connection in an App Service Plan. + * + * @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 {ResourceCollection} - 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. + * + * {ResourceCollection} [result] - The deserialized result object if an error did not occur. + * See {@link ResourceCollection} 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. + */ + listWebAppsByHybridConnectionNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listWebAppsByHybridConnectionNext(nextPageLink: string, callback: ServiceCallback): void; + listWebAppsByHybridConnectionNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Retrieve all Hybrid Connections in use in an App Service plan. + * + * Retrieve all Hybrid Connections in use in an App Service plan. + * + * @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. + */ + listHybridConnectionsNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Retrieve all Hybrid Connections in use in an App Service plan. + * + * Retrieve all Hybrid Connections in use in an App Service plan. + * + * @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 {HybridConnectionCollection} - 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. + * + * {HybridConnectionCollection} [result] - The deserialized result object if an error did not occur. + * See {@link HybridConnectionCollection} 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. + */ + listHybridConnectionsNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listHybridConnectionsNext(nextPageLink: string, callback: ServiceCallback): void; + listHybridConnectionsNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Get metrics that can be queried for an App Service plan, and their + * definitions. + * + * Get metrics that can be queried for an App Service plan, and their + * definitions. + * + * @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. + */ + listMetricDefintionsNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get metrics that can be queried for an App Service plan, and their + * definitions. + * + * Get metrics that can be queried for an App Service plan, and their + * definitions. + * + * @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 {ResourceMetricDefinitionCollection} - 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. + * + * {ResourceMetricDefinitionCollection} [result] - The deserialized result object if an error did not occur. + * See {@link ResourceMetricDefinitionCollection} 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. + */ + listMetricDefintionsNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listMetricDefintionsNext(nextPageLink: string, callback: ServiceCallback): void; + listMetricDefintionsNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Get metrics for an App Serice plan. + * + * Get metrics for an App Serice plan. + * + * @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. + */ + listMetricsNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get metrics for an App Serice plan. + * + * Get metrics for an App Serice plan. + * + * @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 {ResourceMetricCollection} - 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. + * + * {ResourceMetricCollection} [result] - The deserialized result object if an error did not occur. + * See {@link ResourceMetricCollection} 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. + */ + listMetricsNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listMetricsNext(nextPageLink: string, callback: ServiceCallback): void; + listMetricsNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Get all apps associated with an App Service plan. + * + * Get all apps associated with an App Service plan. + * + * @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. + */ + listWebAppsNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get all apps associated with an App Service plan. + * + * Get all apps associated with an App Service plan. + * + * @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 {WebAppCollection} - 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. + * + * {WebAppCollection} [result] - The deserialized result object if an error did not occur. + * See {@link WebAppCollection} 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. + */ + listWebAppsNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listWebAppsNext(nextPageLink: string, callback: ServiceCallback): void; + listWebAppsNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Gets server farm usage information + * + * Gets server farm usage information + * + * @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. + */ + listUsagesNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets server farm usage information + * + * Gets server farm usage information + * + * @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 {CsmUsageQuotaCollection} - 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. + * + * {CsmUsageQuotaCollection} [result] - The deserialized result object if an error did not occur. + * See {@link CsmUsageQuotaCollection} 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. + */ + listUsagesNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listUsagesNext(nextPageLink: string, callback: ServiceCallback): void; + listUsagesNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + +/** + * @class + * ResourceHealthMetadataOperations + * __NOTE__: An instance of this class is automatically created for an + * instance of the WebSiteManagementClient. + */ +export interface ResourceHealthMetadataOperations { + + + /** + * @summary List all ResourceHealthMetadata for all sites in the subscription. + * + * List all ResourceHealthMetadata for all sites in the subscription. + * + * @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. + */ + listWithHttpOperationResponse(options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary List all ResourceHealthMetadata for all sites in the subscription. + * + * List all ResourceHealthMetadata for all sites in the subscription. + * + * @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 {ResourceHealthMetadataCollection} - 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. + * + * {ResourceHealthMetadataCollection} [result] - The deserialized result object if an error did not occur. + * See {@link ResourceHealthMetadataCollection} 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?: { customHeaders? : { [headerName: string]: string; } }): Promise; + list(callback: ServiceCallback): void; + list(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary List all ResourceHealthMetadata for all sites in the resource group + * in the subscription. + * + * List all ResourceHealthMetadata for all sites in the resource group in the + * subscription. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @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. + */ + listByResourceGroupWithHttpOperationResponse(resourceGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary List all ResourceHealthMetadata for all sites in the resource group + * in the subscription. + * + * List all ResourceHealthMetadata for all sites in the resource group in the + * subscription. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @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 {ResourceHealthMetadataCollection} - 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. + * + * {ResourceHealthMetadataCollection} [result] - The deserialized result object if an error did not occur. + * See {@link ResourceHealthMetadataCollection} 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. + */ + listByResourceGroup(resourceGroupName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByResourceGroup(resourceGroupName: string, callback: ServiceCallback): void; + listByResourceGroup(resourceGroupName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Gets the category of ResourceHealthMetadata to use for the given + * site as a collection + * + * Gets the category of ResourceHealthMetadata to use for the given site as a + * collection + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @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. + */ + listBySiteWithHttpOperationResponse(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets the category of ResourceHealthMetadata to use for the given + * site as a collection + * + * Gets the category of ResourceHealthMetadata to use for the given site as a + * collection + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @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 {ResourceHealthMetadataCollection} - 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. + * + * {ResourceHealthMetadataCollection} [result] - The deserialized result object if an error did not occur. + * See {@link ResourceHealthMetadataCollection} 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. + */ + listBySite(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listBySite(resourceGroupName: string, name: string, callback: ServiceCallback): void; + listBySite(resourceGroupName: string, name: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Gets the category of ResourceHealthMetadata to use for the given + * site + * + * Gets the category of ResourceHealthMetadata to use for the given site + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app + * + * @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. + */ + getBySiteWithHttpOperationResponse(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets the category of ResourceHealthMetadata to use for the given + * site + * + * Gets the category of ResourceHealthMetadata to use for the given site + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app + * + * @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 {ResourceHealthMetadata} - 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. + * + * {ResourceHealthMetadata} [result] - The deserialized result object if an error did not occur. + * See {@link ResourceHealthMetadata} 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. + */ + getBySite(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getBySite(resourceGroupName: string, name: string, callback: ServiceCallback): void; + getBySite(resourceGroupName: string, name: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Gets the category of ResourceHealthMetadata to use for the given + * site as a collection + * + * Gets the category of ResourceHealthMetadata to use for the given site as a + * collection + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {string} slot Name of web app slot. If not specified then will + * default to production slot. + * + * @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. + */ + listBySiteSlotWithHttpOperationResponse(resourceGroupName: string, name: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets the category of ResourceHealthMetadata to use for the given + * site as a collection + * + * Gets the category of ResourceHealthMetadata to use for the given site as a + * collection + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {string} slot Name of web app slot. If not specified then will + * default to production slot. + * + * @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 {ResourceHealthMetadataCollection} - 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. + * + * {ResourceHealthMetadataCollection} [result] - The deserialized result object if an error did not occur. + * See {@link ResourceHealthMetadataCollection} 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. + */ + listBySiteSlot(resourceGroupName: string, name: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listBySiteSlot(resourceGroupName: string, name: string, slot: string, callback: ServiceCallback): void; + listBySiteSlot(resourceGroupName: string, name: string, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Gets the category of ResourceHealthMetadata to use for the given + * site + * + * Gets the category of ResourceHealthMetadata to use for the given site + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app + * + * @param {string} slot Name of web app slot. If not specified then will + * default to production slot. + * + * @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. + */ + getBySiteSlotWithHttpOperationResponse(resourceGroupName: string, name: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets the category of ResourceHealthMetadata to use for the given + * site + * + * Gets the category of ResourceHealthMetadata to use for the given site + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app + * + * @param {string} slot Name of web app slot. If not specified then will + * default to production slot. + * + * @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 {ResourceHealthMetadata} - 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. + * + * {ResourceHealthMetadata} [result] - The deserialized result object if an error did not occur. + * See {@link ResourceHealthMetadata} 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. + */ + getBySiteSlot(resourceGroupName: string, name: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getBySiteSlot(resourceGroupName: string, name: string, slot: string, callback: ServiceCallback): void; + getBySiteSlot(resourceGroupName: string, name: string, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary List all ResourceHealthMetadata for all sites in the subscription. + * + * List all ResourceHealthMetadata for all sites in the subscription. + * + * @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 List all ResourceHealthMetadata for all sites in the subscription. + * + * List all ResourceHealthMetadata for all sites in the subscription. + * + * @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 {ResourceHealthMetadataCollection} - 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. + * + * {ResourceHealthMetadataCollection} [result] - The deserialized result object if an error did not occur. + * See {@link ResourceHealthMetadataCollection} 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; + + + /** + * @summary List all ResourceHealthMetadata for all sites in the resource group + * in the subscription. + * + * List all ResourceHealthMetadata for all sites in the resource group in the + * subscription. + * + * @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. + */ + listByResourceGroupNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary List all ResourceHealthMetadata for all sites in the resource group + * in the subscription. + * + * List all ResourceHealthMetadata for all sites in the resource group in the + * subscription. + * + * @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 {ResourceHealthMetadataCollection} - 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. + * + * {ResourceHealthMetadataCollection} [result] - The deserialized result object if an error did not occur. + * See {@link ResourceHealthMetadataCollection} 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. + */ + listByResourceGroupNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listByResourceGroupNext(nextPageLink: string, callback: ServiceCallback): void; + listByResourceGroupNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Gets the category of ResourceHealthMetadata to use for the given + * site as a collection + * + * Gets the category of ResourceHealthMetadata to use for the given site as a + * collection + * + * @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. + */ + listBySiteNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets the category of ResourceHealthMetadata to use for the given + * site as a collection + * + * Gets the category of ResourceHealthMetadata to use for the given site as a + * collection + * + * @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 {ResourceHealthMetadataCollection} - 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. + * + * {ResourceHealthMetadataCollection} [result] - The deserialized result object if an error did not occur. + * See {@link ResourceHealthMetadataCollection} 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. + */ + listBySiteNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listBySiteNext(nextPageLink: string, callback: ServiceCallback): void; + listBySiteNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Gets the category of ResourceHealthMetadata to use for the given + * site as a collection + * + * Gets the category of ResourceHealthMetadata to use for the given site as a + * collection + * + * @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. + */ + listBySiteSlotNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets the category of ResourceHealthMetadata to use for the given + * site as a collection + * + * Gets the category of ResourceHealthMetadata to use for the given site as a + * collection + * + * @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 {ResourceHealthMetadataCollection} - 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. + * + * {ResourceHealthMetadataCollection} [result] - The deserialized result object if an error did not occur. + * See {@link ResourceHealthMetadataCollection} 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. + */ + listBySiteSlotNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listBySiteSlotNext(nextPageLink: string, callback: ServiceCallback): void; + listBySiteSlotNext(nextPageLink: string, 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 b0fdef3f0a..395fd6cbd2 100644 --- a/lib/services/websiteManagement2/lib/operations/index.js +++ b/lib/services/websiteManagement2/lib/operations/index.js @@ -27,3 +27,4 @@ exports.Recommendations = require('./recommendations'); exports.WebApps = require('./webApps'); exports.AppServiceEnvironments = require('./appServiceEnvironments'); exports.AppServicePlans = require('./appServicePlans'); +exports.ResourceHealthMetadataOperations = require('./resourceHealthMetadataOperations'); diff --git a/lib/services/websiteManagement2/lib/operations/provider.js b/lib/services/websiteManagement2/lib/operations/provider.js new file mode 100644 index 0000000000..064fc16469 --- /dev/null +++ b/lib/services/websiteManagement2/lib/operations/provider.js @@ -0,0 +1,1391 @@ +/* + * 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 Get available application frameworks and their versions + * + * Get available application frameworks and their versions + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.osTypeSelected] Possible values include: 'Windows', + * 'Linux' + * + * @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 ApplicationStackCollection} 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 _getAvailableStacks(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 osTypeSelected = (options && options.osTypeSelected !== undefined) ? options.osTypeSelected : undefined; + // Validate + try { + if (osTypeSelected !== null && osTypeSelected !== undefined && typeof osTypeSelected.valueOf() !== 'string') { + throw new Error('osTypeSelected must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'providers/Microsoft.Web/availableStacks'; + let queryParameters = []; + if (osTypeSelected !== null && osTypeSelected !== undefined) { + queryParameters.push('osTypeSelected=' + encodeURIComponent(osTypeSelected)); + } + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['ApplicationStackCollection']().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 all available operations for the Microsoft.Web resource + * provider. Also exposes resource metric definitions + * + * Gets all available operations for the Microsoft.Web resource provider. Also + * exposes resource metric definitions + * + * @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 CsmOperationCollection} 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 _listOperations(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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'providers/Microsoft.Web/operations'; + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['CsmOperationCollection']().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 Get available application frameworks and their versions + * + * Get available application frameworks and their versions + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.osTypeSelected] Possible values include: 'Windows', + * 'Linux' + * + * @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 ApplicationStackCollection} 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 _getAvailableStacksOnPrem(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 osTypeSelected = (options && options.osTypeSelected !== undefined) ? options.osTypeSelected : undefined; + // Validate + try { + if (osTypeSelected !== null && osTypeSelected !== undefined && typeof osTypeSelected.valueOf() !== 'string') { + throw new Error('osTypeSelected must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/providers/Microsoft.Web/availableStacks'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + if (osTypeSelected !== null && osTypeSelected !== undefined) { + queryParameters.push('osTypeSelected=' + encodeURIComponent(osTypeSelected)); + } + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['ApplicationStackCollection']().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 Get available application frameworks and their versions + * + * Get available application frameworks and their versions + * + * @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 ApplicationStackCollection} 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 _getAvailableStacksNext(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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['ApplicationStackCollection']().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 all available operations for the Microsoft.Web resource + * provider. Also exposes resource metric definitions + * + * Gets all available operations for the Microsoft.Web resource provider. Also + * exposes resource metric definitions + * + * @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 CsmOperationCollection} 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 _listOperationsNext(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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['CsmOperationCollection']().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 Get available application frameworks and their versions + * + * Get available application frameworks and their versions + * + * @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 ApplicationStackCollection} 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 _getAvailableStacksOnPremNext(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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['ApplicationStackCollection']().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 Provider. */ +class Provider { + /** + * Create a Provider. + * @param {WebSiteManagementClient} client Reference to the service client. + */ + constructor(client) { + this.client = client; + this._getAvailableStacks = _getAvailableStacks; + this._listOperations = _listOperations; + this._getAvailableStacksOnPrem = _getAvailableStacksOnPrem; + this._getAvailableStacksNext = _getAvailableStacksNext; + this._listOperationsNext = _listOperationsNext; + this._getAvailableStacksOnPremNext = _getAvailableStacksOnPremNext; + } + + /** + * @summary Get available application frameworks and their versions + * + * Get available application frameworks and their versions + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.osTypeSelected] Possible values include: 'Windows', + * 'Linux' + * + * @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. + */ + getAvailableStacksWithHttpOperationResponse(options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._getAvailableStacks(options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Get available application frameworks and their versions + * + * Get available application frameworks and their versions + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.osTypeSelected] Possible values include: 'Windows', + * 'Linux' + * + * @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 {ApplicationStackCollection} - 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 ApplicationStackCollection} 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. + */ + getAvailableStacks(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._getAvailableStacks(options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getAvailableStacks(options, optionalCallback); + } + } + + /** + * @summary Gets all available operations for the Microsoft.Web resource + * provider. Also exposes resource metric definitions + * + * Gets all available operations for the Microsoft.Web resource provider. Also + * exposes resource metric definitions + * + * @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. + */ + listOperationsWithHttpOperationResponse(options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listOperations(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 all available operations for the Microsoft.Web resource + * provider. Also exposes resource metric definitions + * + * Gets all available operations for the Microsoft.Web resource provider. Also + * exposes resource metric definitions + * + * @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 {CsmOperationCollection} - 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 CsmOperationCollection} 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. + */ + listOperations(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._listOperations(options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listOperations(options, optionalCallback); + } + } + + /** + * @summary Get available application frameworks and their versions + * + * Get available application frameworks and their versions + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.osTypeSelected] Possible values include: 'Windows', + * 'Linux' + * + * @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. + */ + getAvailableStacksOnPremWithHttpOperationResponse(options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._getAvailableStacksOnPrem(options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Get available application frameworks and their versions + * + * Get available application frameworks and their versions + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.osTypeSelected] Possible values include: 'Windows', + * 'Linux' + * + * @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 {ApplicationStackCollection} - 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 ApplicationStackCollection} 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. + */ + getAvailableStacksOnPrem(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._getAvailableStacksOnPrem(options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getAvailableStacksOnPrem(options, optionalCallback); + } + } + + /** + * @summary Get available application frameworks and their versions + * + * Get available application frameworks and their versions + * + * @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. + */ + getAvailableStacksNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._getAvailableStacksNext(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 Get available application frameworks and their versions + * + * Get available application frameworks and their versions + * + * @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 {ApplicationStackCollection} - 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 ApplicationStackCollection} 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. + */ + getAvailableStacksNext(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._getAvailableStacksNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getAvailableStacksNext(nextPageLink, options, optionalCallback); + } + } + + /** + * @summary Gets all available operations for the Microsoft.Web resource + * provider. Also exposes resource metric definitions + * + * Gets all available operations for the Microsoft.Web resource provider. Also + * exposes resource metric definitions + * + * @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. + */ + listOperationsNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listOperationsNext(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 all available operations for the Microsoft.Web resource + * provider. Also exposes resource metric definitions + * + * Gets all available operations for the Microsoft.Web resource provider. Also + * exposes resource metric definitions + * + * @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 {CsmOperationCollection} - 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 CsmOperationCollection} 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. + */ + listOperationsNext(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._listOperationsNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listOperationsNext(nextPageLink, options, optionalCallback); + } + } + + /** + * @summary Get available application frameworks and their versions + * + * Get available application frameworks and their versions + * + * @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. + */ + getAvailableStacksOnPremNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._getAvailableStacksOnPremNext(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 Get available application frameworks and their versions + * + * Get available application frameworks and their versions + * + * @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 {ApplicationStackCollection} - 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 ApplicationStackCollection} 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. + */ + getAvailableStacksOnPremNext(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._getAvailableStacksOnPremNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getAvailableStacksOnPremNext(nextPageLink, options, optionalCallback); + } + } + +} + +module.exports = Provider; diff --git a/lib/services/websiteManagement2/lib/operations/recommendations.js b/lib/services/websiteManagement2/lib/operations/recommendations.js new file mode 100644 index 0000000000..82dd249fea --- /dev/null +++ b/lib/services/websiteManagement2/lib/operations/recommendations.js @@ -0,0 +1,2988 @@ +/* + * 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 List all recommendations for a subscription. + * + * List all recommendations for a subscription. + * + * @param {object} [options] Optional Parameters. + * + * @param {boolean} [options.featured] Specify true to return only + * the most critical recommendations. The default is false, which + * returns all recommendations. + * + * @param {string} [options.filter] Filter is specified by using OData syntax. + * Example: $filter=channel eq 'Api' or channel eq 'Notification' and startTime + * eq 2014-01-01T00:00:00Z and endTime eq 2014-12-31T23:59:59Z and timeGrain eq + * duration'[PT1H|PT1M|P1D] + * + * @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 RecommendationCollection} 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 featured = (options && options.featured !== undefined) ? options.featured : undefined; + let filter = (options && options.filter !== undefined) ? options.filter : undefined; + // Validate + try { + if (featured !== null && featured !== undefined && typeof featured !== 'boolean') { + throw new Error('featured must be of type boolean.'); + } + if (filter !== null && filter !== undefined && typeof filter.valueOf() !== 'string') { + throw new Error('filter must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/providers/Microsoft.Web/recommendations'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + if (featured !== null && featured !== undefined) { + queryParameters.push('featured=' + encodeURIComponent(featured.toString())); + } + if (filter !== null && filter !== undefined) { + queryParameters.push('$filter=' + filter); + } + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['RecommendationCollection']().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 Reset all recommendation opt-out settings for a subscription. + * + * Reset all recommendation opt-out settings for a subscription. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _resetAllFilters(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 (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/providers/Microsoft.Web/recommendations/reset'; + 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]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 204) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + + return callback(null, result, httpRequest, response); + }); +} + +/** + * @summary Disables the specified rule so it will not apply to a subscription + * in the future. + * + * Disables the specified rule so it will not apply to a subscription in the + * future. + * + * @param {string} name Rule name + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _disableRecommendationForSubscription(name, 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 (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/providers/Microsoft.Web/recommendations/{name}/disable'; + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + 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]; + } + } + } + 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; + + return callback(null, result, httpRequest, response); + }); +} + +/** + * @summary Get past recommendations for an app, optionally specified by the + * time range. + * + * Get past recommendations for an app, optionally specified by the time range. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} siteName Name of the app. + * + * @param {object} [options] Optional Parameters. + * + * @param {boolean} [options.expiredOnly] Specify false to return + * all recommendations. The default is true, which returns only + * expired recommendations. + * + * @param {string} [options.filter] Filter is specified by using OData syntax. + * Example: $filter=channel eq 'Api' or channel eq 'Notification' and startTime + * eq 2014-01-01T00:00:00Z and endTime eq 2014-12-31T23:59:59Z and timeGrain eq + * duration'[PT1H|PT1M|P1D] + * + * @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 RecommendationCollection} 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 _listHistoryForWebApp(resourceGroupName, siteName, 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 expiredOnly = (options && options.expiredOnly !== undefined) ? options.expiredOnly : undefined; + let filter = (options && options.filter !== undefined) ? options.filter : undefined; + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (siteName === null || siteName === undefined || typeof siteName.valueOf() !== 'string') { + throw new Error('siteName cannot be null or undefined and it must be of type string.'); + } + if (expiredOnly !== null && expiredOnly !== undefined && typeof expiredOnly !== 'boolean') { + throw new Error('expiredOnly must be of type boolean.'); + } + if (filter !== null && filter !== undefined && typeof filter.valueOf() !== 'string') { + throw new Error('filter must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/recommendationHistory'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{siteName}', encodeURIComponent(siteName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + if (expiredOnly !== null && expiredOnly !== undefined) { + queryParameters.push('expiredOnly=' + encodeURIComponent(expiredOnly.toString())); + } + if (filter !== null && filter !== undefined) { + queryParameters.push('$filter=' + filter); + } + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['RecommendationCollection']().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 Get all recommendations for an app. + * + * Get all recommendations for an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} siteName Name of the app. + * + * @param {object} [options] Optional Parameters. + * + * @param {boolean} [options.featured] Specify true to return only + * the most critical recommendations. The default is false, which + * returns all recommendations. + * + * @param {string} [options.filter] Return only channels specified in the + * filter. Filter is specified by using OData syntax. Example: $filter=channel + * eq 'Api' or channel eq 'Notification' + * + * @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 RecommendationCollection} 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 _listRecommendedRulesForWebApp(resourceGroupName, siteName, 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 featured = (options && options.featured !== undefined) ? options.featured : undefined; + let filter = (options && options.filter !== undefined) ? options.filter : undefined; + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (siteName === null || siteName === undefined || typeof siteName.valueOf() !== 'string') { + throw new Error('siteName cannot be null or undefined and it must be of type string.'); + } + if (featured !== null && featured !== undefined && typeof featured !== 'boolean') { + throw new Error('featured must be of type boolean.'); + } + if (filter !== null && filter !== undefined && typeof filter.valueOf() !== 'string') { + throw new Error('filter must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/recommendations'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{siteName}', encodeURIComponent(siteName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + if (featured !== null && featured !== undefined) { + queryParameters.push('featured=' + encodeURIComponent(featured.toString())); + } + if (filter !== null && filter !== undefined) { + queryParameters.push('$filter=' + filter); + } + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['RecommendationCollection']().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 Disable all recommendations for an app. + * + * Disable all recommendations for an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} siteName Name of the app. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _disableAllForWebApp(resourceGroupName, siteName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (siteName === null || siteName === undefined || typeof siteName.valueOf() !== 'string') { + throw new Error('siteName cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/recommendations/disable'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{siteName}', encodeURIComponent(siteName)); + 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]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 204) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + + return callback(null, result, httpRequest, response); + }); +} + +/** + * @summary Reset all recommendation opt-out settings for an app. + * + * Reset all recommendation opt-out settings for an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} siteName Name of the app. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _resetAllFiltersForWebApp(resourceGroupName, siteName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (siteName === null || siteName === undefined || typeof siteName.valueOf() !== 'string') { + throw new Error('siteName cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/recommendations/reset'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{siteName}', encodeURIComponent(siteName)); + 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]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 204) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + + return callback(null, result, httpRequest, response); + }); +} + +/** + * @summary Get a recommendation rule for an app. + * + * Get a recommendation rule for an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} siteName Name of the app. + * + * @param {string} name Name of the recommendation. + * + * @param {object} [options] Optional Parameters. + * + * @param {boolean} [options.updateSeen] Specify true to update + * the last-seen timestamp of the recommendation object. + * + * @param {string} [options.recommendationId] The GUID of the recommedation + * object if you query an expired one. You don't need to specify it to query an + * active entry. + * + * @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 RecommendationRule} 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 _getRuleDetailsByWebApp(resourceGroupName, siteName, name, 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 updateSeen = (options && options.updateSeen !== undefined) ? options.updateSeen : undefined; + let recommendationId = (options && options.recommendationId !== undefined) ? options.recommendationId : undefined; + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (siteName === null || siteName === undefined || typeof siteName.valueOf() !== 'string') { + throw new Error('siteName cannot be null or undefined and it must be of type string.'); + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (updateSeen !== null && updateSeen !== undefined && typeof updateSeen !== 'boolean') { + throw new Error('updateSeen must be of type boolean.'); + } + if (recommendationId !== null && recommendationId !== undefined && typeof recommendationId.valueOf() !== 'string') { + throw new Error('recommendationId must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/recommendations/{name}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{siteName}', encodeURIComponent(siteName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + if (updateSeen !== null && updateSeen !== undefined) { + queryParameters.push('updateSeen=' + encodeURIComponent(updateSeen.toString())); + } + if (recommendationId !== null && recommendationId !== undefined) { + queryParameters.push('recommendationId=' + encodeURIComponent(recommendationId)); + } + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['RecommendationRule']().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 Disables the specific rule for a web site permanently. + * + * Disables the specific rule for a web site permanently. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} siteName Site name + * + * @param {string} name Rule name + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _disableRecommendationForSite(resourceGroupName, siteName, name, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (siteName === null || siteName === undefined || typeof siteName.valueOf() !== 'string') { + throw new Error('siteName cannot be null or undefined and it must be of type string.'); + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/recommendations/{name}/disable'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{siteName}', encodeURIComponent(siteName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + 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]; + } + } + } + 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; + + return callback(null, result, httpRequest, response); + }); +} + +/** + * @summary List all recommendations for a subscription. + * + * List all recommendations for a subscription. + * + * @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 RecommendationCollection} 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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['RecommendationCollection']().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 Get past recommendations for an app, optionally specified by the + * time range. + * + * Get past recommendations for an app, optionally specified by the time range. + * + * @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 RecommendationCollection} 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 _listHistoryForWebAppNext(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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['RecommendationCollection']().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 Get all recommendations for an app. + * + * Get all recommendations for an app. + * + * @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 RecommendationCollection} 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 _listRecommendedRulesForWebAppNext(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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['RecommendationCollection']().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 Recommendations. */ +class Recommendations { + /** + * Create a Recommendations. + * @param {WebSiteManagementClient} client Reference to the service client. + */ + constructor(client) { + this.client = client; + this._list = _list; + this._resetAllFilters = _resetAllFilters; + this._disableRecommendationForSubscription = _disableRecommendationForSubscription; + this._listHistoryForWebApp = _listHistoryForWebApp; + this._listRecommendedRulesForWebApp = _listRecommendedRulesForWebApp; + this._disableAllForWebApp = _disableAllForWebApp; + this._resetAllFiltersForWebApp = _resetAllFiltersForWebApp; + this._getRuleDetailsByWebApp = _getRuleDetailsByWebApp; + this._disableRecommendationForSite = _disableRecommendationForSite; + this._listNext = _listNext; + this._listHistoryForWebAppNext = _listHistoryForWebAppNext; + this._listRecommendedRulesForWebAppNext = _listRecommendedRulesForWebAppNext; + } + + /** + * @summary List all recommendations for a subscription. + * + * List all recommendations for a subscription. + * + * @param {object} [options] Optional Parameters. + * + * @param {boolean} [options.featured] Specify true to return only + * the most critical recommendations. The default is false, which + * returns all recommendations. + * + * @param {string} [options.filter] Filter is specified by using OData syntax. + * Example: $filter=channel eq 'Api' or channel eq 'Notification' and startTime + * eq 2014-01-01T00:00:00Z and endTime eq 2014-12-31T23:59:59Z and timeGrain eq + * duration'[PT1H|PT1M|P1D] + * + * @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 List all recommendations for a subscription. + * + * List all recommendations for a subscription. + * + * @param {object} [options] Optional Parameters. + * + * @param {boolean} [options.featured] Specify true to return only + * the most critical recommendations. The default is false, which + * returns all recommendations. + * + * @param {string} [options.filter] Filter is specified by using OData syntax. + * Example: $filter=channel eq 'Api' or channel eq 'Notification' and startTime + * eq 2014-01-01T00:00:00Z and endTime eq 2014-12-31T23:59:59Z and timeGrain eq + * duration'[PT1H|PT1M|P1D] + * + * @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 {RecommendationCollection} - 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 RecommendationCollection} 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 Reset all recommendation opt-out settings for a subscription. + * + * Reset all recommendation opt-out settings for a subscription. + * + * @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. + */ + resetAllFiltersWithHttpOperationResponse(options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._resetAllFilters(options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Reset all recommendation opt-out settings for a subscription. + * + * Reset all recommendation opt-out settings for a subscription. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + resetAllFilters(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._resetAllFilters(options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._resetAllFilters(options, optionalCallback); + } + } + + /** + * @summary Disables the specified rule so it will not apply to a subscription + * in the future. + * + * Disables the specified rule so it will not apply to a subscription in the + * future. + * + * @param {string} name Rule name + * + * @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. + */ + disableRecommendationForSubscriptionWithHttpOperationResponse(name, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._disableRecommendationForSubscription(name, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Disables the specified rule so it will not apply to a subscription + * in the future. + * + * Disables the specified rule so it will not apply to a subscription in the + * future. + * + * @param {string} name Rule name + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + disableRecommendationForSubscription(name, 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._disableRecommendationForSubscription(name, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._disableRecommendationForSubscription(name, options, optionalCallback); + } + } + + /** + * @summary Get past recommendations for an app, optionally specified by the + * time range. + * + * Get past recommendations for an app, optionally specified by the time range. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} siteName Name of the app. + * + * @param {object} [options] Optional Parameters. + * + * @param {boolean} [options.expiredOnly] Specify false to return + * all recommendations. The default is true, which returns only + * expired recommendations. + * + * @param {string} [options.filter] Filter is specified by using OData syntax. + * Example: $filter=channel eq 'Api' or channel eq 'Notification' and startTime + * eq 2014-01-01T00:00:00Z and endTime eq 2014-12-31T23:59:59Z and timeGrain eq + * duration'[PT1H|PT1M|P1D] + * + * @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. + */ + listHistoryForWebAppWithHttpOperationResponse(resourceGroupName, siteName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listHistoryForWebApp(resourceGroupName, siteName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Get past recommendations for an app, optionally specified by the + * time range. + * + * Get past recommendations for an app, optionally specified by the time range. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} siteName Name of the app. + * + * @param {object} [options] Optional Parameters. + * + * @param {boolean} [options.expiredOnly] Specify false to return + * all recommendations. The default is true, which returns only + * expired recommendations. + * + * @param {string} [options.filter] Filter is specified by using OData syntax. + * Example: $filter=channel eq 'Api' or channel eq 'Notification' and startTime + * eq 2014-01-01T00:00:00Z and endTime eq 2014-12-31T23:59:59Z and timeGrain eq + * duration'[PT1H|PT1M|P1D] + * + * @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 {RecommendationCollection} - 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 RecommendationCollection} 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. + */ + listHistoryForWebApp(resourceGroupName, siteName, 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._listHistoryForWebApp(resourceGroupName, siteName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listHistoryForWebApp(resourceGroupName, siteName, options, optionalCallback); + } + } + + /** + * @summary Get all recommendations for an app. + * + * Get all recommendations for an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} siteName Name of the app. + * + * @param {object} [options] Optional Parameters. + * + * @param {boolean} [options.featured] Specify true to return only + * the most critical recommendations. The default is false, which + * returns all recommendations. + * + * @param {string} [options.filter] Return only channels specified in the + * filter. Filter is specified by using OData syntax. Example: $filter=channel + * eq 'Api' or channel eq 'Notification' + * + * @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. + */ + listRecommendedRulesForWebAppWithHttpOperationResponse(resourceGroupName, siteName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listRecommendedRulesForWebApp(resourceGroupName, siteName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Get all recommendations for an app. + * + * Get all recommendations for an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} siteName Name of the app. + * + * @param {object} [options] Optional Parameters. + * + * @param {boolean} [options.featured] Specify true to return only + * the most critical recommendations. The default is false, which + * returns all recommendations. + * + * @param {string} [options.filter] Return only channels specified in the + * filter. Filter is specified by using OData syntax. Example: $filter=channel + * eq 'Api' or channel eq 'Notification' + * + * @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 {RecommendationCollection} - 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 RecommendationCollection} 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. + */ + listRecommendedRulesForWebApp(resourceGroupName, siteName, 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._listRecommendedRulesForWebApp(resourceGroupName, siteName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listRecommendedRulesForWebApp(resourceGroupName, siteName, options, optionalCallback); + } + } + + /** + * @summary Disable all recommendations for an app. + * + * Disable all recommendations for an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} siteName Name of the app. + * + * @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. + */ + disableAllForWebAppWithHttpOperationResponse(resourceGroupName, siteName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._disableAllForWebApp(resourceGroupName, siteName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Disable all recommendations for an app. + * + * Disable all recommendations for an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} siteName Name of the app. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + disableAllForWebApp(resourceGroupName, siteName, 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._disableAllForWebApp(resourceGroupName, siteName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._disableAllForWebApp(resourceGroupName, siteName, options, optionalCallback); + } + } + + /** + * @summary Reset all recommendation opt-out settings for an app. + * + * Reset all recommendation opt-out settings for an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} siteName Name of the app. + * + * @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. + */ + resetAllFiltersForWebAppWithHttpOperationResponse(resourceGroupName, siteName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._resetAllFiltersForWebApp(resourceGroupName, siteName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Reset all recommendation opt-out settings for an app. + * + * Reset all recommendation opt-out settings for an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} siteName Name of the app. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + resetAllFiltersForWebApp(resourceGroupName, siteName, 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._resetAllFiltersForWebApp(resourceGroupName, siteName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._resetAllFiltersForWebApp(resourceGroupName, siteName, options, optionalCallback); + } + } + + /** + * @summary Get a recommendation rule for an app. + * + * Get a recommendation rule for an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} siteName Name of the app. + * + * @param {string} name Name of the recommendation. + * + * @param {object} [options] Optional Parameters. + * + * @param {boolean} [options.updateSeen] Specify true to update + * the last-seen timestamp of the recommendation object. + * + * @param {string} [options.recommendationId] The GUID of the recommedation + * object if you query an expired one. You don't need to specify it to query an + * active entry. + * + * @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. + */ + getRuleDetailsByWebAppWithHttpOperationResponse(resourceGroupName, siteName, name, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._getRuleDetailsByWebApp(resourceGroupName, siteName, name, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Get a recommendation rule for an app. + * + * Get a recommendation rule for an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} siteName Name of the app. + * + * @param {string} name Name of the recommendation. + * + * @param {object} [options] Optional Parameters. + * + * @param {boolean} [options.updateSeen] Specify true to update + * the last-seen timestamp of the recommendation object. + * + * @param {string} [options.recommendationId] The GUID of the recommedation + * object if you query an expired one. You don't need to specify it to query an + * active entry. + * + * @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 {RecommendationRule} - 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 RecommendationRule} 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. + */ + getRuleDetailsByWebApp(resourceGroupName, siteName, name, 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._getRuleDetailsByWebApp(resourceGroupName, siteName, name, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getRuleDetailsByWebApp(resourceGroupName, siteName, name, options, optionalCallback); + } + } + + /** + * @summary Disables the specific rule for a web site permanently. + * + * Disables the specific rule for a web site permanently. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} siteName Site name + * + * @param {string} name Rule name + * + * @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. + */ + disableRecommendationForSiteWithHttpOperationResponse(resourceGroupName, siteName, name, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._disableRecommendationForSite(resourceGroupName, siteName, name, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Disables the specific rule for a web site permanently. + * + * Disables the specific rule for a web site permanently. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} siteName Site name + * + * @param {string} name Rule name + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + disableRecommendationForSite(resourceGroupName, siteName, name, 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._disableRecommendationForSite(resourceGroupName, siteName, name, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._disableRecommendationForSite(resourceGroupName, siteName, name, options, optionalCallback); + } + } + + /** + * @summary List all recommendations for a subscription. + * + * List all recommendations for a subscription. + * + * @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 List all recommendations for a subscription. + * + * List all recommendations for a subscription. + * + * @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 {RecommendationCollection} - 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 RecommendationCollection} 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); + } + } + + /** + * @summary Get past recommendations for an app, optionally specified by the + * time range. + * + * Get past recommendations for an app, optionally specified by the time range. + * + * @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. + */ + listHistoryForWebAppNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listHistoryForWebAppNext(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 Get past recommendations for an app, optionally specified by the + * time range. + * + * Get past recommendations for an app, optionally specified by the time range. + * + * @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 {RecommendationCollection} - 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 RecommendationCollection} 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. + */ + listHistoryForWebAppNext(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._listHistoryForWebAppNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listHistoryForWebAppNext(nextPageLink, options, optionalCallback); + } + } + + /** + * @summary Get all recommendations for an app. + * + * Get all recommendations for an app. + * + * @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. + */ + listRecommendedRulesForWebAppNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listRecommendedRulesForWebAppNext(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 Get all recommendations for an app. + * + * Get all recommendations for an app. + * + * @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 {RecommendationCollection} - 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 RecommendationCollection} 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. + */ + listRecommendedRulesForWebAppNext(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._listRecommendedRulesForWebAppNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listRecommendedRulesForWebAppNext(nextPageLink, options, optionalCallback); + } + } + +} + +module.exports = Recommendations; diff --git a/lib/services/websiteManagement2/lib/operations/resourceHealthMetadataOperations.js b/lib/services/websiteManagement2/lib/operations/resourceHealthMetadataOperations.js new file mode 100644 index 0000000000..c75a8a1995 --- /dev/null +++ b/lib/services/websiteManagement2/lib/operations/resourceHealthMetadataOperations.js @@ -0,0 +1,2482 @@ +/* + * 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 List all ResourceHealthMetadata for all sites in the subscription. + * + * List all ResourceHealthMetadata for all sites in the subscription. + * + * @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 ResourceHealthMetadataCollection} 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.'); + } + // Validate + try { + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/providers/Microsoft.Web/resourceHealthMetadata'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['ResourceHealthMetadataCollection']().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 List all ResourceHealthMetadata for all sites in the resource group + * in the subscription. + * + * List all ResourceHealthMetadata for all sites in the resource group in the + * subscription. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @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 ResourceHealthMetadataCollection} 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 _listByResourceGroup(resourceGroupName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/resourceHealthMetadata'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['ResourceHealthMetadataCollection']().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 the category of ResourceHealthMetadata to use for the given + * site as a collection + * + * Gets the category of ResourceHealthMetadata to use for the given site as a + * collection + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @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 ResourceHealthMetadataCollection} 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 _listBySite(resourceGroupName, name, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/resourceHealthMetadata'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['ResourceHealthMetadataCollection']().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 the category of ResourceHealthMetadata to use for the given + * site + * + * Gets the category of ResourceHealthMetadata to use for the given site + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app + * + * @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 ResourceHealthMetadata} 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 _getBySite(resourceGroupName, name, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/resourceHealthMetadata/default'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['ResourceHealthMetadata']().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 the category of ResourceHealthMetadata to use for the given + * site as a collection + * + * Gets the category of ResourceHealthMetadata to use for the given site as a + * collection + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {string} slot Name of web app slot. If not specified then will + * default to production slot. + * + * @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 ResourceHealthMetadataCollection} 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 _listBySiteSlot(resourceGroupName, name, slot, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (slot === null || slot === undefined || typeof slot.valueOf() !== 'string') { + throw new Error('slot cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/resourceHealthMetadata'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['ResourceHealthMetadataCollection']().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 the category of ResourceHealthMetadata to use for the given + * site + * + * Gets the category of ResourceHealthMetadata to use for the given site + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app + * + * @param {string} slot Name of web app slot. If not specified then will + * default to production slot. + * + * @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 ResourceHealthMetadata} 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 _getBySiteSlot(resourceGroupName, name, slot, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (slot === null || slot === undefined || typeof slot.valueOf() !== 'string') { + throw new Error('slot cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/resourceHealthMetadata/default'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['ResourceHealthMetadata']().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 List all ResourceHealthMetadata for all sites in the subscription. + * + * List all ResourceHealthMetadata for all sites in the subscription. + * + * @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 ResourceHealthMetadataCollection} 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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['ResourceHealthMetadataCollection']().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 List all ResourceHealthMetadata for all sites in the resource group + * in the subscription. + * + * List all ResourceHealthMetadata for all sites in the resource group in the + * subscription. + * + * @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 ResourceHealthMetadataCollection} 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 _listByResourceGroupNext(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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['ResourceHealthMetadataCollection']().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 the category of ResourceHealthMetadata to use for the given + * site as a collection + * + * Gets the category of ResourceHealthMetadata to use for the given site as a + * collection + * + * @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 ResourceHealthMetadataCollection} 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 _listBySiteNext(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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['ResourceHealthMetadataCollection']().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 the category of ResourceHealthMetadata to use for the given + * site as a collection + * + * Gets the category of ResourceHealthMetadata to use for the given site as a + * collection + * + * @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 ResourceHealthMetadataCollection} 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 _listBySiteSlotNext(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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['ResourceHealthMetadataCollection']().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 ResourceHealthMetadataOperations. */ +class ResourceHealthMetadataOperations { + /** + * Create a ResourceHealthMetadataOperations. + * @param {WebSiteManagementClient} client Reference to the service client. + */ + constructor(client) { + this.client = client; + this._list = _list; + this._listByResourceGroup = _listByResourceGroup; + this._listBySite = _listBySite; + this._getBySite = _getBySite; + this._listBySiteSlot = _listBySiteSlot; + this._getBySiteSlot = _getBySiteSlot; + this._listNext = _listNext; + this._listByResourceGroupNext = _listByResourceGroupNext; + this._listBySiteNext = _listBySiteNext; + this._listBySiteSlotNext = _listBySiteSlotNext; + } + + /** + * @summary List all ResourceHealthMetadata for all sites in the subscription. + * + * List all ResourceHealthMetadata for all sites in the subscription. + * + * @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. + */ + 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 List all ResourceHealthMetadata for all sites in the subscription. + * + * List all ResourceHealthMetadata for all sites in the subscription. + * + * @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 {ResourceHealthMetadataCollection} - 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 ResourceHealthMetadataCollection} 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 List all ResourceHealthMetadata for all sites in the resource group + * in the subscription. + * + * List all ResourceHealthMetadata for all sites in the resource group in the + * subscription. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @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. + */ + listByResourceGroupWithHttpOperationResponse(resourceGroupName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listByResourceGroup(resourceGroupName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary List all ResourceHealthMetadata for all sites in the resource group + * in the subscription. + * + * List all ResourceHealthMetadata for all sites in the resource group in the + * subscription. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @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 {ResourceHealthMetadataCollection} - 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 ResourceHealthMetadataCollection} 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. + */ + listByResourceGroup(resourceGroupName, 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._listByResourceGroup(resourceGroupName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listByResourceGroup(resourceGroupName, options, optionalCallback); + } + } + + /** + * @summary Gets the category of ResourceHealthMetadata to use for the given + * site as a collection + * + * Gets the category of ResourceHealthMetadata to use for the given site as a + * collection + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @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. + */ + listBySiteWithHttpOperationResponse(resourceGroupName, name, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listBySite(resourceGroupName, name, 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 the category of ResourceHealthMetadata to use for the given + * site as a collection + * + * Gets the category of ResourceHealthMetadata to use for the given site as a + * collection + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @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 {ResourceHealthMetadataCollection} - 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 ResourceHealthMetadataCollection} 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. + */ + listBySite(resourceGroupName, name, 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._listBySite(resourceGroupName, name, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listBySite(resourceGroupName, name, options, optionalCallback); + } + } + + /** + * @summary Gets the category of ResourceHealthMetadata to use for the given + * site + * + * Gets the category of ResourceHealthMetadata to use for the given site + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app + * + * @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. + */ + getBySiteWithHttpOperationResponse(resourceGroupName, name, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._getBySite(resourceGroupName, name, 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 the category of ResourceHealthMetadata to use for the given + * site + * + * Gets the category of ResourceHealthMetadata to use for the given site + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app + * + * @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 {ResourceHealthMetadata} - 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 ResourceHealthMetadata} 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. + */ + getBySite(resourceGroupName, name, 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._getBySite(resourceGroupName, name, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getBySite(resourceGroupName, name, options, optionalCallback); + } + } + + /** + * @summary Gets the category of ResourceHealthMetadata to use for the given + * site as a collection + * + * Gets the category of ResourceHealthMetadata to use for the given site as a + * collection + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {string} slot Name of web app slot. If not specified then will + * default to production slot. + * + * @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. + */ + listBySiteSlotWithHttpOperationResponse(resourceGroupName, name, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listBySiteSlot(resourceGroupName, name, slot, 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 the category of ResourceHealthMetadata to use for the given + * site as a collection + * + * Gets the category of ResourceHealthMetadata to use for the given site as a + * collection + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {string} slot Name of web app slot. If not specified then will + * default to production slot. + * + * @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 {ResourceHealthMetadataCollection} - 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 ResourceHealthMetadataCollection} 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. + */ + listBySiteSlot(resourceGroupName, name, slot, 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._listBySiteSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listBySiteSlot(resourceGroupName, name, slot, options, optionalCallback); + } + } + + /** + * @summary Gets the category of ResourceHealthMetadata to use for the given + * site + * + * Gets the category of ResourceHealthMetadata to use for the given site + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app + * + * @param {string} slot Name of web app slot. If not specified then will + * default to production slot. + * + * @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. + */ + getBySiteSlotWithHttpOperationResponse(resourceGroupName, name, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._getBySiteSlot(resourceGroupName, name, slot, 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 the category of ResourceHealthMetadata to use for the given + * site + * + * Gets the category of ResourceHealthMetadata to use for the given site + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app + * + * @param {string} slot Name of web app slot. If not specified then will + * default to production slot. + * + * @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 {ResourceHealthMetadata} - 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 ResourceHealthMetadata} 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. + */ + getBySiteSlot(resourceGroupName, name, slot, 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._getBySiteSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getBySiteSlot(resourceGroupName, name, slot, options, optionalCallback); + } + } + + /** + * @summary List all ResourceHealthMetadata for all sites in the subscription. + * + * List all ResourceHealthMetadata for all sites in the subscription. + * + * @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 List all ResourceHealthMetadata for all sites in the subscription. + * + * List all ResourceHealthMetadata for all sites in the subscription. + * + * @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 {ResourceHealthMetadataCollection} - 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 ResourceHealthMetadataCollection} 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); + } + } + + /** + * @summary List all ResourceHealthMetadata for all sites in the resource group + * in the subscription. + * + * List all ResourceHealthMetadata for all sites in the resource group in the + * subscription. + * + * @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. + */ + listByResourceGroupNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listByResourceGroupNext(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 List all ResourceHealthMetadata for all sites in the resource group + * in the subscription. + * + * List all ResourceHealthMetadata for all sites in the resource group in the + * subscription. + * + * @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 {ResourceHealthMetadataCollection} - 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 ResourceHealthMetadataCollection} 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. + */ + listByResourceGroupNext(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._listByResourceGroupNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listByResourceGroupNext(nextPageLink, options, optionalCallback); + } + } + + /** + * @summary Gets the category of ResourceHealthMetadata to use for the given + * site as a collection + * + * Gets the category of ResourceHealthMetadata to use for the given site as a + * collection + * + * @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. + */ + listBySiteNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listBySiteNext(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 the category of ResourceHealthMetadata to use for the given + * site as a collection + * + * Gets the category of ResourceHealthMetadata to use for the given site as a + * collection + * + * @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 {ResourceHealthMetadataCollection} - 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 ResourceHealthMetadataCollection} 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. + */ + listBySiteNext(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._listBySiteNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listBySiteNext(nextPageLink, options, optionalCallback); + } + } + + /** + * @summary Gets the category of ResourceHealthMetadata to use for the given + * site as a collection + * + * Gets the category of ResourceHealthMetadata to use for the given site as a + * collection + * + * @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. + */ + listBySiteSlotNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listBySiteSlotNext(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 the category of ResourceHealthMetadata to use for the given + * site as a collection + * + * Gets the category of ResourceHealthMetadata to use for the given site as a + * collection + * + * @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 {ResourceHealthMetadataCollection} - 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 ResourceHealthMetadataCollection} 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. + */ + listBySiteSlotNext(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._listBySiteSlotNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listBySiteSlotNext(nextPageLink, options, optionalCallback); + } + } + +} + +module.exports = ResourceHealthMetadataOperations; diff --git a/lib/services/websiteManagement2/lib/operations/topLevelDomains.js b/lib/services/websiteManagement2/lib/operations/topLevelDomains.js new file mode 100644 index 0000000000..20fa9e42ae --- /dev/null +++ b/lib/services/websiteManagement2/lib/operations/topLevelDomains.js @@ -0,0 +1,1211 @@ +/* + * 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 Get all top-level domains supported for registration. + * + * Get all top-level domains supported for registration. + * + * @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 TopLevelDomainCollection} 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.'); + } + // Validate + try { + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/providers/Microsoft.DomainRegistration/topLevelDomains'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['TopLevelDomainCollection']().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 Get details of a top-level domain. + * + * Get details of a top-level domain. + * + * @param {string} name Name of the top-level domain. + * + * @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 TopLevelDomain} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _get(name, 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 (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/providers/Microsoft.DomainRegistration/topLevelDomains/{name}'; + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['TopLevelDomain']().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 all legal agreements that user needs to accept before + * purchasing a domain. + * + * Gets all legal agreements that user needs to accept before purchasing a + * domain. + * + * @param {string} name Name of the top-level domain. + * + * @param {object} agreementOption Domain agreement options. + * + * @param {boolean} [agreementOption.includePrivacy] If true, then + * the list of agreements will include agreements for domain privacy as well; + * otherwise, false. + * + * @param {boolean} [agreementOption.forTransfer] If true, then + * the list of agreements will include agreements for domain transfer as well; + * otherwise, false. + * + * @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 TldLegalAgreementCollection} 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 _listAgreements(name, agreementOption, 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 (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (agreementOption === null || agreementOption === undefined) { + throw new Error('agreementOption cannot be null or undefined.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/providers/Microsoft.DomainRegistration/topLevelDomains/{name}/listAgreements'; + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + 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 (agreementOption !== null && agreementOption !== undefined) { + let requestModelMapper = new client.models['TopLevelDomainAgreementOption']().mapper(); + requestModel = client.serialize(requestModelMapper, agreementOption, 'agreementOption'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(agreementOption, 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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['TldLegalAgreementCollection']().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 Get all top-level domains supported for registration. + * + * Get all top-level domains supported for registration. + * + * @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 TopLevelDomainCollection} 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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['TopLevelDomainCollection']().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 all legal agreements that user needs to accept before + * purchasing a domain. + * + * Gets all legal agreements that user needs to accept before purchasing a + * domain. + * + * @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 TldLegalAgreementCollection} 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 _listAgreementsNext(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 = '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]; + } + } + } + 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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['TldLegalAgreementCollection']().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 TopLevelDomains. */ +class TopLevelDomains { + /** + * Create a TopLevelDomains. + * @param {WebSiteManagementClient} client Reference to the service client. + */ + constructor(client) { + this.client = client; + this._list = _list; + this._get = _get; + this._listAgreements = _listAgreements; + this._listNext = _listNext; + this._listAgreementsNext = _listAgreementsNext; + } + + /** + * @summary Get all top-level domains supported for registration. + * + * Get all top-level domains supported for registration. + * + * @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. + */ + 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 Get all top-level domains supported for registration. + * + * Get all top-level domains supported for registration. + * + * @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 {TopLevelDomainCollection} - 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 TopLevelDomainCollection} 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 Get details of a top-level domain. + * + * Get details of a top-level domain. + * + * @param {string} name Name of the top-level domain. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + getWithHttpOperationResponse(name, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._get(name, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Get details of a top-level domain. + * + * Get details of a top-level domain. + * + * @param {string} name Name of the top-level domain. + * + * @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 {TopLevelDomain} - 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 TopLevelDomain} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + get(name, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._get(name, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._get(name, options, optionalCallback); + } + } + + /** + * @summary Gets all legal agreements that user needs to accept before + * purchasing a domain. + * + * Gets all legal agreements that user needs to accept before purchasing a + * domain. + * + * @param {string} name Name of the top-level domain. + * + * @param {object} agreementOption Domain agreement options. + * + * @param {boolean} [agreementOption.includePrivacy] If true, then + * the list of agreements will include agreements for domain privacy as well; + * otherwise, false. + * + * @param {boolean} [agreementOption.forTransfer] If true, then + * the list of agreements will include agreements for domain transfer as well; + * otherwise, false. + * + * @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. + */ + listAgreementsWithHttpOperationResponse(name, agreementOption, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listAgreements(name, agreementOption, 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 all legal agreements that user needs to accept before + * purchasing a domain. + * + * Gets all legal agreements that user needs to accept before purchasing a + * domain. + * + * @param {string} name Name of the top-level domain. + * + * @param {object} agreementOption Domain agreement options. + * + * @param {boolean} [agreementOption.includePrivacy] If true, then + * the list of agreements will include agreements for domain privacy as well; + * otherwise, false. + * + * @param {boolean} [agreementOption.forTransfer] If true, then + * the list of agreements will include agreements for domain transfer as well; + * otherwise, false. + * + * @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 {TldLegalAgreementCollection} - 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 TldLegalAgreementCollection} 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. + */ + listAgreements(name, agreementOption, 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._listAgreements(name, agreementOption, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listAgreements(name, agreementOption, options, optionalCallback); + } + } + + /** + * @summary Get all top-level domains supported for registration. + * + * Get all top-level domains supported for registration. + * + * @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 Get all top-level domains supported for registration. + * + * Get all top-level domains supported for registration. + * + * @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 {TopLevelDomainCollection} - 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 TopLevelDomainCollection} 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); + } + } + + /** + * @summary Gets all legal agreements that user needs to accept before + * purchasing a domain. + * + * Gets all legal agreements that user needs to accept before purchasing a + * domain. + * + * @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. + */ + listAgreementsNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listAgreementsNext(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 all legal agreements that user needs to accept before + * purchasing a domain. + * + * Gets all legal agreements that user needs to accept before purchasing a + * domain. + * + * @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 {TldLegalAgreementCollection} - 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 TldLegalAgreementCollection} 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. + */ + listAgreementsNext(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._listAgreementsNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listAgreementsNext(nextPageLink, options, optionalCallback); + } + } + +} + +module.exports = TopLevelDomains; diff --git a/lib/services/websiteManagement2/lib/operations/webApps.js b/lib/services/websiteManagement2/lib/operations/webApps.js new file mode 100644 index 0000000000..c133ccf4c8 --- /dev/null +++ b/lib/services/websiteManagement2/lib/operations/webApps.js @@ -0,0 +1,124674 @@ +/* + * 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 Get all apps for a subscription. + * + * Get all apps for a subscription. + * + * @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 WebAppCollection} 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.'); + } + // Validate + try { + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/providers/Microsoft.Web/sites'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['WebAppCollection']().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 all web, mobile, and API apps in the specified resource group. + * + * Gets all web, mobile, and API apps in the specified resource group. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {object} [options] Optional Parameters. + * + * @param {boolean} [options.includeSlots] Specify true to + * include deployment slots in results. The default is false, which only gives + * you the production slot of all apps. + * + * @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 WebAppCollection} 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 _listByResourceGroup(resourceGroupName, 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 includeSlots = (options && options.includeSlots !== undefined) ? options.includeSlots : undefined; + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (includeSlots !== null && includeSlots !== undefined && typeof includeSlots !== 'boolean') { + throw new Error('includeSlots 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.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + if (includeSlots !== null && includeSlots !== undefined) { + queryParameters.push('includeSlots=' + encodeURIComponent(includeSlots.toString())); + } + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['WebAppCollection']().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 the details of a web, mobile, or API app. + * + * Gets the details of a web, mobile, or API app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @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 Site} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _get(resourceGroupName, name, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 404) { + 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['Site']().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 Creates a new web, mobile, or API app in an existing resource + * group, or updates an existing app. + * + * Creates a new web, mobile, or API app in an existing resource group, or + * updates an existing app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Unique name of the app to create or update. To create + * or update a deployment slot, use the {slot} parameter. + * + * @param {object} siteEnvelope A JSON representation of the app properties. + * See example. + * + * @param {boolean} [siteEnvelope.enabled] true if the app is + * enabled; otherwise, false. Setting this value to false disables + * the app (takes the app offline). + * + * @param {array} [siteEnvelope.hostNameSslStates] Hostname SSL states are used + * to manage the SSL bindings for app's hostnames. + * + * @param {string} [siteEnvelope.serverFarmId] Resource ID of the associated + * App Service plan, formatted as: + * "/subscriptions/{subscriptionID}/resourceGroups/{groupName}/providers/Microsoft.Web/serverfarms/{appServicePlanName}". + * + * @param {boolean} [siteEnvelope.reserved] true if reserved; + * otherwise, false. + * + * @param {boolean} [siteEnvelope.isXenon] Obsolete: Hyper-V sandbox. + * + * @param {boolean} [siteEnvelope.hyperV] Hyper-V sandbox. + * + * @param {object} [siteEnvelope.siteConfig] Configuration of the app. + * + * @param {number} [siteEnvelope.siteConfig.numberOfWorkers] Number of workers. + * + * @param {array} [siteEnvelope.siteConfig.defaultDocuments] Default documents. + * + * @param {string} [siteEnvelope.siteConfig.netFrameworkVersion] .NET Framework + * version. + * + * @param {string} [siteEnvelope.siteConfig.phpVersion] Version of PHP. + * + * @param {string} [siteEnvelope.siteConfig.pythonVersion] Version of Python. + * + * @param {string} [siteEnvelope.siteConfig.nodeVersion] Version of Node.js. + * + * @param {string} [siteEnvelope.siteConfig.linuxFxVersion] Linux App Framework + * and version + * + * @param {string} [siteEnvelope.siteConfig.windowsFxVersion] Xenon App + * Framework and version + * + * @param {boolean} [siteEnvelope.siteConfig.requestTracingEnabled] + * true if request tracing is enabled; otherwise, + * false. + * + * @param {date} [siteEnvelope.siteConfig.requestTracingExpirationTime] Request + * tracing expiration time. + * + * @param {boolean} [siteEnvelope.siteConfig.remoteDebuggingEnabled] + * true if remote debugging is enabled; otherwise, + * false. + * + * @param {string} [siteEnvelope.siteConfig.remoteDebuggingVersion] Remote + * debugging version. + * + * @param {boolean} [siteEnvelope.siteConfig.httpLoggingEnabled] + * true if HTTP logging is enabled; otherwise, false. + * + * @param {number} [siteEnvelope.siteConfig.logsDirectorySizeLimit] HTTP logs + * directory size limit. + * + * @param {boolean} [siteEnvelope.siteConfig.detailedErrorLoggingEnabled] + * true if detailed error logging is enabled; otherwise, + * false. + * + * @param {string} [siteEnvelope.siteConfig.publishingUsername] Publishing user + * name. + * + * @param {array} [siteEnvelope.siteConfig.appSettings] Application settings. + * + * @param {object} [siteEnvelope.siteConfig.azureStorageAccounts] User-provided + * Azure storage accounts. + * + * @param {array} [siteEnvelope.siteConfig.connectionStrings] Connection + * strings. + * + * @param {array} [siteEnvelope.siteConfig.handlerMappings] Handler mappings. + * + * @param {string} [siteEnvelope.siteConfig.documentRoot] Document root. + * + * @param {string} [siteEnvelope.siteConfig.scmType] SCM type. Possible values + * include: 'None', 'Dropbox', 'Tfs', 'LocalGit', 'GitHub', 'CodePlexGit', + * 'CodePlexHg', 'BitbucketGit', 'BitbucketHg', 'ExternalGit', 'ExternalHg', + * 'OneDrive', 'VSO' + * + * @param {boolean} [siteEnvelope.siteConfig.use32BitWorkerProcess] + * true to use 32-bit worker process; otherwise, + * false. + * + * @param {boolean} [siteEnvelope.siteConfig.webSocketsEnabled] + * true if WebSocket is enabled; otherwise, false. + * + * @param {boolean} [siteEnvelope.siteConfig.alwaysOn] true if + * Always On is enabled; otherwise, false. + * + * @param {string} [siteEnvelope.siteConfig.javaVersion] Java version. + * + * @param {string} [siteEnvelope.siteConfig.javaContainer] Java container. + * + * @param {string} [siteEnvelope.siteConfig.javaContainerVersion] Java + * container version. + * + * @param {string} [siteEnvelope.siteConfig.appCommandLine] App command line to + * launch. + * + * @param {string} [siteEnvelope.siteConfig.managedPipelineMode] Managed + * pipeline mode. Possible values include: 'Integrated', 'Classic' + * + * @param {array} [siteEnvelope.siteConfig.virtualApplications] Virtual + * applications. + * + * @param {string} [siteEnvelope.siteConfig.loadBalancing] Site load balancing. + * Possible values include: 'WeightedRoundRobin', 'LeastRequests', + * 'LeastResponseTime', 'WeightedTotalTraffic', 'RequestHash' + * + * @param {object} [siteEnvelope.siteConfig.experiments] This is work around + * for polymophic types. + * + * @param {array} [siteEnvelope.siteConfig.experiments.rampUpRules] List of + * ramp-up rules. + * + * @param {object} [siteEnvelope.siteConfig.limits] Site limits. + * + * @param {number} [siteEnvelope.siteConfig.limits.maxPercentageCpu] Maximum + * allowed CPU usage percentage. + * + * @param {number} [siteEnvelope.siteConfig.limits.maxMemoryInMb] Maximum + * allowed memory usage in MB. + * + * @param {number} [siteEnvelope.siteConfig.limits.maxDiskSizeInMb] Maximum + * allowed disk size usage in MB. + * + * @param {boolean} [siteEnvelope.siteConfig.autoHealEnabled] true + * if Auto Heal is enabled; otherwise, false. + * + * @param {object} [siteEnvelope.siteConfig.autoHealRules] Auto Heal rules. + * + * @param {object} [siteEnvelope.siteConfig.autoHealRules.triggers] Conditions + * that describe when to execute the auto-heal actions. + * + * @param {object} [siteEnvelope.siteConfig.autoHealRules.triggers.requests] A + * rule based on total requests. + * + * @param {number} + * [siteEnvelope.siteConfig.autoHealRules.triggers.requests.count] Request + * Count. + * + * @param {string} + * [siteEnvelope.siteConfig.autoHealRules.triggers.requests.timeInterval] Time + * interval. + * + * @param {number} + * [siteEnvelope.siteConfig.autoHealRules.triggers.privateBytesInKB] A rule + * based on private bytes. + * + * @param {array} [siteEnvelope.siteConfig.autoHealRules.triggers.statusCodes] + * A rule based on status codes. + * + * @param {object} + * [siteEnvelope.siteConfig.autoHealRules.triggers.slowRequests] A rule based + * on request execution time. + * + * @param {string} + * [siteEnvelope.siteConfig.autoHealRules.triggers.slowRequests.timeTaken] Time + * taken. + * + * @param {number} + * [siteEnvelope.siteConfig.autoHealRules.triggers.slowRequests.count] Request + * Count. + * + * @param {string} + * [siteEnvelope.siteConfig.autoHealRules.triggers.slowRequests.timeInterval] + * Time interval. + * + * @param {object} [siteEnvelope.siteConfig.autoHealRules.actions] Actions to + * be executed when a rule is triggered. + * + * @param {string} [siteEnvelope.siteConfig.autoHealRules.actions.actionType] + * Predefined action to be taken. Possible values include: 'Recycle', + * 'LogEvent', 'CustomAction' + * + * @param {object} [siteEnvelope.siteConfig.autoHealRules.actions.customAction] + * Custom action to be taken. + * + * @param {string} + * [siteEnvelope.siteConfig.autoHealRules.actions.customAction.exe] Executable + * to be run. + * + * @param {string} + * [siteEnvelope.siteConfig.autoHealRules.actions.customAction.parameters] + * Parameters for the executable. + * + * @param {string} + * [siteEnvelope.siteConfig.autoHealRules.actions.minProcessExecutionTime] + * Minimum time the process must execute + * before taking the action + * + * @param {string} [siteEnvelope.siteConfig.tracingOptions] Tracing options. + * + * @param {string} [siteEnvelope.siteConfig.vnetName] Virtual Network name. + * + * @param {object} [siteEnvelope.siteConfig.cors] Cross-Origin Resource Sharing + * (CORS) settings. + * + * @param {array} [siteEnvelope.siteConfig.cors.allowedOrigins] Gets or sets + * the list of origins that should be allowed to make cross-origin + * calls (for example: http://example.com:12345). Use "*" to allow all. + * + * @param {object} [siteEnvelope.siteConfig.push] Push endpoint settings. + * + * @param {boolean} siteEnvelope.siteConfig.push.isPushEnabled Gets or sets a + * flag indicating whether the Push endpoint is enabled. + * + * @param {string} [siteEnvelope.siteConfig.push.tagWhitelistJson] Gets or sets + * a JSON string containing a list of tags that are whitelisted for use by the + * push registration endpoint. + * + * @param {string} [siteEnvelope.siteConfig.push.tagsRequiringAuth] Gets or + * sets a JSON string containing a list of tags that require user + * authentication to be used in the push registration endpoint. + * Tags can consist of alphanumeric characters and the following: + * '_', '@', '#', '.', ':', '-'. + * Validation should be performed at the PushRequestHandler. + * + * @param {string} [siteEnvelope.siteConfig.push.dynamicTagsJson] Gets or sets + * a JSON string containing a list of dynamic tags that will be evaluated from + * user claims in the push registration endpoint. + * + * @param {string} [siteEnvelope.siteConfig.push.kind] Kind of resource. + * + * @param {object} [siteEnvelope.siteConfig.apiDefinition] Information about + * the formal API definition for the app. + * + * @param {string} [siteEnvelope.siteConfig.apiDefinition.url] The URL of the + * API definition. + * + * @param {string} [siteEnvelope.siteConfig.autoSwapSlotName] Auto-swap slot + * name. + * + * @param {boolean} [siteEnvelope.siteConfig.localMySqlEnabled] + * true to enable local MySQL; otherwise, false. + * + * @param {number} [siteEnvelope.siteConfig.managedServiceIdentityId] Managed + * Service Identity Id + * + * @param {number} [siteEnvelope.siteConfig.xManagedServiceIdentityId] Explicit + * Managed Service Identity Id + * + * @param {array} [siteEnvelope.siteConfig.ipSecurityRestrictions] IP security + * restrictions. + * + * @param {boolean} [siteEnvelope.siteConfig.http20Enabled] Http20Enabled: + * configures a web site to allow clients to connect over http2.0 + * + * @param {string} [siteEnvelope.siteConfig.minTlsVersion] MinTlsVersion: + * configures the minimum version of TLS required for SSL requests. Possible + * values include: '1.0', '1.1', '1.2' + * + * @param {string} [siteEnvelope.siteConfig.ftpsState] State of FTP / FTPS + * service. Possible values include: 'AllAllowed', 'FtpsOnly', 'Disabled' + * + * @param {number} [siteEnvelope.siteConfig.reservedInstanceCount] Number of + * reserved instances. + * This setting only applies to the Consumption Plan + * + * @param {boolean} [siteEnvelope.scmSiteAlsoStopped] true to stop + * SCM (KUDU) site when the app is stopped; otherwise, false. The + * default is false. + * + * @param {object} [siteEnvelope.hostingEnvironmentProfile] App Service + * Environment to use for the app. + * + * @param {string} [siteEnvelope.hostingEnvironmentProfile.id] Resource ID of + * the App Service Environment. + * + * @param {boolean} [siteEnvelope.clientAffinityEnabled] true to + * enable client affinity; false to stop sending session affinity + * cookies, which route client requests in the same session to the same + * instance. Default is true. + * + * @param {boolean} [siteEnvelope.clientCertEnabled] true to + * enable client certificate authentication (TLS mutual authentication); + * otherwise, false. Default is false. + * + * @param {boolean} [siteEnvelope.hostNamesDisabled] true to + * disable the public hostnames of the app; otherwise, false. + * If true, the app is only accessible via API management process. + * + * @param {number} [siteEnvelope.containerSize] Size of the function container. + * + * @param {number} [siteEnvelope.dailyMemoryTimeQuota] Maximum allowed daily + * memory-time quota (applicable on dynamic apps only). + * + * @param {object} [siteEnvelope.cloningInfo] If specified during app creation, + * the app is cloned from a source app. + * + * @param {uuid} [siteEnvelope.cloningInfo.correlationId] Correlation ID of + * cloning operation. This ID ties multiple cloning operations + * together to use the same snapshot. + * + * @param {boolean} [siteEnvelope.cloningInfo.overwrite] true to + * overwrite destination app; otherwise, false. + * + * @param {boolean} [siteEnvelope.cloningInfo.cloneCustomHostNames] + * true to clone custom hostnames from source app; otherwise, + * false. + * + * @param {boolean} [siteEnvelope.cloningInfo.cloneSourceControl] + * true to clone source control from source app; otherwise, + * false. + * + * @param {string} siteEnvelope.cloningInfo.sourceWebAppId ARM resource ID of + * the source app. App resource ID is of the form + * /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName} + * for production slots and + * /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/slots/{slotName} + * for other slots. + * + * @param {string} [siteEnvelope.cloningInfo.hostingEnvironment] App Service + * Environment. + * + * @param {object} [siteEnvelope.cloningInfo.appSettingsOverrides] Application + * setting overrides for cloned app. If specified, these settings override the + * settings cloned + * from source app. Otherwise, application settings from source app are + * retained. + * + * @param {boolean} [siteEnvelope.cloningInfo.configureLoadBalancing] + * true to configure load balancing for source and destination + * app. + * + * @param {string} [siteEnvelope.cloningInfo.trafficManagerProfileId] ARM + * resource ID of the Traffic Manager profile to use, if it exists. Traffic + * Manager resource ID is of the form + * /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/trafficManagerProfiles/{profileName}. + * + * @param {string} [siteEnvelope.cloningInfo.trafficManagerProfileName] Name of + * Traffic Manager profile to create. This is only needed if Traffic Manager + * profile does not already exist. + * + * @param {boolean} [siteEnvelope.httpsOnly] HttpsOnly: configures a web site + * to accept only https requests. Issues redirect for + * http requests + * + * @param {object} [siteEnvelope.identity] + * + * @param {string} [siteEnvelope.identity.type] Type of managed service + * identity. Possible values include: 'SystemAssigned', 'UserAssigned' + * + * @param {array} [siteEnvelope.identity.identityIds] Array of UserAssigned + * managed service identities. + * + * @param {string} [siteEnvelope.kind] Kind of resource. + * + * @param {string} siteEnvelope.location Resource Location. + * + * @param {object} [siteEnvelope.tags] Resource tags. + * + * @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 Site} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _createOrUpdate(resourceGroupName, name, siteEnvelope, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + + if (!callback) { + throw new Error('callback cannot be null.'); + } + + // Send request + this.beginCreateOrUpdate(resourceGroupName, name, siteEnvelope, options, (err, parsedResult, httpRequest, response) => { + if (err) return callback(err); + + let initialResult = new msRest.HttpOperationResponse(); + initialResult.request = httpRequest; + initialResult.response = response; + initialResult.body = response.body; + client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { + if (err) return callback(err); + + // Create Result + let result = null; + + httpRequest = pollingResult.request; + response = pollingResult.response; + let responseBody = pollingResult.body; + if (responseBody === '') responseBody = null; + + // Deserialize Response + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['Site']().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 Deletes a web, mobile, or API app, or one of the deployment slots. + * + * Deletes a web, mobile, or API app, or one of the deployment slots. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app to delete. + * + * @param {object} [options] Optional Parameters. + * + * @param {boolean} [options.deleteMetrics] If true, web app metrics are also + * deleted. + * + * @param {boolean} [options.deleteEmptyServerFarm] Specify true if the App + * Service plan will be empty after app deletion and you want to delete the + * empty App Service plan. By default, the empty App Service plan is not + * deleted. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _deleteMethod(resourceGroupName, name, 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 deleteMetrics = (options && options.deleteMetrics !== undefined) ? options.deleteMetrics : undefined; + let deleteEmptyServerFarm = (options && options.deleteEmptyServerFarm !== undefined) ? options.deleteEmptyServerFarm : undefined; + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (deleteMetrics !== null && deleteMetrics !== undefined && typeof deleteMetrics !== 'boolean') { + throw new Error('deleteMetrics must be of type boolean.'); + } + if (deleteEmptyServerFarm !== null && deleteEmptyServerFarm !== undefined && typeof deleteEmptyServerFarm !== 'boolean') { + throw new Error('deleteEmptyServerFarm 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.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + if (deleteMetrics !== null && deleteMetrics !== undefined) { + queryParameters.push('deleteMetrics=' + encodeURIComponent(deleteMetrics.toString())); + } + if (deleteEmptyServerFarm !== null && deleteEmptyServerFarm !== undefined) { + queryParameters.push('deleteEmptyServerFarm=' + encodeURIComponent(deleteEmptyServerFarm.toString())); + } + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'DELETE'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 204 && statusCode !== 404) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + + return callback(null, result, httpRequest, response); + }); +} + +/** + * @summary Creates a new web, mobile, or API app in an existing resource + * group, or updates an existing app. + * + * Creates a new web, mobile, or API app in an existing resource group, or + * updates an existing app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Unique name of the app to create or update. To create + * or update a deployment slot, use the {slot} parameter. + * + * @param {object} siteEnvelope A JSON representation of the app properties. + * See example. + * + * @param {boolean} [siteEnvelope.enabled] true if the app is + * enabled; otherwise, false. Setting this value to false disables + * the app (takes the app offline). + * + * @param {array} [siteEnvelope.hostNameSslStates] Hostname SSL states are used + * to manage the SSL bindings for app's hostnames. + * + * @param {string} [siteEnvelope.serverFarmId] Resource ID of the associated + * App Service plan, formatted as: + * "/subscriptions/{subscriptionID}/resourceGroups/{groupName}/providers/Microsoft.Web/serverfarms/{appServicePlanName}". + * + * @param {boolean} [siteEnvelope.reserved] true if reserved; + * otherwise, false. + * + * @param {boolean} [siteEnvelope.isXenon] Obsolete: Hyper-V sandbox. + * + * @param {boolean} [siteEnvelope.hyperV] Hyper-V sandbox. + * + * @param {object} [siteEnvelope.siteConfig] Configuration of the app. + * + * @param {number} [siteEnvelope.siteConfig.numberOfWorkers] Number of workers. + * + * @param {array} [siteEnvelope.siteConfig.defaultDocuments] Default documents. + * + * @param {string} [siteEnvelope.siteConfig.netFrameworkVersion] .NET Framework + * version. + * + * @param {string} [siteEnvelope.siteConfig.phpVersion] Version of PHP. + * + * @param {string} [siteEnvelope.siteConfig.pythonVersion] Version of Python. + * + * @param {string} [siteEnvelope.siteConfig.nodeVersion] Version of Node.js. + * + * @param {string} [siteEnvelope.siteConfig.linuxFxVersion] Linux App Framework + * and version + * + * @param {string} [siteEnvelope.siteConfig.windowsFxVersion] Xenon App + * Framework and version + * + * @param {boolean} [siteEnvelope.siteConfig.requestTracingEnabled] + * true if request tracing is enabled; otherwise, + * false. + * + * @param {date} [siteEnvelope.siteConfig.requestTracingExpirationTime] Request + * tracing expiration time. + * + * @param {boolean} [siteEnvelope.siteConfig.remoteDebuggingEnabled] + * true if remote debugging is enabled; otherwise, + * false. + * + * @param {string} [siteEnvelope.siteConfig.remoteDebuggingVersion] Remote + * debugging version. + * + * @param {boolean} [siteEnvelope.siteConfig.httpLoggingEnabled] + * true if HTTP logging is enabled; otherwise, false. + * + * @param {number} [siteEnvelope.siteConfig.logsDirectorySizeLimit] HTTP logs + * directory size limit. + * + * @param {boolean} [siteEnvelope.siteConfig.detailedErrorLoggingEnabled] + * true if detailed error logging is enabled; otherwise, + * false. + * + * @param {string} [siteEnvelope.siteConfig.publishingUsername] Publishing user + * name. + * + * @param {array} [siteEnvelope.siteConfig.appSettings] Application settings. + * + * @param {object} [siteEnvelope.siteConfig.azureStorageAccounts] User-provided + * Azure storage accounts. + * + * @param {array} [siteEnvelope.siteConfig.connectionStrings] Connection + * strings. + * + * @param {array} [siteEnvelope.siteConfig.handlerMappings] Handler mappings. + * + * @param {string} [siteEnvelope.siteConfig.documentRoot] Document root. + * + * @param {string} [siteEnvelope.siteConfig.scmType] SCM type. Possible values + * include: 'None', 'Dropbox', 'Tfs', 'LocalGit', 'GitHub', 'CodePlexGit', + * 'CodePlexHg', 'BitbucketGit', 'BitbucketHg', 'ExternalGit', 'ExternalHg', + * 'OneDrive', 'VSO' + * + * @param {boolean} [siteEnvelope.siteConfig.use32BitWorkerProcess] + * true to use 32-bit worker process; otherwise, + * false. + * + * @param {boolean} [siteEnvelope.siteConfig.webSocketsEnabled] + * true if WebSocket is enabled; otherwise, false. + * + * @param {boolean} [siteEnvelope.siteConfig.alwaysOn] true if + * Always On is enabled; otherwise, false. + * + * @param {string} [siteEnvelope.siteConfig.javaVersion] Java version. + * + * @param {string} [siteEnvelope.siteConfig.javaContainer] Java container. + * + * @param {string} [siteEnvelope.siteConfig.javaContainerVersion] Java + * container version. + * + * @param {string} [siteEnvelope.siteConfig.appCommandLine] App command line to + * launch. + * + * @param {string} [siteEnvelope.siteConfig.managedPipelineMode] Managed + * pipeline mode. Possible values include: 'Integrated', 'Classic' + * + * @param {array} [siteEnvelope.siteConfig.virtualApplications] Virtual + * applications. + * + * @param {string} [siteEnvelope.siteConfig.loadBalancing] Site load balancing. + * Possible values include: 'WeightedRoundRobin', 'LeastRequests', + * 'LeastResponseTime', 'WeightedTotalTraffic', 'RequestHash' + * + * @param {object} [siteEnvelope.siteConfig.experiments] This is work around + * for polymophic types. + * + * @param {array} [siteEnvelope.siteConfig.experiments.rampUpRules] List of + * ramp-up rules. + * + * @param {object} [siteEnvelope.siteConfig.limits] Site limits. + * + * @param {number} [siteEnvelope.siteConfig.limits.maxPercentageCpu] Maximum + * allowed CPU usage percentage. + * + * @param {number} [siteEnvelope.siteConfig.limits.maxMemoryInMb] Maximum + * allowed memory usage in MB. + * + * @param {number} [siteEnvelope.siteConfig.limits.maxDiskSizeInMb] Maximum + * allowed disk size usage in MB. + * + * @param {boolean} [siteEnvelope.siteConfig.autoHealEnabled] true + * if Auto Heal is enabled; otherwise, false. + * + * @param {object} [siteEnvelope.siteConfig.autoHealRules] Auto Heal rules. + * + * @param {object} [siteEnvelope.siteConfig.autoHealRules.triggers] Conditions + * that describe when to execute the auto-heal actions. + * + * @param {object} [siteEnvelope.siteConfig.autoHealRules.triggers.requests] A + * rule based on total requests. + * + * @param {number} + * [siteEnvelope.siteConfig.autoHealRules.triggers.requests.count] Request + * Count. + * + * @param {string} + * [siteEnvelope.siteConfig.autoHealRules.triggers.requests.timeInterval] Time + * interval. + * + * @param {number} + * [siteEnvelope.siteConfig.autoHealRules.triggers.privateBytesInKB] A rule + * based on private bytes. + * + * @param {array} [siteEnvelope.siteConfig.autoHealRules.triggers.statusCodes] + * A rule based on status codes. + * + * @param {object} + * [siteEnvelope.siteConfig.autoHealRules.triggers.slowRequests] A rule based + * on request execution time. + * + * @param {string} + * [siteEnvelope.siteConfig.autoHealRules.triggers.slowRequests.timeTaken] Time + * taken. + * + * @param {number} + * [siteEnvelope.siteConfig.autoHealRules.triggers.slowRequests.count] Request + * Count. + * + * @param {string} + * [siteEnvelope.siteConfig.autoHealRules.triggers.slowRequests.timeInterval] + * Time interval. + * + * @param {object} [siteEnvelope.siteConfig.autoHealRules.actions] Actions to + * be executed when a rule is triggered. + * + * @param {string} [siteEnvelope.siteConfig.autoHealRules.actions.actionType] + * Predefined action to be taken. Possible values include: 'Recycle', + * 'LogEvent', 'CustomAction' + * + * @param {object} [siteEnvelope.siteConfig.autoHealRules.actions.customAction] + * Custom action to be taken. + * + * @param {string} + * [siteEnvelope.siteConfig.autoHealRules.actions.customAction.exe] Executable + * to be run. + * + * @param {string} + * [siteEnvelope.siteConfig.autoHealRules.actions.customAction.parameters] + * Parameters for the executable. + * + * @param {string} + * [siteEnvelope.siteConfig.autoHealRules.actions.minProcessExecutionTime] + * Minimum time the process must execute + * before taking the action + * + * @param {string} [siteEnvelope.siteConfig.tracingOptions] Tracing options. + * + * @param {string} [siteEnvelope.siteConfig.vnetName] Virtual Network name. + * + * @param {object} [siteEnvelope.siteConfig.cors] Cross-Origin Resource Sharing + * (CORS) settings. + * + * @param {array} [siteEnvelope.siteConfig.cors.allowedOrigins] Gets or sets + * the list of origins that should be allowed to make cross-origin + * calls (for example: http://example.com:12345). Use "*" to allow all. + * + * @param {object} [siteEnvelope.siteConfig.push] Push endpoint settings. + * + * @param {boolean} siteEnvelope.siteConfig.push.isPushEnabled Gets or sets a + * flag indicating whether the Push endpoint is enabled. + * + * @param {string} [siteEnvelope.siteConfig.push.tagWhitelistJson] Gets or sets + * a JSON string containing a list of tags that are whitelisted for use by the + * push registration endpoint. + * + * @param {string} [siteEnvelope.siteConfig.push.tagsRequiringAuth] Gets or + * sets a JSON string containing a list of tags that require user + * authentication to be used in the push registration endpoint. + * Tags can consist of alphanumeric characters and the following: + * '_', '@', '#', '.', ':', '-'. + * Validation should be performed at the PushRequestHandler. + * + * @param {string} [siteEnvelope.siteConfig.push.dynamicTagsJson] Gets or sets + * a JSON string containing a list of dynamic tags that will be evaluated from + * user claims in the push registration endpoint. + * + * @param {string} [siteEnvelope.siteConfig.push.kind] Kind of resource. + * + * @param {object} [siteEnvelope.siteConfig.apiDefinition] Information about + * the formal API definition for the app. + * + * @param {string} [siteEnvelope.siteConfig.apiDefinition.url] The URL of the + * API definition. + * + * @param {string} [siteEnvelope.siteConfig.autoSwapSlotName] Auto-swap slot + * name. + * + * @param {boolean} [siteEnvelope.siteConfig.localMySqlEnabled] + * true to enable local MySQL; otherwise, false. + * + * @param {number} [siteEnvelope.siteConfig.managedServiceIdentityId] Managed + * Service Identity Id + * + * @param {number} [siteEnvelope.siteConfig.xManagedServiceIdentityId] Explicit + * Managed Service Identity Id + * + * @param {array} [siteEnvelope.siteConfig.ipSecurityRestrictions] IP security + * restrictions. + * + * @param {boolean} [siteEnvelope.siteConfig.http20Enabled] Http20Enabled: + * configures a web site to allow clients to connect over http2.0 + * + * @param {string} [siteEnvelope.siteConfig.minTlsVersion] MinTlsVersion: + * configures the minimum version of TLS required for SSL requests. Possible + * values include: '1.0', '1.1', '1.2' + * + * @param {string} [siteEnvelope.siteConfig.ftpsState] State of FTP / FTPS + * service. Possible values include: 'AllAllowed', 'FtpsOnly', 'Disabled' + * + * @param {number} [siteEnvelope.siteConfig.reservedInstanceCount] Number of + * reserved instances. + * This setting only applies to the Consumption Plan + * + * @param {boolean} [siteEnvelope.scmSiteAlsoStopped] true to stop + * SCM (KUDU) site when the app is stopped; otherwise, false. The + * default is false. + * + * @param {object} [siteEnvelope.hostingEnvironmentProfile] App Service + * Environment to use for the app. + * + * @param {string} [siteEnvelope.hostingEnvironmentProfile.id] Resource ID of + * the App Service Environment. + * + * @param {boolean} [siteEnvelope.clientAffinityEnabled] true to + * enable client affinity; false to stop sending session affinity + * cookies, which route client requests in the same session to the same + * instance. Default is true. + * + * @param {boolean} [siteEnvelope.clientCertEnabled] true to + * enable client certificate authentication (TLS mutual authentication); + * otherwise, false. Default is false. + * + * @param {boolean} [siteEnvelope.hostNamesDisabled] true to + * disable the public hostnames of the app; otherwise, false. + * If true, the app is only accessible via API management process. + * + * @param {number} [siteEnvelope.containerSize] Size of the function container. + * + * @param {number} [siteEnvelope.dailyMemoryTimeQuota] Maximum allowed daily + * memory-time quota (applicable on dynamic apps only). + * + * @param {object} [siteEnvelope.cloningInfo] If specified during app creation, + * the app is cloned from a source app. + * + * @param {uuid} [siteEnvelope.cloningInfo.correlationId] Correlation ID of + * cloning operation. This ID ties multiple cloning operations + * together to use the same snapshot. + * + * @param {boolean} [siteEnvelope.cloningInfo.overwrite] true to + * overwrite destination app; otherwise, false. + * + * @param {boolean} [siteEnvelope.cloningInfo.cloneCustomHostNames] + * true to clone custom hostnames from source app; otherwise, + * false. + * + * @param {boolean} [siteEnvelope.cloningInfo.cloneSourceControl] + * true to clone source control from source app; otherwise, + * false. + * + * @param {string} siteEnvelope.cloningInfo.sourceWebAppId ARM resource ID of + * the source app. App resource ID is of the form + * /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName} + * for production slots and + * /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/slots/{slotName} + * for other slots. + * + * @param {string} [siteEnvelope.cloningInfo.hostingEnvironment] App Service + * Environment. + * + * @param {object} [siteEnvelope.cloningInfo.appSettingsOverrides] Application + * setting overrides for cloned app. If specified, these settings override the + * settings cloned + * from source app. Otherwise, application settings from source app are + * retained. + * + * @param {boolean} [siteEnvelope.cloningInfo.configureLoadBalancing] + * true to configure load balancing for source and destination + * app. + * + * @param {string} [siteEnvelope.cloningInfo.trafficManagerProfileId] ARM + * resource ID of the Traffic Manager profile to use, if it exists. Traffic + * Manager resource ID is of the form + * /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/trafficManagerProfiles/{profileName}. + * + * @param {string} [siteEnvelope.cloningInfo.trafficManagerProfileName] Name of + * Traffic Manager profile to create. This is only needed if Traffic Manager + * profile does not already exist. + * + * @param {boolean} [siteEnvelope.httpsOnly] HttpsOnly: configures a web site + * to accept only https requests. Issues redirect for + * http requests + * + * @param {string} [siteEnvelope.kind] Kind of resource. + * + * @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 Site} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _update(resourceGroupName, name, siteEnvelope, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (siteEnvelope === null || siteEnvelope === undefined) { + throw new Error('siteEnvelope cannot be null or undefined.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'PATCH'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (siteEnvelope !== null && siteEnvelope !== undefined) { + let requestModelMapper = new client.models['SitePatchResource']().mapper(); + requestModel = client.serialize(requestModelMapper, siteEnvelope, 'siteEnvelope'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(siteEnvelope, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 202) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['Site']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + // Deserialize Response + if (statusCode === 202) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['Site']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError1 = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError1.request = msRest.stripRequest(httpRequest); + deserializationError1.response = msRest.stripResponse(response); + return callback(deserializationError1); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * @summary Analyze a custom hostname. + * + * Analyze a custom hostname. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.hostName] Custom hostname. + * + * @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 CustomHostnameAnalysisResult} 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 _analyzeCustomHostname(resourceGroupName, name, 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 hostName = (options && options.hostName !== undefined) ? options.hostName : undefined; + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (hostName !== null && hostName !== undefined && typeof hostName.valueOf() !== 'string') { + throw new Error('hostName must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/analyzeCustomHostname'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + if (hostName !== null && hostName !== undefined) { + queryParameters.push('hostName=' + encodeURIComponent(hostName)); + } + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['CustomHostnameAnalysisResult']().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 Applies the configuration settings from the target slot onto the + * current slot. + * + * Applies the configuration settings from the target slot onto the current + * slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} slotSwapEntity JSON object that contains the target slot + * name. See example. + * + * @param {string} slotSwapEntity.targetSlot Destination deployment slot during + * swap operation. + * + * @param {boolean} slotSwapEntity.preserveVnet true to preserve + * Virtual Network to the slot during swap; otherwise, false. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _applySlotConfigToProduction(resourceGroupName, name, slotSwapEntity, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (slotSwapEntity === null || slotSwapEntity === undefined) { + throw new Error('slotSwapEntity cannot be null or undefined.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/applySlotConfig'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + 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 (slotSwapEntity !== null && slotSwapEntity !== undefined) { + let requestModelMapper = new client.models['CsmSlotEntity']().mapper(); + requestModel = client.serialize(requestModelMapper, slotSwapEntity, 'slotSwapEntity'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(slotSwapEntity, 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; + + return callback(null, result, httpRequest, response); + }); +} + +/** + * @summary Creates a backup of an app. + * + * Creates a backup of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} request Backup configuration. You can use the JSON response + * from the POST action as input here. + * + * @param {string} [request.backupName] Name of the backup. + * + * @param {boolean} [request.enabled] True if the backup schedule is enabled + * (must be included in that case), false if the backup schedule should be + * disabled. + * + * @param {string} request.storageAccountUrl SAS URL to the container. + * + * @param {object} [request.backupSchedule] Schedule for the backup if it is + * executed periodically. + * + * @param {number} request.backupSchedule.frequencyInterval How often the + * backup should be executed (e.g. for weekly backup, this should be set to 7 + * and FrequencyUnit should be set to Day) + * + * @param {string} request.backupSchedule.frequencyUnit The unit of time for + * how often the backup should be executed (e.g. for weekly backup, this should + * be set to Day and FrequencyInterval should be set to 7). Possible values + * include: 'Day', 'Hour' + * + * @param {boolean} request.backupSchedule.keepAtLeastOneBackup True if the + * retention policy should always keep at least one backup in the storage + * account, regardless how old it is; false otherwise. + * + * @param {number} request.backupSchedule.retentionPeriodInDays After how many + * days backups should be deleted. + * + * @param {date} [request.backupSchedule.startTime] When the schedule should + * start working. + * + * @param {array} [request.databases] Databases included in the backup. + * + * @param {string} [request.kind] Kind of resource. + * + * @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 BackupItem} 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 _backup(resourceGroupName, name, request, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (request === null || request === undefined) { + throw new Error('request cannot be null or undefined.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/backup'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + 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 (request !== null && request !== undefined) { + let requestModelMapper = new client.models['BackupRequest']().mapper(); + requestModel = client.serialize(requestModelMapper, request, 'request'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(request, 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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['BackupItem']().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 existing backups of an app. + * + * Gets existing backups of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @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 BackupItemCollection} 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 _listBackups(resourceGroupName, name, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/backups'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['BackupItemCollection']().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 backup of an app by its ID. + * + * Gets a backup of an app by its ID. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} backupId ID of the backup. + * + * @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 BackupItem} 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 _getBackupStatus(resourceGroupName, name, backupId, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (backupId === null || backupId === undefined || typeof backupId.valueOf() !== 'string') { + throw new Error('backupId cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/backups/{backupId}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{backupId}', encodeURIComponent(backupId)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['BackupItem']().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 Deletes a backup of an app by its ID. + * + * Deletes a backup of an app by its ID. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} backupId ID of the backup. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _deleteBackup(resourceGroupName, name, backupId, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (backupId === null || backupId === undefined || typeof backupId.valueOf() !== 'string') { + throw new Error('backupId cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/backups/{backupId}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{backupId}', encodeURIComponent(backupId)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'DELETE'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 404) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + + return callback(null, result, httpRequest, response); + }); +} + +/** + * @summary Gets status of a web app backup that may be in progress, including + * secrets associated with the backup, such as the Azure Storage SAS URL. Also + * can be used to update the SAS URL for the backup if a new URL is passed in + * the request body. + * + * Gets status of a web app backup that may be in progress, including secrets + * associated with the backup, such as the Azure Storage SAS URL. Also can be + * used to update the SAS URL for the backup if a new URL is passed in the + * request body. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {string} backupId ID of backup. + * + * @param {object} request Information on backup request. + * + * @param {string} [request.backupName] Name of the backup. + * + * @param {boolean} [request.enabled] True if the backup schedule is enabled + * (must be included in that case), false if the backup schedule should be + * disabled. + * + * @param {string} request.storageAccountUrl SAS URL to the container. + * + * @param {object} [request.backupSchedule] Schedule for the backup if it is + * executed periodically. + * + * @param {number} request.backupSchedule.frequencyInterval How often the + * backup should be executed (e.g. for weekly backup, this should be set to 7 + * and FrequencyUnit should be set to Day) + * + * @param {string} request.backupSchedule.frequencyUnit The unit of time for + * how often the backup should be executed (e.g. for weekly backup, this should + * be set to Day and FrequencyInterval should be set to 7). Possible values + * include: 'Day', 'Hour' + * + * @param {boolean} request.backupSchedule.keepAtLeastOneBackup True if the + * retention policy should always keep at least one backup in the storage + * account, regardless how old it is; false otherwise. + * + * @param {number} request.backupSchedule.retentionPeriodInDays After how many + * days backups should be deleted. + * + * @param {date} [request.backupSchedule.startTime] When the schedule should + * start working. + * + * @param {array} [request.databases] Databases included in the backup. + * + * @param {string} [request.kind] Kind of resource. + * + * @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 BackupItem} 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 _listBackupStatusSecrets(resourceGroupName, name, backupId, request, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (backupId === null || backupId === undefined || typeof backupId.valueOf() !== 'string') { + throw new Error('backupId cannot be null or undefined and it must be of type string.'); + } + if (request === null || request === undefined) { + throw new Error('request cannot be null or undefined.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/backups/{backupId}/list'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{backupId}', encodeURIComponent(backupId)); + 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 (request !== null && request !== undefined) { + let requestModelMapper = new client.models['BackupRequest']().mapper(); + requestModel = client.serialize(requestModelMapper, request, 'request'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(request, 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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['BackupItem']().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 Restores a specific backup to another app (or deployment slot, if + * specified). + * + * Restores a specific backup to another app (or deployment slot, if + * specified). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} backupId ID of the backup. + * + * @param {object} request Information on restore request . + * + * @param {string} request.storageAccountUrl SAS URL to the container. + * + * @param {string} [request.blobName] Name of a blob which contains the backup. + * + * @param {boolean} request.overwrite true if the restore + * operation can overwrite target app; otherwise, false. + * true is needed if trying to restore over an existing app. + * + * @param {string} [request.siteName] Name of an app. + * + * @param {array} [request.databases] Collection of databases which should be + * restored. This list has to match the list of databases included in the + * backup. + * + * @param {boolean} [request.ignoreConflictingHostNames] Changes a logic when + * restoring an app with custom domains. true to remove custom + * domains automatically. If false, custom domains are added to + * the app's object when it is being restored, but that might fail due to + * conflicts during the operation. + * + * @param {boolean} [request.ignoreDatabases] Ignore the databases and only + * restore the site content + * + * @param {string} [request.appServicePlan] Specify app service plan that will + * own restored site. + * + * @param {string} [request.operationType] Operation type. Possible values + * include: 'Default', 'Clone', 'Relocation', 'Snapshot', 'CloudFS' + * + * @param {boolean} [request.adjustConnectionStrings] true if + * SiteConfig.ConnectionStrings should be set in new app; otherwise, + * false. + * + * @param {string} [request.hostingEnvironment] App Service Environment name, + * if needed (only when restoring an app to an App Service Environment). + * + * @param {string} [request.kind] Kind of resource. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _restore(resourceGroupName, name, backupId, request, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + + if (!callback) { + throw new Error('callback cannot be null.'); + } + + // Send request + this.beginRestore(resourceGroupName, name, backupId, request, options, (err, parsedResult, httpRequest, response) => { + if (err) return callback(err); + + let initialResult = new msRest.HttpOperationResponse(); + initialResult.request = httpRequest; + initialResult.response = response; + initialResult.body = response.body; + client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { + if (err) return callback(err); + + // Create Result + let result = null; + + httpRequest = pollingResult.request; + response = pollingResult.response; + let responseBody = pollingResult.body; + if (responseBody === '') responseBody = null; + + // Deserialize Response + + return callback(null, result, httpRequest, response); + }); + }); +} + +/** + * @summary List the configurations of an app + * + * List the configurations of an app + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @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 SiteConfigResourceCollection} 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 _listConfigurations(resourceGroupName, name, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['SiteConfigResourceCollection']().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 Replaces the application settings of an app. + * + * Replaces the application settings of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} appSettings Application settings of the app. + * + * @param {object} [appSettings.properties] Settings. + * + * @param {string} [appSettings.kind] Kind of resource. + * + * @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 StringDictionary} 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 _updateApplicationSettings(resourceGroupName, name, appSettings, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (appSettings === null || appSettings === undefined) { + throw new Error('appSettings cannot be null or undefined.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/appsettings'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'PUT'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (appSettings !== null && appSettings !== undefined) { + let requestModelMapper = new client.models['StringDictionary']().mapper(); + requestModel = client.serialize(requestModelMapper, appSettings, 'appSettings'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(appSettings, 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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['StringDictionary']().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 the application settings of an app. + * + * Gets the application settings of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @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 StringDictionary} 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 _listApplicationSettings(resourceGroupName, name, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/appsettings/list'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + 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]; + } + } + } + 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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['StringDictionary']().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 Updates the Authentication / Authorization settings associated with + * web app. + * + * Updates the Authentication / Authorization settings associated with web app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {object} siteAuthSettings Auth settings associated with web app. + * + * @param {boolean} [siteAuthSettings.enabled] true if the + * Authentication / Authorization feature is enabled for the current app; + * otherwise, false. + * + * @param {string} [siteAuthSettings.runtimeVersion] The RuntimeVersion of the + * Authentication / Authorization feature in use for the current app. + * The setting in this value can control the behavior of certain features in + * the Authentication / Authorization module. + * + * @param {string} [siteAuthSettings.unauthenticatedClientAction] The action to + * take when an unauthenticated client attempts to access the app. Possible + * values include: 'RedirectToLoginPage', 'AllowAnonymous' + * + * @param {boolean} [siteAuthSettings.tokenStoreEnabled] true to + * durably store platform-specific security tokens that are obtained during + * login flows; otherwise, false. + * The default is false. + * + * @param {array} [siteAuthSettings.allowedExternalRedirectUrls] External URLs + * that can be redirected to as part of logging in or logging out of the app. + * Note that the query string part of the URL is ignored. + * This is an advanced setting typically only needed by Windows Store + * application backends. + * Note that URLs within the current domain are always implicitly allowed. + * + * @param {string} [siteAuthSettings.defaultProvider] The default + * authentication provider to use when multiple providers are configured. + * This setting is only needed if multiple providers are configured and the + * unauthenticated client + * action is set to "RedirectToLoginPage". Possible values include: + * 'AzureActiveDirectory', 'Facebook', 'Google', 'MicrosoftAccount', 'Twitter' + * + * @param {number} [siteAuthSettings.tokenRefreshExtensionHours] The number of + * hours after session token expiration that a session token can be used to + * call the token refresh API. The default is 72 hours. + * + * @param {string} [siteAuthSettings.clientId] The Client ID of this relying + * party application, known as the client_id. + * This setting is required for enabling OpenID Connection authentication with + * Azure Active Directory or + * other 3rd party OpenID Connect providers. + * More information on OpenID Connect: + * http://openid.net/specs/openid-connect-core-1_0.html + * + * @param {string} [siteAuthSettings.clientSecret] The Client Secret of this + * relying party application (in Azure Active Directory, this is also referred + * to as the Key). + * This setting is optional. If no client secret is configured, the OpenID + * Connect implicit auth flow is used to authenticate end users. + * Otherwise, the OpenID Connect Authorization Code Flow is used to + * authenticate end users. + * More information on OpenID Connect: + * http://openid.net/specs/openid-connect-core-1_0.html + * + * @param {string} [siteAuthSettings.issuer] The OpenID Connect Issuer URI that + * represents the entity which issues access tokens for this application. + * When using Azure Active Directory, this value is the URI of the directory + * tenant, e.g. https://sts.windows.net/{tenant-guid}/. + * This URI is a case-sensitive identifier for the token issuer. + * More information on OpenID Connect Discovery: + * http://openid.net/specs/openid-connect-discovery-1_0.html + * + * @param {boolean} [siteAuthSettings.validateIssuer] Gets a value indicating + * whether the issuer should be a valid HTTPS url and be validated as such. + * + * @param {array} [siteAuthSettings.allowedAudiences] Allowed audience values + * to consider when validating JWTs issued by + * Azure Active Directory. Note that the ClientID value is always + * considered an + * allowed audience, regardless of this setting. + * + * @param {array} [siteAuthSettings.additionalLoginParams] Login parameters to + * send to the OpenID Connect authorization endpoint when + * a user logs in. Each parameter must be in the form "key=value". + * + * @param {string} [siteAuthSettings.googleClientId] The OpenID Connect Client + * ID for the Google web application. + * This setting is required for enabling Google Sign-In. + * Google Sign-In documentation: + * https://developers.google.com/identity/sign-in/web/ + * + * @param {string} [siteAuthSettings.googleClientSecret] The client secret + * associated with the Google web application. + * This setting is required for enabling Google Sign-In. + * Google Sign-In documentation: + * https://developers.google.com/identity/sign-in/web/ + * + * @param {array} [siteAuthSettings.googleOAuthScopes] The OAuth 2.0 scopes + * that will be requested as part of Google Sign-In authentication. + * This setting is optional. If not specified, "openid", "profile", and "email" + * are used as default scopes. + * Google Sign-In documentation: + * https://developers.google.com/identity/sign-in/web/ + * + * @param {string} [siteAuthSettings.facebookAppId] The App ID of the Facebook + * app used for login. + * This setting is required for enabling Facebook Login. + * Facebook Login documentation: + * https://developers.facebook.com/docs/facebook-login + * + * @param {string} [siteAuthSettings.facebookAppSecret] The App Secret of the + * Facebook app used for Facebook Login. + * This setting is required for enabling Facebook Login. + * Facebook Login documentation: + * https://developers.facebook.com/docs/facebook-login + * + * @param {array} [siteAuthSettings.facebookOAuthScopes] The OAuth 2.0 scopes + * that will be requested as part of Facebook Login authentication. + * This setting is optional. + * Facebook Login documentation: + * https://developers.facebook.com/docs/facebook-login + * + * @param {string} [siteAuthSettings.twitterConsumerKey] The OAuth 1.0a + * consumer key of the Twitter application used for sign-in. + * This setting is required for enabling Twitter Sign-In. + * Twitter Sign-In documentation: https://dev.twitter.com/web/sign-in + * + * @param {string} [siteAuthSettings.twitterConsumerSecret] The OAuth 1.0a + * consumer secret of the Twitter application used for sign-in. + * This setting is required for enabling Twitter Sign-In. + * Twitter Sign-In documentation: https://dev.twitter.com/web/sign-in + * + * @param {string} [siteAuthSettings.microsoftAccountClientId] The OAuth 2.0 + * client ID that was created for the app used for authentication. + * This setting is required for enabling Microsoft Account authentication. + * Microsoft Account OAuth documentation: + * https://dev.onedrive.com/auth/msa_oauth.htm + * + * @param {string} [siteAuthSettings.microsoftAccountClientSecret] The OAuth + * 2.0 client secret that was created for the app used for authentication. + * This setting is required for enabling Microsoft Account authentication. + * Microsoft Account OAuth documentation: + * https://dev.onedrive.com/auth/msa_oauth.htm + * + * @param {array} [siteAuthSettings.microsoftAccountOAuthScopes] The OAuth 2.0 + * scopes that will be requested as part of Microsoft Account authentication. + * This setting is optional. If not specified, "wl.basic" is used as the + * default scope. + * Microsoft Account Scopes and permissions documentation: + * https://msdn.microsoft.com/en-us/library/dn631845.aspx + * + * @param {string} [siteAuthSettings.kind] Kind of resource. + * + * @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 SiteAuthSettings} 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 _updateAuthSettings(resourceGroupName, name, siteAuthSettings, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (siteAuthSettings === null || siteAuthSettings === undefined) { + throw new Error('siteAuthSettings cannot be null or undefined.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/authsettings'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'PUT'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (siteAuthSettings !== null && siteAuthSettings !== undefined) { + let requestModelMapper = new client.models['SiteAuthSettings']().mapper(); + requestModel = client.serialize(requestModelMapper, siteAuthSettings, 'siteAuthSettings'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(siteAuthSettings, 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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['SiteAuthSettings']().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 the Authentication/Authorization settings of an app. + * + * Gets the Authentication/Authorization settings of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @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 SiteAuthSettings} 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 _getAuthSettings(resourceGroupName, name, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/authsettings/list'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + 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]; + } + } + } + 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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['SiteAuthSettings']().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 Updates the Azure storage account configurations of an app. + * + * Updates the Azure storage account configurations of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} azureStorageAccounts Azure storage accounts of the app. + * + * @param {object} [azureStorageAccounts.properties] Azure storage accounts. + * + * @param {string} [azureStorageAccounts.kind] Kind of resource. + * + * @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 AzureStoragePropertyDictionaryResource} 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 _updateAzureStorageAccounts(resourceGroupName, name, azureStorageAccounts, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (azureStorageAccounts === null || azureStorageAccounts === undefined) { + throw new Error('azureStorageAccounts cannot be null or undefined.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/azurestorageaccounts'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'PUT'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (azureStorageAccounts !== null && azureStorageAccounts !== undefined) { + let requestModelMapper = new client.models['AzureStoragePropertyDictionaryResource']().mapper(); + requestModel = client.serialize(requestModelMapper, azureStorageAccounts, 'azureStorageAccounts'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(azureStorageAccounts, 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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['AzureStoragePropertyDictionaryResource']().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 the Azure storage account configurations of an app. + * + * Gets the Azure storage account configurations of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @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 AzureStoragePropertyDictionaryResource} 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 _listAzureStorageAccounts(resourceGroupName, name, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/azurestorageaccounts/list'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + 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]; + } + } + } + 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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['AzureStoragePropertyDictionaryResource']().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 Updates the backup configuration of an app. + * + * Updates the backup configuration of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} request Edited backup configuration. + * + * @param {string} [request.backupName] Name of the backup. + * + * @param {boolean} [request.enabled] True if the backup schedule is enabled + * (must be included in that case), false if the backup schedule should be + * disabled. + * + * @param {string} request.storageAccountUrl SAS URL to the container. + * + * @param {object} [request.backupSchedule] Schedule for the backup if it is + * executed periodically. + * + * @param {number} request.backupSchedule.frequencyInterval How often the + * backup should be executed (e.g. for weekly backup, this should be set to 7 + * and FrequencyUnit should be set to Day) + * + * @param {string} request.backupSchedule.frequencyUnit The unit of time for + * how often the backup should be executed (e.g. for weekly backup, this should + * be set to Day and FrequencyInterval should be set to 7). Possible values + * include: 'Day', 'Hour' + * + * @param {boolean} request.backupSchedule.keepAtLeastOneBackup True if the + * retention policy should always keep at least one backup in the storage + * account, regardless how old it is; false otherwise. + * + * @param {number} request.backupSchedule.retentionPeriodInDays After how many + * days backups should be deleted. + * + * @param {date} [request.backupSchedule.startTime] When the schedule should + * start working. + * + * @param {array} [request.databases] Databases included in the backup. + * + * @param {string} [request.kind] Kind of resource. + * + * @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 BackupRequest} 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 _updateBackupConfiguration(resourceGroupName, name, request, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (request === null || request === undefined) { + throw new Error('request cannot be null or undefined.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/backup'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'PUT'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (request !== null && request !== undefined) { + let requestModelMapper = new client.models['BackupRequest']().mapper(); + requestModel = client.serialize(requestModelMapper, request, 'request'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(request, 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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['BackupRequest']().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 Deletes the backup configuration of an app. + * + * Deletes the backup configuration of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _deleteBackupConfiguration(resourceGroupName, name, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/backup'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'DELETE'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + + return callback(null, result, httpRequest, response); + }); +} + +/** + * @summary Gets the backup configuration of an app. + * + * Gets the backup configuration of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @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 BackupRequest} 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 _getBackupConfiguration(resourceGroupName, name, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/backup/list'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + 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]; + } + } + } + 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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['BackupRequest']().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 Replaces the connection strings of an app. + * + * Replaces the connection strings of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} connectionStrings Connection strings of the app or + * deployment slot. See example. + * + * @param {object} [connectionStrings.properties] Connection strings. + * + * @param {string} [connectionStrings.kind] Kind of resource. + * + * @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 ConnectionStringDictionary} 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 _updateConnectionStrings(resourceGroupName, name, connectionStrings, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (connectionStrings === null || connectionStrings === undefined) { + throw new Error('connectionStrings cannot be null or undefined.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/connectionstrings'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'PUT'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (connectionStrings !== null && connectionStrings !== undefined) { + let requestModelMapper = new client.models['ConnectionStringDictionary']().mapper(); + requestModel = client.serialize(requestModelMapper, connectionStrings, 'connectionStrings'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(connectionStrings, 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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['ConnectionStringDictionary']().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 the connection strings of an app. + * + * Gets the connection strings of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @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 ConnectionStringDictionary} 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 _listConnectionStrings(resourceGroupName, name, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/connectionstrings/list'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + 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]; + } + } + } + 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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['ConnectionStringDictionary']().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 the logging configuration of an app. + * + * Gets the logging configuration of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @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 SiteLogsConfig} 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 _getDiagnosticLogsConfiguration(resourceGroupName, name, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/logs'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['SiteLogsConfig']().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 Updates the logging configuration of an app. + * + * Updates the logging configuration of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} siteLogsConfig A SiteLogsConfig JSON object that contains + * the logging configuration to change in the "properties" property. + * + * @param {object} [siteLogsConfig.applicationLogs] Application logs + * configuration. + * + * @param {object} [siteLogsConfig.applicationLogs.fileSystem] Application logs + * to file system configuration. + * + * @param {string} [siteLogsConfig.applicationLogs.fileSystem.level] Log level. + * Possible values include: 'Off', 'Verbose', 'Information', 'Warning', 'Error' + * + * @param {object} [siteLogsConfig.applicationLogs.azureTableStorage] + * Application logs to azure table storage configuration. + * + * @param {string} [siteLogsConfig.applicationLogs.azureTableStorage.level] Log + * level. Possible values include: 'Off', 'Verbose', 'Information', 'Warning', + * 'Error' + * + * @param {string} siteLogsConfig.applicationLogs.azureTableStorage.sasUrl SAS + * URL to an Azure table with add/query/delete permissions. + * + * @param {object} [siteLogsConfig.applicationLogs.azureBlobStorage] + * Application logs to blob storage configuration. + * + * @param {string} [siteLogsConfig.applicationLogs.azureBlobStorage.level] Log + * level. Possible values include: 'Off', 'Verbose', 'Information', 'Warning', + * 'Error' + * + * @param {string} [siteLogsConfig.applicationLogs.azureBlobStorage.sasUrl] SAS + * url to a azure blob container with read/write/list/delete permissions. + * + * @param {number} + * [siteLogsConfig.applicationLogs.azureBlobStorage.retentionInDays] Retention + * in days. + * Remove blobs older than X days. + * 0 or lower means no retention. + * + * @param {object} [siteLogsConfig.httpLogs] HTTP logs configuration. + * + * @param {object} [siteLogsConfig.httpLogs.fileSystem] Http logs to file + * system configuration. + * + * @param {number} [siteLogsConfig.httpLogs.fileSystem.retentionInMb] Maximum + * size in megabytes that http log files can use. + * When reached old log files will be removed to make space for new ones. + * Value can range between 25 and 100. + * + * @param {number} [siteLogsConfig.httpLogs.fileSystem.retentionInDays] + * Retention in days. + * Remove files older than X days. + * 0 or lower means no retention. + * + * @param {boolean} [siteLogsConfig.httpLogs.fileSystem.enabled] True if + * configuration is enabled, false if it is disabled and null if configuration + * is not set. + * + * @param {object} [siteLogsConfig.httpLogs.azureBlobStorage] Http logs to + * azure blob storage configuration. + * + * @param {string} [siteLogsConfig.httpLogs.azureBlobStorage.sasUrl] SAS url to + * a azure blob container with read/write/list/delete permissions. + * + * @param {number} [siteLogsConfig.httpLogs.azureBlobStorage.retentionInDays] + * Retention in days. + * Remove blobs older than X days. + * 0 or lower means no retention. + * + * @param {boolean} [siteLogsConfig.httpLogs.azureBlobStorage.enabled] True if + * configuration is enabled, false if it is disabled and null if configuration + * is not set. + * + * @param {object} [siteLogsConfig.failedRequestsTracing] Failed requests + * tracing configuration. + * + * @param {object} [siteLogsConfig.detailedErrorMessages] Detailed error + * messages configuration. + * + * @param {boolean} [siteLogsConfig.detailedErrorMessages.enabled] True if + * configuration is enabled, false if it is disabled and null if configuration + * is not set. + * + * @param {string} [siteLogsConfig.kind] Kind of resource. + * + * @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 SiteLogsConfig} 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 _updateDiagnosticLogsConfig(resourceGroupName, name, siteLogsConfig, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (siteLogsConfig === null || siteLogsConfig === undefined) { + throw new Error('siteLogsConfig cannot be null or undefined.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/logs'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'PUT'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (siteLogsConfig !== null && siteLogsConfig !== undefined) { + let requestModelMapper = new client.models['SiteLogsConfig']().mapper(); + requestModel = client.serialize(requestModelMapper, siteLogsConfig, 'siteLogsConfig'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(siteLogsConfig, 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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['SiteLogsConfig']().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 Replaces the metadata of an app. + * + * Replaces the metadata of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} metadata Edited metadata of the app or deployment slot. See + * example. + * + * @param {object} [metadata.properties] Settings. + * + * @param {string} [metadata.kind] Kind of resource. + * + * @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 StringDictionary} 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 _updateMetadata(resourceGroupName, name, metadata, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (metadata === null || metadata === undefined) { + throw new Error('metadata cannot be null or undefined.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/metadata'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'PUT'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (metadata !== null && metadata !== undefined) { + let requestModelMapper = new client.models['StringDictionary']().mapper(); + requestModel = client.serialize(requestModelMapper, metadata, 'metadata'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(metadata, 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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['StringDictionary']().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 the metadata of an app. + * + * Gets the metadata of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @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 StringDictionary} 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 _listMetadata(resourceGroupName, name, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/metadata/list'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + 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]; + } + } + } + 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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['StringDictionary']().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 the Git/FTP publishing credentials of an app. + * + * Gets the Git/FTP publishing credentials of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @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 User} 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 _listPublishingCredentials(resourceGroupName, name, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + + if (!callback) { + throw new Error('callback cannot be null.'); + } + + // Send request + this.beginListPublishingCredentials(resourceGroupName, name, options, (err, parsedResult, httpRequest, response) => { + if (err) return callback(err); + + let initialResult = new msRest.HttpOperationResponse(); + initialResult.request = httpRequest; + initialResult.response = response; + initialResult.body = response.body; + client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { + if (err) return callback(err); + + // Create Result + let result = null; + + httpRequest = pollingResult.request; + response = pollingResult.response; + let responseBody = pollingResult.body; + if (responseBody === '') responseBody = null; + + // Deserialize Response + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['User']().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 Updates the Push settings associated with web app. + * + * Updates the Push settings associated with web app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {object} pushSettings Push settings associated with web app. + * + * @param {boolean} pushSettings.isPushEnabled Gets or sets a flag indicating + * whether the Push endpoint is enabled. + * + * @param {string} [pushSettings.tagWhitelistJson] Gets or sets a JSON string + * containing a list of tags that are whitelisted for use by the push + * registration endpoint. + * + * @param {string} [pushSettings.tagsRequiringAuth] Gets or sets a JSON string + * containing a list of tags that require user authentication to be used in the + * push registration endpoint. + * Tags can consist of alphanumeric characters and the following: + * '_', '@', '#', '.', ':', '-'. + * Validation should be performed at the PushRequestHandler. + * + * @param {string} [pushSettings.dynamicTagsJson] Gets or sets a JSON string + * containing a list of dynamic tags that will be evaluated from user claims in + * the push registration endpoint. + * + * @param {string} [pushSettings.kind] Kind of resource. + * + * @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 PushSettings} 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 _updateSitePushSettings(resourceGroupName, name, pushSettings, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (pushSettings === null || pushSettings === undefined) { + throw new Error('pushSettings cannot be null or undefined.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/pushsettings'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'PUT'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (pushSettings !== null && pushSettings !== undefined) { + let requestModelMapper = new client.models['PushSettings']().mapper(); + requestModel = client.serialize(requestModelMapper, pushSettings, 'pushSettings'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(pushSettings, 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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['PushSettings']().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 the Push settings associated with web app. + * + * Gets the Push settings associated with web app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @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 PushSettings} 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 _listSitePushSettings(resourceGroupName, name, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/pushsettings/list'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + 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]; + } + } + } + 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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['PushSettings']().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 the names of app settings and connection strings that stick to + * the slot (not swapped). + * + * Gets the names of app settings and connection strings that stick to the slot + * (not swapped). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @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 SlotConfigNamesResource} 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 _listSlotConfigurationNames(resourceGroupName, name, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/slotConfigNames'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['SlotConfigNamesResource']().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 Updates the names of application settings and connection string + * that remain with the slot during swap operation. + * + * Updates the names of application settings and connection string that remain + * with the slot during swap operation. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} slotConfigNames Names of application settings and connection + * strings. See example. + * + * @param {array} [slotConfigNames.connectionStringNames] List of connection + * string names. + * + * @param {array} [slotConfigNames.appSettingNames] List of application + * settings names. + * + * @param {array} [slotConfigNames.azureStorageConfigNames] List of external + * Azure storage account identifiers. + * + * @param {string} [slotConfigNames.kind] Kind of resource. + * + * @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 SlotConfigNamesResource} 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 _updateSlotConfigurationNames(resourceGroupName, name, slotConfigNames, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (slotConfigNames === null || slotConfigNames === undefined) { + throw new Error('slotConfigNames cannot be null or undefined.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/slotConfigNames'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'PUT'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (slotConfigNames !== null && slotConfigNames !== undefined) { + let requestModelMapper = new client.models['SlotConfigNamesResource']().mapper(); + requestModel = client.serialize(requestModelMapper, slotConfigNames, 'slotConfigNames'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(slotConfigNames, 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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['SlotConfigNamesResource']().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 Swift Virtual Network connection. + * + * Gets a Swift Virtual Network connection. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @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 SwiftVirtualNetwork} 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 _getSwiftVirtualNetworkConnection(resourceGroupName, name, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/virtualNetwork'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['SwiftVirtualNetwork']().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 Integrates this Web App with a Virtual Network. This requires that + * 1) "swiftSupported" is true when doing a GET against this resource, and 2) + * that the target Subnet has already been delegated, and is not + * in use by another App Service Plan other than the one this App is in. + * + * Integrates this Web App with a Virtual Network. This requires that 1) + * "swiftSupported" is true when doing a GET against this resource, and 2) that + * the target Subnet has already been delegated, and is not + * in use by another App Service Plan other than the one this App is in. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} connectionEnvelope Properties of the Virtual Network + * connection. See example. + * + * @param {string} [connectionEnvelope.subnetResourceId] The Virtual Network + * subnet's resource ID. This is the subnet that this Web App will join. This + * subnet must have a delegation to Microsoft.Web/serverFarms defined first. + * + * @param {boolean} [connectionEnvelope.swiftSupported] A flag that specifies + * if the scale unit this Web App is on supports Swift integration. + * + * @param {string} [connectionEnvelope.kind] Kind of resource. + * + * @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 SwiftVirtualNetwork} 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 _createOrUpdateSwiftVirtualNetworkConnection(resourceGroupName, name, connectionEnvelope, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (connectionEnvelope === null || connectionEnvelope === undefined) { + throw new Error('connectionEnvelope cannot be null or undefined.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/virtualNetwork'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'PUT'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (connectionEnvelope !== null && connectionEnvelope !== undefined) { + let requestModelMapper = new client.models['SwiftVirtualNetwork']().mapper(); + requestModel = client.serialize(requestModelMapper, connectionEnvelope, 'connectionEnvelope'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(connectionEnvelope, 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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['SwiftVirtualNetwork']().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 Deletes a Swift Virtual Network connection from an app (or + * deployment slot). + * + * Deletes a Swift Virtual Network connection from an app (or deployment slot). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _deleteSwiftVirtualNetwork(resourceGroupName, name, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/virtualNetwork'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'DELETE'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 404) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + + return callback(null, result, httpRequest, response); + }); +} + +/** + * @summary Integrates this Web App with a Virtual Network. This requires that + * 1) "swiftSupported" is true when doing a GET against this resource, and 2) + * that the target Subnet has already been delegated, and is not + * in use by another App Service Plan other than the one this App is in. + * + * Integrates this Web App with a Virtual Network. This requires that 1) + * "swiftSupported" is true when doing a GET against this resource, and 2) that + * the target Subnet has already been delegated, and is not + * in use by another App Service Plan other than the one this App is in. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} connectionEnvelope Properties of the Virtual Network + * connection. See example. + * + * @param {string} [connectionEnvelope.subnetResourceId] The Virtual Network + * subnet's resource ID. This is the subnet that this Web App will join. This + * subnet must have a delegation to Microsoft.Web/serverFarms defined first. + * + * @param {boolean} [connectionEnvelope.swiftSupported] A flag that specifies + * if the scale unit this Web App is on supports Swift integration. + * + * @param {string} [connectionEnvelope.kind] Kind of resource. + * + * @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 SwiftVirtualNetwork} 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 _updateSwiftVirtualNetworkConnection(resourceGroupName, name, connectionEnvelope, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (connectionEnvelope === null || connectionEnvelope === undefined) { + throw new Error('connectionEnvelope cannot be null or undefined.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/virtualNetwork'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'PATCH'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (connectionEnvelope !== null && connectionEnvelope !== undefined) { + let requestModelMapper = new client.models['SwiftVirtualNetwork']().mapper(); + requestModel = client.serialize(requestModelMapper, connectionEnvelope, 'connectionEnvelope'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(connectionEnvelope, 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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['SwiftVirtualNetwork']().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 the configuration of an app, such as platform version and + * bitness, default documents, virtual applications, Always On, etc. + * + * Gets the configuration of an app, such as platform version and bitness, + * default documents, virtual applications, Always On, etc. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @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 SiteConfigResource} 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 _getConfiguration(resourceGroupName, name, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/web'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['SiteConfigResource']().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 Updates the configuration of an app. + * + * Updates the configuration of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} siteConfig JSON representation of a SiteConfig object. See + * example. + * + * @param {number} [siteConfig.numberOfWorkers] Number of workers. + * + * @param {array} [siteConfig.defaultDocuments] Default documents. + * + * @param {string} [siteConfig.netFrameworkVersion] .NET Framework version. + * + * @param {string} [siteConfig.phpVersion] Version of PHP. + * + * @param {string} [siteConfig.pythonVersion] Version of Python. + * + * @param {string} [siteConfig.nodeVersion] Version of Node.js. + * + * @param {string} [siteConfig.linuxFxVersion] Linux App Framework and version + * + * @param {string} [siteConfig.windowsFxVersion] Xenon App Framework and + * version + * + * @param {boolean} [siteConfig.requestTracingEnabled] true if + * request tracing is enabled; otherwise, false. + * + * @param {date} [siteConfig.requestTracingExpirationTime] Request tracing + * expiration time. + * + * @param {boolean} [siteConfig.remoteDebuggingEnabled] true if + * remote debugging is enabled; otherwise, false. + * + * @param {string} [siteConfig.remoteDebuggingVersion] Remote debugging + * version. + * + * @param {boolean} [siteConfig.httpLoggingEnabled] true if HTTP + * logging is enabled; otherwise, false. + * + * @param {number} [siteConfig.logsDirectorySizeLimit] HTTP logs directory size + * limit. + * + * @param {boolean} [siteConfig.detailedErrorLoggingEnabled] true + * if detailed error logging is enabled; otherwise, false. + * + * @param {string} [siteConfig.publishingUsername] Publishing user name. + * + * @param {array} [siteConfig.appSettings] Application settings. + * + * @param {object} [siteConfig.azureStorageAccounts] User-provided Azure + * storage accounts. + * + * @param {array} [siteConfig.connectionStrings] Connection strings. + * + * @param {array} [siteConfig.handlerMappings] Handler mappings. + * + * @param {string} [siteConfig.documentRoot] Document root. + * + * @param {string} [siteConfig.scmType] SCM type. Possible values include: + * 'None', 'Dropbox', 'Tfs', 'LocalGit', 'GitHub', 'CodePlexGit', 'CodePlexHg', + * 'BitbucketGit', 'BitbucketHg', 'ExternalGit', 'ExternalHg', 'OneDrive', + * 'VSO' + * + * @param {boolean} [siteConfig.use32BitWorkerProcess] true to use + * 32-bit worker process; otherwise, false. + * + * @param {boolean} [siteConfig.webSocketsEnabled] true if + * WebSocket is enabled; otherwise, false. + * + * @param {boolean} [siteConfig.alwaysOn] true if Always On is + * enabled; otherwise, false. + * + * @param {string} [siteConfig.javaVersion] Java version. + * + * @param {string} [siteConfig.javaContainer] Java container. + * + * @param {string} [siteConfig.javaContainerVersion] Java container version. + * + * @param {string} [siteConfig.appCommandLine] App command line to launch. + * + * @param {string} [siteConfig.managedPipelineMode] Managed pipeline mode. + * Possible values include: 'Integrated', 'Classic' + * + * @param {array} [siteConfig.virtualApplications] Virtual applications. + * + * @param {string} [siteConfig.loadBalancing] Site load balancing. Possible + * values include: 'WeightedRoundRobin', 'LeastRequests', 'LeastResponseTime', + * 'WeightedTotalTraffic', 'RequestHash' + * + * @param {object} [siteConfig.experiments] This is work around for polymophic + * types. + * + * @param {array} [siteConfig.experiments.rampUpRules] List of ramp-up rules. + * + * @param {object} [siteConfig.limits] Site limits. + * + * @param {number} [siteConfig.limits.maxPercentageCpu] Maximum allowed CPU + * usage percentage. + * + * @param {number} [siteConfig.limits.maxMemoryInMb] Maximum allowed memory + * usage in MB. + * + * @param {number} [siteConfig.limits.maxDiskSizeInMb] Maximum allowed disk + * size usage in MB. + * + * @param {boolean} [siteConfig.autoHealEnabled] true if Auto Heal + * is enabled; otherwise, false. + * + * @param {object} [siteConfig.autoHealRules] Auto Heal rules. + * + * @param {object} [siteConfig.autoHealRules.triggers] Conditions that describe + * when to execute the auto-heal actions. + * + * @param {object} [siteConfig.autoHealRules.triggers.requests] A rule based on + * total requests. + * + * @param {number} [siteConfig.autoHealRules.triggers.requests.count] Request + * Count. + * + * @param {string} [siteConfig.autoHealRules.triggers.requests.timeInterval] + * Time interval. + * + * @param {number} [siteConfig.autoHealRules.triggers.privateBytesInKB] A rule + * based on private bytes. + * + * @param {array} [siteConfig.autoHealRules.triggers.statusCodes] A rule based + * on status codes. + * + * @param {object} [siteConfig.autoHealRules.triggers.slowRequests] A rule + * based on request execution time. + * + * @param {string} [siteConfig.autoHealRules.triggers.slowRequests.timeTaken] + * Time taken. + * + * @param {number} [siteConfig.autoHealRules.triggers.slowRequests.count] + * Request Count. + * + * @param {string} + * [siteConfig.autoHealRules.triggers.slowRequests.timeInterval] Time interval. + * + * @param {object} [siteConfig.autoHealRules.actions] Actions to be executed + * when a rule is triggered. + * + * @param {string} [siteConfig.autoHealRules.actions.actionType] Predefined + * action to be taken. Possible values include: 'Recycle', 'LogEvent', + * 'CustomAction' + * + * @param {object} [siteConfig.autoHealRules.actions.customAction] Custom + * action to be taken. + * + * @param {string} [siteConfig.autoHealRules.actions.customAction.exe] + * Executable to be run. + * + * @param {string} [siteConfig.autoHealRules.actions.customAction.parameters] + * Parameters for the executable. + * + * @param {string} [siteConfig.autoHealRules.actions.minProcessExecutionTime] + * Minimum time the process must execute + * before taking the action + * + * @param {string} [siteConfig.tracingOptions] Tracing options. + * + * @param {string} [siteConfig.vnetName] Virtual Network name. + * + * @param {object} [siteConfig.cors] Cross-Origin Resource Sharing (CORS) + * settings. + * + * @param {array} [siteConfig.cors.allowedOrigins] Gets or sets the list of + * origins that should be allowed to make cross-origin + * calls (for example: http://example.com:12345). Use "*" to allow all. + * + * @param {object} [siteConfig.push] Push endpoint settings. + * + * @param {boolean} siteConfig.push.isPushEnabled Gets or sets a flag + * indicating whether the Push endpoint is enabled. + * + * @param {string} [siteConfig.push.tagWhitelistJson] Gets or sets a JSON + * string containing a list of tags that are whitelisted for use by the push + * registration endpoint. + * + * @param {string} [siteConfig.push.tagsRequiringAuth] Gets or sets a JSON + * string containing a list of tags that require user authentication to be used + * in the push registration endpoint. + * Tags can consist of alphanumeric characters and the following: + * '_', '@', '#', '.', ':', '-'. + * Validation should be performed at the PushRequestHandler. + * + * @param {string} [siteConfig.push.dynamicTagsJson] Gets or sets a JSON string + * containing a list of dynamic tags that will be evaluated from user claims in + * the push registration endpoint. + * + * @param {string} [siteConfig.push.kind] Kind of resource. + * + * @param {object} [siteConfig.apiDefinition] Information about the formal API + * definition for the app. + * + * @param {string} [siteConfig.apiDefinition.url] The URL of the API + * definition. + * + * @param {string} [siteConfig.autoSwapSlotName] Auto-swap slot name. + * + * @param {boolean} [siteConfig.localMySqlEnabled] true to enable + * local MySQL; otherwise, false. + * + * @param {number} [siteConfig.managedServiceIdentityId] Managed Service + * Identity Id + * + * @param {number} [siteConfig.xManagedServiceIdentityId] Explicit Managed + * Service Identity Id + * + * @param {array} [siteConfig.ipSecurityRestrictions] IP security restrictions. + * + * @param {boolean} [siteConfig.http20Enabled] Http20Enabled: configures a web + * site to allow clients to connect over http2.0 + * + * @param {string} [siteConfig.minTlsVersion] MinTlsVersion: configures the + * minimum version of TLS required for SSL requests. Possible values include: + * '1.0', '1.1', '1.2' + * + * @param {string} [siteConfig.ftpsState] State of FTP / FTPS service. Possible + * values include: 'AllAllowed', 'FtpsOnly', 'Disabled' + * + * @param {number} [siteConfig.reservedInstanceCount] Number of reserved + * instances. + * This setting only applies to the Consumption Plan + * + * @param {string} [siteConfig.kind] Kind of resource. + * + * @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 SiteConfigResource} 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 _createOrUpdateConfiguration(resourceGroupName, name, siteConfig, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (siteConfig === null || siteConfig === undefined) { + throw new Error('siteConfig cannot be null or undefined.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/web'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'PUT'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (siteConfig !== null && siteConfig !== undefined) { + let requestModelMapper = new client.models['SiteConfigResource']().mapper(); + requestModel = client.serialize(requestModelMapper, siteConfig, 'siteConfig'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(siteConfig, 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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['SiteConfigResource']().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 Updates the configuration of an app. + * + * Updates the configuration of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} siteConfig JSON representation of a SiteConfig object. See + * example. + * + * @param {number} [siteConfig.numberOfWorkers] Number of workers. + * + * @param {array} [siteConfig.defaultDocuments] Default documents. + * + * @param {string} [siteConfig.netFrameworkVersion] .NET Framework version. + * + * @param {string} [siteConfig.phpVersion] Version of PHP. + * + * @param {string} [siteConfig.pythonVersion] Version of Python. + * + * @param {string} [siteConfig.nodeVersion] Version of Node.js. + * + * @param {string} [siteConfig.linuxFxVersion] Linux App Framework and version + * + * @param {string} [siteConfig.windowsFxVersion] Xenon App Framework and + * version + * + * @param {boolean} [siteConfig.requestTracingEnabled] true if + * request tracing is enabled; otherwise, false. + * + * @param {date} [siteConfig.requestTracingExpirationTime] Request tracing + * expiration time. + * + * @param {boolean} [siteConfig.remoteDebuggingEnabled] true if + * remote debugging is enabled; otherwise, false. + * + * @param {string} [siteConfig.remoteDebuggingVersion] Remote debugging + * version. + * + * @param {boolean} [siteConfig.httpLoggingEnabled] true if HTTP + * logging is enabled; otherwise, false. + * + * @param {number} [siteConfig.logsDirectorySizeLimit] HTTP logs directory size + * limit. + * + * @param {boolean} [siteConfig.detailedErrorLoggingEnabled] true + * if detailed error logging is enabled; otherwise, false. + * + * @param {string} [siteConfig.publishingUsername] Publishing user name. + * + * @param {array} [siteConfig.appSettings] Application settings. + * + * @param {object} [siteConfig.azureStorageAccounts] User-provided Azure + * storage accounts. + * + * @param {array} [siteConfig.connectionStrings] Connection strings. + * + * @param {array} [siteConfig.handlerMappings] Handler mappings. + * + * @param {string} [siteConfig.documentRoot] Document root. + * + * @param {string} [siteConfig.scmType] SCM type. Possible values include: + * 'None', 'Dropbox', 'Tfs', 'LocalGit', 'GitHub', 'CodePlexGit', 'CodePlexHg', + * 'BitbucketGit', 'BitbucketHg', 'ExternalGit', 'ExternalHg', 'OneDrive', + * 'VSO' + * + * @param {boolean} [siteConfig.use32BitWorkerProcess] true to use + * 32-bit worker process; otherwise, false. + * + * @param {boolean} [siteConfig.webSocketsEnabled] true if + * WebSocket is enabled; otherwise, false. + * + * @param {boolean} [siteConfig.alwaysOn] true if Always On is + * enabled; otherwise, false. + * + * @param {string} [siteConfig.javaVersion] Java version. + * + * @param {string} [siteConfig.javaContainer] Java container. + * + * @param {string} [siteConfig.javaContainerVersion] Java container version. + * + * @param {string} [siteConfig.appCommandLine] App command line to launch. + * + * @param {string} [siteConfig.managedPipelineMode] Managed pipeline mode. + * Possible values include: 'Integrated', 'Classic' + * + * @param {array} [siteConfig.virtualApplications] Virtual applications. + * + * @param {string} [siteConfig.loadBalancing] Site load balancing. Possible + * values include: 'WeightedRoundRobin', 'LeastRequests', 'LeastResponseTime', + * 'WeightedTotalTraffic', 'RequestHash' + * + * @param {object} [siteConfig.experiments] This is work around for polymophic + * types. + * + * @param {array} [siteConfig.experiments.rampUpRules] List of ramp-up rules. + * + * @param {object} [siteConfig.limits] Site limits. + * + * @param {number} [siteConfig.limits.maxPercentageCpu] Maximum allowed CPU + * usage percentage. + * + * @param {number} [siteConfig.limits.maxMemoryInMb] Maximum allowed memory + * usage in MB. + * + * @param {number} [siteConfig.limits.maxDiskSizeInMb] Maximum allowed disk + * size usage in MB. + * + * @param {boolean} [siteConfig.autoHealEnabled] true if Auto Heal + * is enabled; otherwise, false. + * + * @param {object} [siteConfig.autoHealRules] Auto Heal rules. + * + * @param {object} [siteConfig.autoHealRules.triggers] Conditions that describe + * when to execute the auto-heal actions. + * + * @param {object} [siteConfig.autoHealRules.triggers.requests] A rule based on + * total requests. + * + * @param {number} [siteConfig.autoHealRules.triggers.requests.count] Request + * Count. + * + * @param {string} [siteConfig.autoHealRules.triggers.requests.timeInterval] + * Time interval. + * + * @param {number} [siteConfig.autoHealRules.triggers.privateBytesInKB] A rule + * based on private bytes. + * + * @param {array} [siteConfig.autoHealRules.triggers.statusCodes] A rule based + * on status codes. + * + * @param {object} [siteConfig.autoHealRules.triggers.slowRequests] A rule + * based on request execution time. + * + * @param {string} [siteConfig.autoHealRules.triggers.slowRequests.timeTaken] + * Time taken. + * + * @param {number} [siteConfig.autoHealRules.triggers.slowRequests.count] + * Request Count. + * + * @param {string} + * [siteConfig.autoHealRules.triggers.slowRequests.timeInterval] Time interval. + * + * @param {object} [siteConfig.autoHealRules.actions] Actions to be executed + * when a rule is triggered. + * + * @param {string} [siteConfig.autoHealRules.actions.actionType] Predefined + * action to be taken. Possible values include: 'Recycle', 'LogEvent', + * 'CustomAction' + * + * @param {object} [siteConfig.autoHealRules.actions.customAction] Custom + * action to be taken. + * + * @param {string} [siteConfig.autoHealRules.actions.customAction.exe] + * Executable to be run. + * + * @param {string} [siteConfig.autoHealRules.actions.customAction.parameters] + * Parameters for the executable. + * + * @param {string} [siteConfig.autoHealRules.actions.minProcessExecutionTime] + * Minimum time the process must execute + * before taking the action + * + * @param {string} [siteConfig.tracingOptions] Tracing options. + * + * @param {string} [siteConfig.vnetName] Virtual Network name. + * + * @param {object} [siteConfig.cors] Cross-Origin Resource Sharing (CORS) + * settings. + * + * @param {array} [siteConfig.cors.allowedOrigins] Gets or sets the list of + * origins that should be allowed to make cross-origin + * calls (for example: http://example.com:12345). Use "*" to allow all. + * + * @param {object} [siteConfig.push] Push endpoint settings. + * + * @param {boolean} siteConfig.push.isPushEnabled Gets or sets a flag + * indicating whether the Push endpoint is enabled. + * + * @param {string} [siteConfig.push.tagWhitelistJson] Gets or sets a JSON + * string containing a list of tags that are whitelisted for use by the push + * registration endpoint. + * + * @param {string} [siteConfig.push.tagsRequiringAuth] Gets or sets a JSON + * string containing a list of tags that require user authentication to be used + * in the push registration endpoint. + * Tags can consist of alphanumeric characters and the following: + * '_', '@', '#', '.', ':', '-'. + * Validation should be performed at the PushRequestHandler. + * + * @param {string} [siteConfig.push.dynamicTagsJson] Gets or sets a JSON string + * containing a list of dynamic tags that will be evaluated from user claims in + * the push registration endpoint. + * + * @param {string} [siteConfig.push.kind] Kind of resource. + * + * @param {object} [siteConfig.apiDefinition] Information about the formal API + * definition for the app. + * + * @param {string} [siteConfig.apiDefinition.url] The URL of the API + * definition. + * + * @param {string} [siteConfig.autoSwapSlotName] Auto-swap slot name. + * + * @param {boolean} [siteConfig.localMySqlEnabled] true to enable + * local MySQL; otherwise, false. + * + * @param {number} [siteConfig.managedServiceIdentityId] Managed Service + * Identity Id + * + * @param {number} [siteConfig.xManagedServiceIdentityId] Explicit Managed + * Service Identity Id + * + * @param {array} [siteConfig.ipSecurityRestrictions] IP security restrictions. + * + * @param {boolean} [siteConfig.http20Enabled] Http20Enabled: configures a web + * site to allow clients to connect over http2.0 + * + * @param {string} [siteConfig.minTlsVersion] MinTlsVersion: configures the + * minimum version of TLS required for SSL requests. Possible values include: + * '1.0', '1.1', '1.2' + * + * @param {string} [siteConfig.ftpsState] State of FTP / FTPS service. Possible + * values include: 'AllAllowed', 'FtpsOnly', 'Disabled' + * + * @param {number} [siteConfig.reservedInstanceCount] Number of reserved + * instances. + * This setting only applies to the Consumption Plan + * + * @param {string} [siteConfig.kind] Kind of resource. + * + * @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 SiteConfigResource} 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 _updateConfiguration(resourceGroupName, name, siteConfig, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (siteConfig === null || siteConfig === undefined) { + throw new Error('siteConfig cannot be null or undefined.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/web'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'PATCH'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (siteConfig !== null && siteConfig !== undefined) { + let requestModelMapper = new client.models['SiteConfigResource']().mapper(); + requestModel = client.serialize(requestModelMapper, siteConfig, 'siteConfig'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(siteConfig, 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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['SiteConfigResource']().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 web app configuration snapshots identifiers. Each + * element of the list contains a timestamp and the ID of the snapshot. + * + * Gets a list of web app configuration snapshots identifiers. Each element of + * the list contains a timestamp and the ID of the snapshot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @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 SiteConfigurationSnapshotInfoCollection} 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 _listConfigurationSnapshotInfo(resourceGroupName, name, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/web/snapshots'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['SiteConfigurationSnapshotInfoCollection']().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 snapshot of the configuration of an app at a previous point + * in time. + * + * Gets a snapshot of the configuration of an app at a previous point in time. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} snapshotId The ID of the snapshot to read. + * + * @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 SiteConfigResource} 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 _getConfigurationSnapshot(resourceGroupName, name, snapshotId, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (snapshotId === null || snapshotId === undefined || typeof snapshotId.valueOf() !== 'string') { + throw new Error('snapshotId cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/web/snapshots/{snapshotId}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{snapshotId}', encodeURIComponent(snapshotId)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['SiteConfigResource']().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 Reverts the configuration of an app to a previous snapshot. + * + * Reverts the configuration of an app to a previous snapshot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} snapshotId The ID of the snapshot to read. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _recoverSiteConfigurationSnapshot(resourceGroupName, name, snapshotId, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (snapshotId === null || snapshotId === undefined || typeof snapshotId.valueOf() !== 'string') { + throw new Error('snapshotId cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/web/snapshots/{snapshotId}/recover'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{snapshotId}', encodeURIComponent(snapshotId)); + 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]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 204) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + + return callback(null, result, httpRequest, response); + }); +} + +/** + * @summary Gets the last lines of docker logs for the given site + * + * Gets the last lines of docker logs for the given site + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @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. + * + * {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 _getWebSiteContainerLogs(resourceGroupName, name, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/containerlogs'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + 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]; + } + } + } + httpRequest.body = null; + // Send Request + httpRequest.streamedResponse = true; + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 204) { + let error = new Error(`Unexpected status code: ${statusCode}`); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + if (responseBody !== undefined) 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 = response; + return callback(null, result, httpRequest, response); + }); +} + +/** + * @summary Gets the ZIP archived docker log files for the given site + * + * Gets the ZIP archived docker log files for the given site + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @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. + * + * {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 _getContainerLogsZip(resourceGroupName, name, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/containerlogs/zip/download'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + 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]; + } + } + } + httpRequest.body = null; + // Send Request + httpRequest.streamedResponse = true; + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 204) { + let error = new Error(`Unexpected status code: ${statusCode}`); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + if (responseBody !== undefined) 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 = response; + return callback(null, result, httpRequest, response); + }); +} + +/** + * @summary List continuous web jobs for an app, or a deployment slot. + * + * List continuous web jobs for an app, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @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 ContinuousWebJobCollection} 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 _listContinuousWebJobs(resourceGroupName, name, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/continuouswebjobs'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['ContinuousWebJobCollection']().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 continuous web job by its ID for an app, or a deployment + * slot. + * + * Gets a continuous web job by its ID for an app, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} webJobName Name of Web Job. + * + * @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 ContinuousWebJob} 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 _getContinuousWebJob(resourceGroupName, name, webJobName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (webJobName === null || webJobName === undefined || typeof webJobName.valueOf() !== 'string') { + throw new Error('webJobName cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/continuouswebjobs/{webJobName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{webJobName}', encodeURIComponent(webJobName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 404) { + 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['ContinuousWebJob']().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 Delete a continuous web job by its ID for an app, or a deployment + * slot. + * + * Delete a continuous web job by its ID for an app, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} webJobName Name of Web Job. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _deleteContinuousWebJob(resourceGroupName, name, webJobName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (webJobName === null || webJobName === undefined || typeof webJobName.valueOf() !== 'string') { + throw new Error('webJobName cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/continuouswebjobs/{webJobName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{webJobName}', encodeURIComponent(webJobName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'DELETE'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 204) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + + return callback(null, result, httpRequest, response); + }); +} + +/** + * @summary Start a continuous web job for an app, or a deployment slot. + * + * Start a continuous web job for an app, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} webJobName Name of Web Job. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _startContinuousWebJob(resourceGroupName, name, webJobName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (webJobName === null || webJobName === undefined || typeof webJobName.valueOf() !== 'string') { + throw new Error('webJobName cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/continuouswebjobs/{webJobName}/start'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{webJobName}', encodeURIComponent(webJobName)); + 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]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 404) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + + return callback(null, result, httpRequest, response); + }); +} + +/** + * @summary Stop a continuous web job for an app, or a deployment slot. + * + * Stop a continuous web job for an app, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} webJobName Name of Web Job. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _stopContinuousWebJob(resourceGroupName, name, webJobName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (webJobName === null || webJobName === undefined || typeof webJobName.valueOf() !== 'string') { + throw new Error('webJobName cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/continuouswebjobs/{webJobName}/stop'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{webJobName}', encodeURIComponent(webJobName)); + 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]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 404) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + + return callback(null, result, httpRequest, response); + }); +} + +/** + * @summary List deployments for an app, or a deployment slot. + * + * List deployments for an app, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @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 DeploymentCollection} 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 _listDeployments(resourceGroupName, name, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/deployments'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['DeploymentCollection']().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 Get a deployment by its ID for an app, or a deployment slot. + * + * Get a deployment by its ID for an app, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} id Deployment ID. + * + * @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 Deployment} 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 _getDeployment(resourceGroupName, name, id, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (id === null || id === undefined || typeof id.valueOf() !== 'string') { + throw new Error('id cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/deployments/{id}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{id}', encodeURIComponent(id)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['Deployment']().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 Create a deployment for an app, or a deployment slot. + * + * Create a deployment for an app, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} id ID of an existing deployment. + * + * @param {object} deployment Deployment details. + * + * @param {number} [deployment.status] Deployment status. + * + * @param {string} [deployment.message] Details about deployment status. + * + * @param {string} [deployment.author] Who authored the deployment. + * + * @param {string} [deployment.deployer] Who performed the deployment. + * + * @param {string} [deployment.authorEmail] Author email. + * + * @param {date} [deployment.startTime] Start time. + * + * @param {date} [deployment.endTime] End time. + * + * @param {boolean} [deployment.active] True if deployment is currently active, + * false if completed and null if not started. + * + * @param {string} [deployment.details] Details on deployment. + * + * @param {string} [deployment.kind] Kind of resource. + * + * @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 Deployment} 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 _createDeployment(resourceGroupName, name, id, deployment, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (id === null || id === undefined || typeof id.valueOf() !== 'string') { + throw new Error('id cannot be null or undefined and it must be of type string.'); + } + if (deployment === null || deployment === undefined) { + throw new Error('deployment cannot be null or undefined.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/deployments/{id}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{id}', encodeURIComponent(id)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'PUT'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (deployment !== null && deployment !== undefined) { + let requestModelMapper = new client.models['Deployment']().mapper(); + requestModel = client.serialize(requestModelMapper, deployment, 'deployment'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(deployment, 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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['Deployment']().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 Delete a deployment by its ID for an app, or a deployment slot. + * + * Delete a deployment by its ID for an app, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} id Deployment ID. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _deleteDeployment(resourceGroupName, name, id, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (id === null || id === undefined || typeof id.valueOf() !== 'string') { + throw new Error('id cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/deployments/{id}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{id}', encodeURIComponent(id)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'DELETE'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 204) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + + return callback(null, result, httpRequest, response); + }); +} + +/** + * @summary List deployment log for specific deployment for an app, or a + * deployment slot. + * + * List deployment log for specific deployment for an app, or a deployment + * slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} id The ID of a specific deployment. This is the value of the + * name property in the JSON response from "GET + * /api/sites/{siteName}/deployments". + * + * @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 Deployment} 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 _listDeploymentLog(resourceGroupName, name, id, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (id === null || id === undefined || typeof id.valueOf() !== 'string') { + throw new Error('id cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/deployments/{id}/log'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{id}', encodeURIComponent(id)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['Deployment']().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 Discovers an existing app backup that can be restored from a blob + * in Azure storage. Use this to get information about the databases stored in + * a backup. + * + * Discovers an existing app backup that can be restored from a blob in Azure + * storage. Use this to get information about the databases stored in a backup. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} request A RestoreRequest object that includes Azure storage + * URL and blog name for discovery of backup. + * + * @param {string} request.storageAccountUrl SAS URL to the container. + * + * @param {string} [request.blobName] Name of a blob which contains the backup. + * + * @param {boolean} request.overwrite true if the restore + * operation can overwrite target app; otherwise, false. + * true is needed if trying to restore over an existing app. + * + * @param {string} [request.siteName] Name of an app. + * + * @param {array} [request.databases] Collection of databases which should be + * restored. This list has to match the list of databases included in the + * backup. + * + * @param {boolean} [request.ignoreConflictingHostNames] Changes a logic when + * restoring an app with custom domains. true to remove custom + * domains automatically. If false, custom domains are added to + * the app's object when it is being restored, but that might fail due to + * conflicts during the operation. + * + * @param {boolean} [request.ignoreDatabases] Ignore the databases and only + * restore the site content + * + * @param {string} [request.appServicePlan] Specify app service plan that will + * own restored site. + * + * @param {string} [request.operationType] Operation type. Possible values + * include: 'Default', 'Clone', 'Relocation', 'Snapshot', 'CloudFS' + * + * @param {boolean} [request.adjustConnectionStrings] true if + * SiteConfig.ConnectionStrings should be set in new app; otherwise, + * false. + * + * @param {string} [request.hostingEnvironment] App Service Environment name, + * if needed (only when restoring an app to an App Service Environment). + * + * @param {string} [request.kind] Kind of resource. + * + * @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 RestoreRequest} 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 _discoverBackup(resourceGroupName, name, request, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (request === null || request === undefined) { + throw new Error('request cannot be null or undefined.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/discoverbackup'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + 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 (request !== null && request !== undefined) { + let requestModelMapper = new client.models['RestoreRequest']().mapper(); + requestModel = client.serialize(requestModelMapper, request, 'request'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(request, 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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['RestoreRequest']().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 Lists ownership identifiers for domain associated with web app. + * + * Lists ownership identifiers for domain associated with web app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @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 IdentifierCollection} 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 _listDomainOwnershipIdentifiers(resourceGroupName, name, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/domainOwnershipIdentifiers'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['IdentifierCollection']().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 Get domain ownership identifier for web app. + * + * Get domain ownership identifier for web app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} domainOwnershipIdentifierName Name of domain ownership + * identifier. + * + * @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 Identifier} 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 _getDomainOwnershipIdentifier(resourceGroupName, name, domainOwnershipIdentifierName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (domainOwnershipIdentifierName === null || domainOwnershipIdentifierName === undefined || typeof domainOwnershipIdentifierName.valueOf() !== 'string') { + throw new Error('domainOwnershipIdentifierName cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/domainOwnershipIdentifiers/{domainOwnershipIdentifierName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{domainOwnershipIdentifierName}', encodeURIComponent(domainOwnershipIdentifierName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['Identifier']().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 Creates a domain ownership identifier for web app, or updates an + * existing ownership identifier. + * + * Creates a domain ownership identifier for web app, or updates an existing + * ownership identifier. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} domainOwnershipIdentifierName Name of domain ownership + * identifier. + * + * @param {object} domainOwnershipIdentifier A JSON representation of the + * domain ownership properties. + * + * @param {string} [domainOwnershipIdentifier.identifierId] String + * representation of the identity. + * + * @param {string} [domainOwnershipIdentifier.kind] Kind of resource. + * + * @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 Identifier} 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 _createOrUpdateDomainOwnershipIdentifier(resourceGroupName, name, domainOwnershipIdentifierName, domainOwnershipIdentifier, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (domainOwnershipIdentifierName === null || domainOwnershipIdentifierName === undefined || typeof domainOwnershipIdentifierName.valueOf() !== 'string') { + throw new Error('domainOwnershipIdentifierName cannot be null or undefined and it must be of type string.'); + } + if (domainOwnershipIdentifier === null || domainOwnershipIdentifier === undefined) { + throw new Error('domainOwnershipIdentifier cannot be null or undefined.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/domainOwnershipIdentifiers/{domainOwnershipIdentifierName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{domainOwnershipIdentifierName}', encodeURIComponent(domainOwnershipIdentifierName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'PUT'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (domainOwnershipIdentifier !== null && domainOwnershipIdentifier !== undefined) { + let requestModelMapper = new client.models['Identifier']().mapper(); + requestModel = client.serialize(requestModelMapper, domainOwnershipIdentifier, 'domainOwnershipIdentifier'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(domainOwnershipIdentifier, 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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['Identifier']().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 Deletes a domain ownership identifier for a web app. + * + * Deletes a domain ownership identifier for a web app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} domainOwnershipIdentifierName Name of domain ownership + * identifier. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _deleteDomainOwnershipIdentifier(resourceGroupName, name, domainOwnershipIdentifierName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (domainOwnershipIdentifierName === null || domainOwnershipIdentifierName === undefined || typeof domainOwnershipIdentifierName.valueOf() !== 'string') { + throw new Error('domainOwnershipIdentifierName cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/domainOwnershipIdentifiers/{domainOwnershipIdentifierName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{domainOwnershipIdentifierName}', encodeURIComponent(domainOwnershipIdentifierName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'DELETE'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 204) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + + return callback(null, result, httpRequest, response); + }); +} + +/** + * @summary Creates a domain ownership identifier for web app, or updates an + * existing ownership identifier. + * + * Creates a domain ownership identifier for web app, or updates an existing + * ownership identifier. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} domainOwnershipIdentifierName Name of domain ownership + * identifier. + * + * @param {object} domainOwnershipIdentifier A JSON representation of the + * domain ownership properties. + * + * @param {string} [domainOwnershipIdentifier.identifierId] String + * representation of the identity. + * + * @param {string} [domainOwnershipIdentifier.kind] Kind of resource. + * + * @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 Identifier} 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 _updateDomainOwnershipIdentifier(resourceGroupName, name, domainOwnershipIdentifierName, domainOwnershipIdentifier, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (domainOwnershipIdentifierName === null || domainOwnershipIdentifierName === undefined || typeof domainOwnershipIdentifierName.valueOf() !== 'string') { + throw new Error('domainOwnershipIdentifierName cannot be null or undefined and it must be of type string.'); + } + if (domainOwnershipIdentifier === null || domainOwnershipIdentifier === undefined) { + throw new Error('domainOwnershipIdentifier cannot be null or undefined.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/domainOwnershipIdentifiers/{domainOwnershipIdentifierName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{domainOwnershipIdentifierName}', encodeURIComponent(domainOwnershipIdentifierName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'PATCH'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (domainOwnershipIdentifier !== null && domainOwnershipIdentifier !== undefined) { + let requestModelMapper = new client.models['Identifier']().mapper(); + requestModel = client.serialize(requestModelMapper, domainOwnershipIdentifier, 'domainOwnershipIdentifier'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(domainOwnershipIdentifier, 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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['Identifier']().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 Get the status of the last MSDeploy operation. + * + * Get the status of the last MSDeploy operation. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @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 MSDeployStatus} 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 _getMSDeployStatus(resourceGroupName, name, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/extensions/MSDeploy'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['MSDeployStatus']().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 Invoke the MSDeploy web app extension. + * + * Invoke the MSDeploy web app extension. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {object} mSDeploy Details of MSDeploy operation + * + * @param {string} [mSDeploy.packageUri] Package URI + * + * @param {string} [mSDeploy.connectionString] SQL Connection String + * + * @param {string} [mSDeploy.dbType] Database Type + * + * @param {string} [mSDeploy.setParametersXmlFileUri] URI of MSDeploy + * Parameters file. Must not be set if SetParameters is used. + * + * @param {object} [mSDeploy.setParameters] MSDeploy Parameters. Must not be + * set if SetParametersXmlFileUri is used. + * + * @param {boolean} [mSDeploy.skipAppData] Controls whether the MSDeploy + * operation skips the App_Data directory. + * If set to true, the existing App_Data directory on the + * destination + * will not be deleted, and any App_Data directory in the source will be + * ignored. + * Setting is false by default. + * + * @param {boolean} [mSDeploy.appOffline] Sets the AppOffline rule while the + * MSDeploy operation executes. + * Setting is false by default. + * + * @param {string} [mSDeploy.kind] Kind of resource. + * + * @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 MSDeployStatus} 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 _createMSDeployOperation(resourceGroupName, name, mSDeploy, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + + if (!callback) { + throw new Error('callback cannot be null.'); + } + + // Send request + this.beginCreateMSDeployOperation(resourceGroupName, name, mSDeploy, options, (err, parsedResult, httpRequest, response) => { + if (err) return callback(err); + + let initialResult = new msRest.HttpOperationResponse(); + initialResult.request = httpRequest; + initialResult.response = response; + initialResult.body = response.body; + client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { + if (err) return callback(err); + + // Create Result + let result = null; + + httpRequest = pollingResult.request; + response = pollingResult.response; + let responseBody = pollingResult.body; + if (responseBody === '') responseBody = null; + + // Deserialize Response + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['MSDeployStatus']().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 Get the MSDeploy Log for the last MSDeploy operation. + * + * Get the MSDeploy Log for the last MSDeploy operation. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @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 MSDeployLog} 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 _getMSDeployLog(resourceGroupName, name, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/extensions/MSDeploy/log'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 404) { + 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['MSDeployLog']().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 List the functions for a web site, or a deployment slot. + * + * List the functions for a web site, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @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 FunctionEnvelopeCollection} 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 _listFunctions(resourceGroupName, name, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/functions'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 404) { + 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['FunctionEnvelopeCollection']().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 Fetch a short lived token that can be exchanged for a master key. + * + * Fetch a short lived token that can be exchanged for a master key. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @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. + * + * {string} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _getFunctionsAdminToken(resourceGroupName, name, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/functions/admin/token'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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 = { + required: false, + serializedName: 'parsedResponse', + type: { + name: 'String' + } + }; + 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 Get function information by its ID for web site, or a deployment + * slot. + * + * Get function information by its ID for web site, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} functionName Function name. + * + * @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 FunctionEnvelope} 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 _getFunction(resourceGroupName, name, functionName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (functionName === null || functionName === undefined || typeof functionName.valueOf() !== 'string') { + throw new Error('functionName cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/functions/{functionName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{functionName}', encodeURIComponent(functionName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 404) { + 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['FunctionEnvelope']().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 Create function for web site, or a deployment slot. + * + * Create function for web site, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} functionName Function name. + * + * @param {object} functionEnvelope Function details. + * + * @param {string} [functionEnvelope.functionAppId] Function App ID. + * + * @param {string} [functionEnvelope.scriptRootPathHref] Script root path URI. + * + * @param {string} [functionEnvelope.scriptHref] Script URI. + * + * @param {string} [functionEnvelope.configHref] Config URI. + * + * @param {string} [functionEnvelope.secretsFileHref] Secrets file URI. + * + * @param {string} [functionEnvelope.href] Function URI. + * + * @param {object} [functionEnvelope.config] Config information. + * + * @param {object} [functionEnvelope.files] File list. + * + * @param {string} [functionEnvelope.testData] Test data used when testing via + * the Azure Portal. + * + * @param {string} [functionEnvelope.kind] Kind of resource. + * + * @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 FunctionEnvelope} 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 _createFunction(resourceGroupName, name, functionName, functionEnvelope, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + + if (!callback) { + throw new Error('callback cannot be null.'); + } + + // Send request + this.beginCreateFunction(resourceGroupName, name, functionName, functionEnvelope, options, (err, parsedResult, httpRequest, response) => { + if (err) return callback(err); + + let initialResult = new msRest.HttpOperationResponse(); + initialResult.request = httpRequest; + initialResult.response = response; + initialResult.body = response.body; + client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { + if (err) return callback(err); + + // Create Result + let result = null; + + httpRequest = pollingResult.request; + response = pollingResult.response; + let responseBody = pollingResult.body; + if (responseBody === '') responseBody = null; + + // Deserialize Response + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['FunctionEnvelope']().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 Delete a function for web site, or a deployment slot. + * + * Delete a function for web site, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} functionName Function name. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _deleteFunction(resourceGroupName, name, functionName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (functionName === null || functionName === undefined || typeof functionName.valueOf() !== 'string') { + throw new Error('functionName cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/functions/{functionName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{functionName}', encodeURIComponent(functionName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'DELETE'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 204 && statusCode !== 404) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + + return callback(null, result, httpRequest, response); + }); +} + +/** + * @summary Get function secrets for a function in a web site, or a deployment + * slot. + * + * Get function secrets for a function in a web site, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} functionName Function name. + * + * @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 FunctionSecrets} 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 _listFunctionSecrets(resourceGroupName, name, functionName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (functionName === null || functionName === undefined || typeof functionName.valueOf() !== 'string') { + throw new Error('functionName cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/functions/{functionName}/listsecrets'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{functionName}', encodeURIComponent(functionName)); + 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]; + } + } + } + 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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['FunctionSecrets']().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 Get hostname bindings for an app or a deployment slot. + * + * Get hostname bindings for an app or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @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 HostNameBindingCollection} 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 _listHostNameBindings(resourceGroupName, name, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hostNameBindings'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['HostNameBindingCollection']().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 Get the named hostname binding for an app (or deployment slot, if + * specified). + * + * Get the named hostname binding for an app (or deployment slot, if + * specified). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} hostName Hostname in the hostname binding. + * + * @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 HostNameBinding} 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 _getHostNameBinding(resourceGroupName, name, hostName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (hostName === null || hostName === undefined || typeof hostName.valueOf() !== 'string') { + throw new Error('hostName cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hostNameBindings/{hostName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{hostName}', encodeURIComponent(hostName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['HostNameBinding']().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 Creates a hostname binding for an app. + * + * Creates a hostname binding for an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} hostName Hostname in the hostname binding. + * + * @param {object} hostNameBinding Binding details. This is the JSON + * representation of a HostNameBinding object. + * + * @param {string} [hostNameBinding.siteName] App Service app name. + * + * @param {string} [hostNameBinding.domainId] Fully qualified ARM domain + * resource URI. + * + * @param {string} [hostNameBinding.azureResourceName] Azure resource name. + * + * @param {string} [hostNameBinding.azureResourceType] Azure resource type. + * Possible values include: 'Website', 'TrafficManager' + * + * @param {string} [hostNameBinding.customHostNameDnsRecordType] Custom DNS + * record type. Possible values include: 'CName', 'A' + * + * @param {string} [hostNameBinding.hostNameType] Hostname type. Possible + * values include: 'Verified', 'Managed' + * + * @param {string} [hostNameBinding.sslState] SSL type. Possible values + * include: 'Disabled', 'SniEnabled', 'IpBasedEnabled' + * + * @param {string} [hostNameBinding.thumbprint] SSL certificate thumbprint + * + * @param {string} [hostNameBinding.kind] Kind of resource. + * + * @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 HostNameBinding} 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 _createOrUpdateHostNameBinding(resourceGroupName, name, hostName, hostNameBinding, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (hostName === null || hostName === undefined || typeof hostName.valueOf() !== 'string') { + throw new Error('hostName cannot be null or undefined and it must be of type string.'); + } + if (hostNameBinding === null || hostNameBinding === undefined) { + throw new Error('hostNameBinding cannot be null or undefined.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hostNameBindings/{hostName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{hostName}', encodeURIComponent(hostName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'PUT'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (hostNameBinding !== null && hostNameBinding !== undefined) { + let requestModelMapper = new client.models['HostNameBinding']().mapper(); + requestModel = client.serialize(requestModelMapper, hostNameBinding, 'hostNameBinding'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(hostNameBinding, 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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['HostNameBinding']().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 Deletes a hostname binding for an app. + * + * Deletes a hostname binding for an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} hostName Hostname in the hostname binding. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _deleteHostNameBinding(resourceGroupName, name, hostName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (hostName === null || hostName === undefined || typeof hostName.valueOf() !== 'string') { + throw new Error('hostName cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hostNameBindings/{hostName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{hostName}', encodeURIComponent(hostName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'DELETE'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 204) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + + return callback(null, result, httpRequest, response); + }); +} + +/** + * @summary Retrieves a specific Service Bus Hybrid Connection used by this Web + * App. + * + * Retrieves a specific Service Bus Hybrid Connection used by this Web App. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @param {string} namespaceName The namespace for this hybrid connection. + * + * @param {string} relayName The relay name for this hybrid connection. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link HybridConnection} 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 _getHybridConnection(resourceGroupName, name, namespaceName, relayName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (namespaceName === null || namespaceName === undefined || typeof namespaceName.valueOf() !== 'string') { + throw new Error('namespaceName cannot be null or undefined and it must be of type string.'); + } + if (relayName === null || relayName === undefined || typeof relayName.valueOf() !== 'string') { + throw new Error('relayName cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{namespaceName}', encodeURIComponent(namespaceName)); + requestUrl = requestUrl.replace('{relayName}', encodeURIComponent(relayName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['HybridConnection']().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 Creates a new Hybrid Connection using a Service Bus relay. + * + * Creates a new Hybrid Connection using a Service Bus relay. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @param {string} namespaceName The namespace for this hybrid connection. + * + * @param {string} relayName The relay name for this hybrid connection. + * + * @param {object} connectionEnvelope The details of the hybrid connection. + * + * @param {string} [connectionEnvelope.serviceBusNamespace] The name of the + * Service Bus namespace. + * + * @param {string} [connectionEnvelope.relayName] The name of the Service Bus + * relay. + * + * @param {string} [connectionEnvelope.relayArmUri] The ARM URI to the Service + * Bus relay. + * + * @param {string} [connectionEnvelope.hostname] The hostname of the endpoint. + * + * @param {number} [connectionEnvelope.port] The port of the endpoint. + * + * @param {string} [connectionEnvelope.sendKeyName] The name of the Service Bus + * key which has Send permissions. This is used to authenticate to Service Bus. + * + * @param {string} [connectionEnvelope.sendKeyValue] The value of the Service + * Bus key. This is used to authenticate to Service Bus. In ARM this key will + * not be returned + * normally, use the POST /listKeys API instead. + * + * @param {string} [connectionEnvelope.serviceBusSuffix] The suffix for the + * service bus endpoint. By default this is .servicebus.windows.net + * + * @param {string} [connectionEnvelope.kind] Kind of resource. + * + * @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 HybridConnection} 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 _createOrUpdateHybridConnection(resourceGroupName, name, namespaceName, relayName, connectionEnvelope, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (namespaceName === null || namespaceName === undefined || typeof namespaceName.valueOf() !== 'string') { + throw new Error('namespaceName cannot be null or undefined and it must be of type string.'); + } + if (relayName === null || relayName === undefined || typeof relayName.valueOf() !== 'string') { + throw new Error('relayName cannot be null or undefined and it must be of type string.'); + } + if (connectionEnvelope === null || connectionEnvelope === undefined) { + throw new Error('connectionEnvelope cannot be null or undefined.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{namespaceName}', encodeURIComponent(namespaceName)); + requestUrl = requestUrl.replace('{relayName}', encodeURIComponent(relayName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'PUT'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (connectionEnvelope !== null && connectionEnvelope !== undefined) { + let requestModelMapper = new client.models['HybridConnection']().mapper(); + requestModel = client.serialize(requestModelMapper, connectionEnvelope, 'connectionEnvelope'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(connectionEnvelope, 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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['HybridConnection']().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 Removes a Hybrid Connection from this site. + * + * Removes a Hybrid Connection from this site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @param {string} namespaceName The namespace for this hybrid connection. + * + * @param {string} relayName The relay name for this hybrid connection. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _deleteHybridConnection(resourceGroupName, name, namespaceName, relayName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (namespaceName === null || namespaceName === undefined || typeof namespaceName.valueOf() !== 'string') { + throw new Error('namespaceName cannot be null or undefined and it must be of type string.'); + } + if (relayName === null || relayName === undefined || typeof relayName.valueOf() !== 'string') { + throw new Error('relayName cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{namespaceName}', encodeURIComponent(namespaceName)); + requestUrl = requestUrl.replace('{relayName}', encodeURIComponent(relayName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'DELETE'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 404) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + + return callback(null, result, httpRequest, response); + }); +} + +/** + * @summary Creates a new Hybrid Connection using a Service Bus relay. + * + * Creates a new Hybrid Connection using a Service Bus relay. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @param {string} namespaceName The namespace for this hybrid connection. + * + * @param {string} relayName The relay name for this hybrid connection. + * + * @param {object} connectionEnvelope The details of the hybrid connection. + * + * @param {string} [connectionEnvelope.serviceBusNamespace] The name of the + * Service Bus namespace. + * + * @param {string} [connectionEnvelope.relayName] The name of the Service Bus + * relay. + * + * @param {string} [connectionEnvelope.relayArmUri] The ARM URI to the Service + * Bus relay. + * + * @param {string} [connectionEnvelope.hostname] The hostname of the endpoint. + * + * @param {number} [connectionEnvelope.port] The port of the endpoint. + * + * @param {string} [connectionEnvelope.sendKeyName] The name of the Service Bus + * key which has Send permissions. This is used to authenticate to Service Bus. + * + * @param {string} [connectionEnvelope.sendKeyValue] The value of the Service + * Bus key. This is used to authenticate to Service Bus. In ARM this key will + * not be returned + * normally, use the POST /listKeys API instead. + * + * @param {string} [connectionEnvelope.serviceBusSuffix] The suffix for the + * service bus endpoint. By default this is .servicebus.windows.net + * + * @param {string} [connectionEnvelope.kind] Kind of resource. + * + * @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 HybridConnection} 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 _updateHybridConnection(resourceGroupName, name, namespaceName, relayName, connectionEnvelope, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (namespaceName === null || namespaceName === undefined || typeof namespaceName.valueOf() !== 'string') { + throw new Error('namespaceName cannot be null or undefined and it must be of type string.'); + } + if (relayName === null || relayName === undefined || typeof relayName.valueOf() !== 'string') { + throw new Error('relayName cannot be null or undefined and it must be of type string.'); + } + if (connectionEnvelope === null || connectionEnvelope === undefined) { + throw new Error('connectionEnvelope cannot be null or undefined.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{namespaceName}', encodeURIComponent(namespaceName)); + requestUrl = requestUrl.replace('{relayName}', encodeURIComponent(relayName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'PATCH'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (connectionEnvelope !== null && connectionEnvelope !== undefined) { + let requestModelMapper = new client.models['HybridConnection']().mapper(); + requestModel = client.serialize(requestModelMapper, connectionEnvelope, 'connectionEnvelope'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(connectionEnvelope, 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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['HybridConnection']().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 the send key name and value for a Hybrid Connection. + * + * Gets the send key name and value for a Hybrid Connection. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @param {string} namespaceName The namespace for this hybrid connection. + * + * @param {string} relayName The relay name for this hybrid connection. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link HybridConnectionKey} 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 _listHybridConnectionKeys(resourceGroupName, name, namespaceName, relayName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (namespaceName === null || namespaceName === undefined || typeof namespaceName.valueOf() !== 'string') { + throw new Error('namespaceName cannot be null or undefined and it must be of type string.'); + } + if (relayName === null || relayName === undefined || typeof relayName.valueOf() !== 'string') { + throw new Error('relayName cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}/listKeys'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{namespaceName}', encodeURIComponent(namespaceName)); + requestUrl = requestUrl.replace('{relayName}', encodeURIComponent(relayName)); + 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]; + } + } + } + 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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['HybridConnectionKey']().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 Retrieves all Service Bus Hybrid Connections used by this Web App. + * + * Retrieves all Service Bus Hybrid Connections used by this Web App. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @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 HybridConnection} 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 _listHybridConnections(resourceGroupName, name, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridConnectionRelays'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['HybridConnection']().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 hybrid connections configured for an app (or deployment slot, + * if specified). + * + * Gets hybrid connections configured for an app (or deployment slot, if + * specified). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @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 RelayServiceConnectionEntity} 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 _listRelayServiceConnections(resourceGroupName, name, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridconnection'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['RelayServiceConnectionEntity']().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 hybrid connection configuration by its name. + * + * Gets a hybrid connection configuration by its name. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} entityName Name of the hybrid connection. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link RelayServiceConnectionEntity} 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 _getRelayServiceConnection(resourceGroupName, name, entityName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (entityName === null || entityName === undefined || typeof entityName.valueOf() !== 'string') { + throw new Error('entityName cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridconnection/{entityName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{entityName}', encodeURIComponent(entityName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['RelayServiceConnectionEntity']().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 Creates a new hybrid connection configuration (PUT), or updates an + * existing one (PATCH). + * + * Creates a new hybrid connection configuration (PUT), or updates an existing + * one (PATCH). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} entityName Name of the hybrid connection configuration. + * + * @param {object} connectionEnvelope Details of the hybrid connection + * configuration. + * + * @param {string} [connectionEnvelope.entityName] + * + * @param {string} [connectionEnvelope.entityConnectionString] + * + * @param {string} [connectionEnvelope.resourceType] + * + * @param {string} [connectionEnvelope.resourceConnectionString] + * + * @param {string} [connectionEnvelope.hostname] + * + * @param {number} [connectionEnvelope.port] + * + * @param {string} [connectionEnvelope.biztalkUri] + * + * @param {string} [connectionEnvelope.kind] Kind of resource. + * + * @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 RelayServiceConnectionEntity} 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 _createOrUpdateRelayServiceConnection(resourceGroupName, name, entityName, connectionEnvelope, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (entityName === null || entityName === undefined || typeof entityName.valueOf() !== 'string') { + throw new Error('entityName cannot be null or undefined and it must be of type string.'); + } + if (connectionEnvelope === null || connectionEnvelope === undefined) { + throw new Error('connectionEnvelope cannot be null or undefined.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridconnection/{entityName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{entityName}', encodeURIComponent(entityName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'PUT'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (connectionEnvelope !== null && connectionEnvelope !== undefined) { + let requestModelMapper = new client.models['RelayServiceConnectionEntity']().mapper(); + requestModel = client.serialize(requestModelMapper, connectionEnvelope, 'connectionEnvelope'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(connectionEnvelope, 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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['RelayServiceConnectionEntity']().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 Deletes a relay service connection by its name. + * + * Deletes a relay service connection by its name. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} entityName Name of the hybrid connection configuration. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _deleteRelayServiceConnection(resourceGroupName, name, entityName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (entityName === null || entityName === undefined || typeof entityName.valueOf() !== 'string') { + throw new Error('entityName cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridconnection/{entityName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{entityName}', encodeURIComponent(entityName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'DELETE'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 404) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + + return callback(null, result, httpRequest, response); + }); +} + +/** + * @summary Creates a new hybrid connection configuration (PUT), or updates an + * existing one (PATCH). + * + * Creates a new hybrid connection configuration (PUT), or updates an existing + * one (PATCH). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} entityName Name of the hybrid connection configuration. + * + * @param {object} connectionEnvelope Details of the hybrid connection + * configuration. + * + * @param {string} [connectionEnvelope.entityName] + * + * @param {string} [connectionEnvelope.entityConnectionString] + * + * @param {string} [connectionEnvelope.resourceType] + * + * @param {string} [connectionEnvelope.resourceConnectionString] + * + * @param {string} [connectionEnvelope.hostname] + * + * @param {number} [connectionEnvelope.port] + * + * @param {string} [connectionEnvelope.biztalkUri] + * + * @param {string} [connectionEnvelope.kind] Kind of resource. + * + * @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 RelayServiceConnectionEntity} 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 _updateRelayServiceConnection(resourceGroupName, name, entityName, connectionEnvelope, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (entityName === null || entityName === undefined || typeof entityName.valueOf() !== 'string') { + throw new Error('entityName cannot be null or undefined and it must be of type string.'); + } + if (connectionEnvelope === null || connectionEnvelope === undefined) { + throw new Error('connectionEnvelope cannot be null or undefined.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridconnection/{entityName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{entityName}', encodeURIComponent(entityName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'PATCH'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (connectionEnvelope !== null && connectionEnvelope !== undefined) { + let requestModelMapper = new client.models['RelayServiceConnectionEntity']().mapper(); + requestModel = client.serialize(requestModelMapper, connectionEnvelope, 'connectionEnvelope'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(connectionEnvelope, 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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['RelayServiceConnectionEntity']().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 all scale-out instances of an app. + * + * Gets all scale-out instances of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @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 WebAppInstanceCollection} 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 _listInstanceIdentifiers(resourceGroupName, name, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['WebAppInstanceCollection']().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 Get the status of the last MSDeploy operation. + * + * Get the status of the last MSDeploy operation. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {string} instanceId ID of web app instance. + * + * @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 MSDeployStatus} 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 _getInstanceMsDeployStatus(resourceGroupName, name, instanceId, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (instanceId === null || instanceId === undefined || typeof instanceId.valueOf() !== 'string') { + throw new Error('instanceId cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}/extensions/MSDeploy'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{instanceId}', encodeURIComponent(instanceId)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['MSDeployStatus']().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 Invoke the MSDeploy web app extension. + * + * Invoke the MSDeploy web app extension. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {string} instanceId ID of web app instance. + * + * @param {object} mSDeploy Details of MSDeploy operation + * + * @param {string} [mSDeploy.packageUri] Package URI + * + * @param {string} [mSDeploy.connectionString] SQL Connection String + * + * @param {string} [mSDeploy.dbType] Database Type + * + * @param {string} [mSDeploy.setParametersXmlFileUri] URI of MSDeploy + * Parameters file. Must not be set if SetParameters is used. + * + * @param {object} [mSDeploy.setParameters] MSDeploy Parameters. Must not be + * set if SetParametersXmlFileUri is used. + * + * @param {boolean} [mSDeploy.skipAppData] Controls whether the MSDeploy + * operation skips the App_Data directory. + * If set to true, the existing App_Data directory on the + * destination + * will not be deleted, and any App_Data directory in the source will be + * ignored. + * Setting is false by default. + * + * @param {boolean} [mSDeploy.appOffline] Sets the AppOffline rule while the + * MSDeploy operation executes. + * Setting is false by default. + * + * @param {string} [mSDeploy.kind] Kind of resource. + * + * @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 MSDeployStatus} 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 _createInstanceMSDeployOperation(resourceGroupName, name, instanceId, mSDeploy, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + + if (!callback) { + throw new Error('callback cannot be null.'); + } + + // Send request + this.beginCreateInstanceMSDeployOperation(resourceGroupName, name, instanceId, mSDeploy, options, (err, parsedResult, httpRequest, response) => { + if (err) return callback(err); + + let initialResult = new msRest.HttpOperationResponse(); + initialResult.request = httpRequest; + initialResult.response = response; + initialResult.body = response.body; + client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { + if (err) return callback(err); + + // Create Result + let result = null; + + httpRequest = pollingResult.request; + response = pollingResult.response; + let responseBody = pollingResult.body; + if (responseBody === '') responseBody = null; + + // Deserialize Response + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['MSDeployStatus']().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 Get the MSDeploy Log for the last MSDeploy operation. + * + * Get the MSDeploy Log for the last MSDeploy operation. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {string} instanceId ID of web app instance. + * + * @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 MSDeployLog} 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 _getInstanceMSDeployLog(resourceGroupName, name, instanceId, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (instanceId === null || instanceId === undefined || typeof instanceId.valueOf() !== 'string') { + throw new Error('instanceId cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}/extensions/MSDeploy/log'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{instanceId}', encodeURIComponent(instanceId)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 404) { + 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['MSDeployLog']().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 Get list of processes for a web site, or a deployment slot, or for + * a specific scaled-out instance in a web site. + * + * Get list of processes for a web site, or a deployment slot, or for a + * specific scaled-out instance in a web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} instanceId ID of a specific scaled-out instance. This is the + * value of the name property in the JSON response from "GET + * api/sites/{siteName}/instances". + * + * @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 ProcessInfoCollection} 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 _listInstanceProcesses(resourceGroupName, name, instanceId, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (instanceId === null || instanceId === undefined || typeof instanceId.valueOf() !== 'string') { + throw new Error('instanceId cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}/processes'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{instanceId}', encodeURIComponent(instanceId)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 404) { + 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['ProcessInfoCollection']().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 Get process information by its ID for a specific scaled-out + * instance in a web site. + * + * Get process information by its ID for a specific scaled-out instance in a + * web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @param {string} instanceId ID of a specific scaled-out instance. This is the + * value of the name property in the JSON response from "GET + * api/sites/{siteName}/instances". + * + * @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 ProcessInfo} 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 _getInstanceProcess(resourceGroupName, name, processId, instanceId, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (processId === null || processId === undefined || typeof processId.valueOf() !== 'string') { + throw new Error('processId cannot be null or undefined and it must be of type string.'); + } + if (instanceId === null || instanceId === undefined || typeof instanceId.valueOf() !== 'string') { + throw new Error('instanceId cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}/processes/{processId}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{processId}', encodeURIComponent(processId)); + requestUrl = requestUrl.replace('{instanceId}', encodeURIComponent(instanceId)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 404) { + 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['ProcessInfo']().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 Terminate a process by its ID for a web site, or a deployment slot, + * or specific scaled-out instance in a web site. + * + * Terminate a process by its ID for a web site, or a deployment slot, or + * specific scaled-out instance in a web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @param {string} instanceId ID of a specific scaled-out instance. This is the + * value of the name property in the JSON response from "GET + * api/sites/{siteName}/instances". + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _deleteInstanceProcess(resourceGroupName, name, processId, instanceId, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (processId === null || processId === undefined || typeof processId.valueOf() !== 'string') { + throw new Error('processId cannot be null or undefined and it must be of type string.'); + } + if (instanceId === null || instanceId === undefined || typeof instanceId.valueOf() !== 'string') { + throw new Error('instanceId cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}/processes/{processId}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{processId}', encodeURIComponent(processId)); + requestUrl = requestUrl.replace('{instanceId}', encodeURIComponent(instanceId)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'DELETE'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 204 && statusCode !== 404) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + + return callback(null, result, httpRequest, response); + }); +} + +/** + * @summary Get a memory dump of a process by its ID for a specific scaled-out + * instance in a web site. + * + * Get a memory dump of a process by its ID for a specific scaled-out instance + * in a web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @param {string} instanceId ID of a specific scaled-out instance. This is the + * value of the name property in the JSON response from "GET + * api/sites/{siteName}/instances". + * + * @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. + * + * {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 _getInstanceProcessDump(resourceGroupName, name, processId, instanceId, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (processId === null || processId === undefined || typeof processId.valueOf() !== 'string') { + throw new Error('processId cannot be null or undefined and it must be of type string.'); + } + if (instanceId === null || instanceId === undefined || typeof instanceId.valueOf() !== 'string') { + throw new Error('instanceId cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}/processes/{processId}/dump'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{processId}', encodeURIComponent(processId)); + requestUrl = requestUrl.replace('{instanceId}', encodeURIComponent(instanceId)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + httpRequest.streamedResponse = true; + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 404) { + let error = new Error(`Unexpected status code: ${statusCode}`); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + if (responseBody !== undefined) 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 = response; + return callback(null, result, httpRequest, response); + }); +} + +/** + * @summary List module information for a process by its ID for a specific + * scaled-out instance in a web site. + * + * List module information for a process by its ID for a specific scaled-out + * instance in a web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @param {string} instanceId ID of a specific scaled-out instance. This is the + * value of the name property in the JSON response from "GET + * api/sites/{siteName}/instances". + * + * @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 ProcessModuleInfoCollection} 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 _listInstanceProcessModules(resourceGroupName, name, processId, instanceId, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (processId === null || processId === undefined || typeof processId.valueOf() !== 'string') { + throw new Error('processId cannot be null or undefined and it must be of type string.'); + } + if (instanceId === null || instanceId === undefined || typeof instanceId.valueOf() !== 'string') { + throw new Error('instanceId cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}/processes/{processId}/modules'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{processId}', encodeURIComponent(processId)); + requestUrl = requestUrl.replace('{instanceId}', encodeURIComponent(instanceId)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 404) { + 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['ProcessModuleInfoCollection']().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 Get process information by its ID for a specific scaled-out + * instance in a web site. + * + * Get process information by its ID for a specific scaled-out instance in a + * web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @param {string} baseAddress Module base address. + * + * @param {string} instanceId ID of a specific scaled-out instance. This is the + * value of the name property in the JSON response from "GET + * api/sites/{siteName}/instances". + * + * @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 ProcessModuleInfo} 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 _getInstanceProcessModule(resourceGroupName, name, processId, baseAddress, instanceId, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (processId === null || processId === undefined || typeof processId.valueOf() !== 'string') { + throw new Error('processId cannot be null or undefined and it must be of type string.'); + } + if (baseAddress === null || baseAddress === undefined || typeof baseAddress.valueOf() !== 'string') { + throw new Error('baseAddress cannot be null or undefined and it must be of type string.'); + } + if (instanceId === null || instanceId === undefined || typeof instanceId.valueOf() !== 'string') { + throw new Error('instanceId cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}/processes/{processId}/modules/{baseAddress}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{processId}', encodeURIComponent(processId)); + requestUrl = requestUrl.replace('{baseAddress}', encodeURIComponent(baseAddress)); + requestUrl = requestUrl.replace('{instanceId}', encodeURIComponent(instanceId)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 404) { + 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['ProcessModuleInfo']().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 List the threads in a process by its ID for a specific scaled-out + * instance in a web site. + * + * List the threads in a process by its ID for a specific scaled-out instance + * in a web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @param {string} instanceId ID of a specific scaled-out instance. This is the + * value of the name property in the JSON response from "GET + * api/sites/{siteName}/instances". + * + * @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 ProcessThreadInfoCollection} 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 _listInstanceProcessThreads(resourceGroupName, name, processId, instanceId, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (processId === null || processId === undefined || typeof processId.valueOf() !== 'string') { + throw new Error('processId cannot be null or undefined and it must be of type string.'); + } + if (instanceId === null || instanceId === undefined || typeof instanceId.valueOf() !== 'string') { + throw new Error('instanceId cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}/processes/{processId}/threads'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{processId}', encodeURIComponent(processId)); + requestUrl = requestUrl.replace('{instanceId}', encodeURIComponent(instanceId)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 404) { + 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['ProcessThreadInfoCollection']().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 Get thread information by Thread ID for a specific process, in a + * specific scaled-out instance in a web site. + * + * Get thread information by Thread ID for a specific process, in a specific + * scaled-out instance in a web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @param {string} threadId TID. + * + * @param {string} instanceId ID of a specific scaled-out instance. This is the + * value of the name property in the JSON response from "GET + * api/sites/{siteName}/instances". + * + * @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 ProcessThreadInfo} 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 _getInstanceProcessThread(resourceGroupName, name, processId, threadId, instanceId, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (processId === null || processId === undefined || typeof processId.valueOf() !== 'string') { + throw new Error('processId cannot be null or undefined and it must be of type string.'); + } + if (threadId === null || threadId === undefined || typeof threadId.valueOf() !== 'string') { + throw new Error('threadId cannot be null or undefined and it must be of type string.'); + } + if (instanceId === null || instanceId === undefined || typeof instanceId.valueOf() !== 'string') { + throw new Error('instanceId cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}/processes/{processId}/threads/{threadId}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{processId}', encodeURIComponent(processId)); + requestUrl = requestUrl.replace('{threadId}', encodeURIComponent(threadId)); + requestUrl = requestUrl.replace('{instanceId}', encodeURIComponent(instanceId)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 404) { + 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['ProcessThreadInfo']().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 Shows whether an app can be cloned to another resource group or + * subscription. + * + * Shows whether an app can be cloned to another resource group or + * subscription. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @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 SiteCloneability} 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 _isCloneable(resourceGroupName, name, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/iscloneable'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + 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]; + } + } + } + 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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['SiteCloneability']().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 This is to allow calling via powershell and ARM template. + * + * This is to allow calling via powershell and ARM template. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @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 FunctionSecrets} 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 _listSyncFunctionTriggers(resourceGroupName, name, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/listsyncfunctiontriggerstatus'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + 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]; + } + } + } + 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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['FunctionSecrets']().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 all metric definitions of an app (or deployment slot, if + * specified). + * + * Gets all metric definitions of an app (or deployment slot, if specified). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @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 ResourceMetricDefinitionCollection} 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 _listMetricDefinitions(resourceGroupName, name, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/metricdefinitions'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['ResourceMetricDefinitionCollection']().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 performance metrics of an app (or deployment slot, if + * specified). + * + * Gets performance metrics of an app (or deployment slot, if specified). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} [options] Optional Parameters. + * + * @param {boolean} [options.details] Specify "true" to include metric details + * in the response. It is "false" by default. + * + * @param {string} [options.filter] Return only metrics specified in the filter + * (using OData syntax). For example: $filter=(name.value eq 'Metric1' or + * name.value eq 'Metric2') and startTime eq 2014-01-01T00:00:00Z and endTime + * eq 2014-12-31T23:59:59Z and timeGrain eq duration'[Hour|Minute|Day]'. + * + * @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 ResourceMetricCollection} 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 _listMetrics(resourceGroupName, name, 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 details = (options && options.details !== undefined) ? options.details : undefined; + let filter = (options && options.filter !== undefined) ? options.filter : undefined; + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (details !== null && details !== undefined && typeof details !== 'boolean') { + throw new Error('details must be of type boolean.'); + } + if (filter !== null && filter !== undefined && typeof filter.valueOf() !== 'string') { + throw new Error('filter must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/metrics'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + if (details !== null && details !== undefined) { + queryParameters.push('details=' + encodeURIComponent(details.toString())); + } + if (filter !== null && filter !== undefined) { + queryParameters.push('$filter=' + filter); + } + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['ResourceMetricCollection']().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 Restores a web app. + * + * Restores a web app. + * + * @param {string} subscriptionName Azure subscription. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {object} migrationOptions Migration migrationOptions. + * + * @param {string} migrationOptions.azurefilesConnectionString AzureFiles + * connection string. + * + * @param {string} migrationOptions.azurefilesShare AzureFiles share. + * + * @param {boolean} [migrationOptions.switchSiteAfterMigration] + * trueif the app should be switched over; otherwise, + * false. + * + * @param {boolean} [migrationOptions.blockWriteAccessToSite] true + * if the app should be read only during copy operation; otherwise, + * false. + * + * @param {string} [migrationOptions.kind] Kind of resource. + * + * @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 StorageMigrationResponse} 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 _migrateStorage(subscriptionName, resourceGroupName, name, migrationOptions, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + + if (!callback) { + throw new Error('callback cannot be null.'); + } + + // Send request + this.beginMigrateStorage(subscriptionName, resourceGroupName, name, migrationOptions, options, (err, parsedResult, httpRequest, response) => { + if (err) return callback(err); + + let initialResult = new msRest.HttpOperationResponse(); + initialResult.request = httpRequest; + initialResult.response = response; + initialResult.body = response.body; + client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { + if (err) return callback(err); + + // Create Result + let result = null; + + httpRequest = pollingResult.request; + response = pollingResult.response; + let responseBody = pollingResult.body; + if (responseBody === '') responseBody = null; + + // Deserialize Response + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['StorageMigrationResponse']().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 Migrates a local (in-app) MySql database to a remote MySql + * database. + * + * Migrates a local (in-app) MySql database to a remote MySql database. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {object} migrationRequestEnvelope MySql migration options. + * + * @param {string} migrationRequestEnvelope.connectionString Connection string + * to the remote MySQL database. + * + * @param {string} migrationRequestEnvelope.migrationType The type of migration + * operation to be done. Possible values include: 'LocalToRemote', + * 'RemoteToLocal' + * + * @param {string} [migrationRequestEnvelope.kind] Kind of resource. + * + * @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 Operation} 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 _migrateMySql(resourceGroupName, name, migrationRequestEnvelope, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + + if (!callback) { + throw new Error('callback cannot be null.'); + } + + // Send request + this.beginMigrateMySql(resourceGroupName, name, migrationRequestEnvelope, options, (err, parsedResult, httpRequest, response) => { + if (err) return callback(err); + + let initialResult = new msRest.HttpOperationResponse(); + initialResult.request = httpRequest; + initialResult.response = response; + initialResult.body = response.body; + client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { + if (err) return callback(err); + + // Create Result + let result = null; + + httpRequest = pollingResult.request; + response = pollingResult.response; + let responseBody = pollingResult.body; + if (responseBody === '') responseBody = null; + + // Deserialize Response + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['Operation']().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 Returns the status of MySql in app migration, if one is active, and + * whether or not MySql in app is enabled + * + * Returns the status of MySql in app migration, if one is active, and whether + * or not MySql in app is enabled + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @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 MigrateMySqlStatus} 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 _getMigrateMySqlStatus(resourceGroupName, name, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/migratemysql/status'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['MigrateMySqlStatus']().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 all network features used by the app (or deployment slot, if + * specified). + * + * Gets all network features used by the app (or deployment slot, if + * specified). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} view The type of view. This can either be "summary" or + * "detailed". + * + * @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 NetworkFeatures} 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 _listNetworkFeatures(resourceGroupName, name, view, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (view === null || view === undefined || typeof view.valueOf() !== 'string') { + throw new Error('view cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkFeatures/{view}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{view}', encodeURIComponent(view)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 404) { + 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['NetworkFeatures']().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 Start capturing network packets for the site. + * + * Start capturing network packets for the site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.durationInSeconds] The duration to keep capturing + * in seconds. + * + * @param {number} [options.maxFrameLength] The maximum frame length in bytes + * (Optional). + * + * @param {string} [options.sasUrl] The Blob URL to store capture file. + * + * @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. + * + * {string} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _startWebSiteNetworkTrace(resourceGroupName, name, 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 durationInSeconds = (options && options.durationInSeconds !== undefined) ? options.durationInSeconds : undefined; + let maxFrameLength = (options && options.maxFrameLength !== undefined) ? options.maxFrameLength : undefined; + let sasUrl = (options && options.sasUrl !== undefined) ? options.sasUrl : undefined; + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (durationInSeconds !== null && durationInSeconds !== undefined && typeof durationInSeconds !== 'number') { + throw new Error('durationInSeconds must be of type number.'); + } + if (maxFrameLength !== null && maxFrameLength !== undefined && typeof maxFrameLength !== 'number') { + throw new Error('maxFrameLength must be of type number.'); + } + if (sasUrl !== null && sasUrl !== undefined && typeof sasUrl.valueOf() !== 'string') { + throw new Error('sasUrl must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkTrace/start'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + if (durationInSeconds !== null && durationInSeconds !== undefined) { + queryParameters.push('durationInSeconds=' + encodeURIComponent(durationInSeconds.toString())); + } + if (maxFrameLength !== null && maxFrameLength !== undefined) { + queryParameters.push('maxFrameLength=' + encodeURIComponent(maxFrameLength.toString())); + } + if (sasUrl !== null && sasUrl !== undefined) { + queryParameters.push('sasUrl=' + encodeURIComponent(sasUrl)); + } + 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]; + } + } + } + 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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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 = { + required: false, + serializedName: 'parsedResponse', + type: { + name: 'String' + } + }; + 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 Stop ongoing capturing network packets for the site. + * + * Stop ongoing capturing network packets for the site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @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. + * + * {string} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _stopWebSiteNetworkTrace(resourceGroupName, name, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkTrace/stop'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + 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]; + } + } + } + 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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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 = { + required: false, + serializedName: 'parsedResponse', + type: { + name: 'String' + } + }; + 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 Generates a new publishing password for an app (or deployment slot, + * if specified). + * + * Generates a new publishing password for an app (or deployment slot, if + * specified). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _generateNewSitePublishingPassword(resourceGroupName, name, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/newpassword'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + 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]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 204) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + + return callback(null, result, httpRequest, response); + }); +} + +/** + * @summary Gets perfmon counters for web app. + * + * Gets perfmon counters for web app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.filter] Return only usages/metrics specified in the + * filter. Filter conforms to odata syntax. Example: $filter=(startTime eq + * 2014-01-01T00:00:00Z and endTime eq 2014-12-31T23:59:59Z and timeGrain eq + * duration'[Hour|Minute|Day]'. + * + * @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 PerfMonCounterCollection} 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 _listPerfMonCounters(resourceGroupName, name, 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 filter = (options && options.filter !== undefined) ? options.filter : undefined; + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (filter !== null && filter !== undefined && typeof filter.valueOf() !== 'string') { + throw new Error('filter must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/perfcounters'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + if (filter !== null && filter !== undefined) { + queryParameters.push('$filter=' + filter); + } + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['PerfMonCounterCollection']().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 web app's event logs. + * + * Gets web app's event logs. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @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 SitePhpErrorLogFlag} 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 _getSitePhpErrorLogFlag(resourceGroupName, name, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/phplogging'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['SitePhpErrorLogFlag']().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 the premier add-ons of an app. + * + * Gets the premier add-ons of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @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 PremierAddOn} 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 _listPremierAddOns(resourceGroupName, name, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/premieraddons'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['PremierAddOn']().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 named add-on of an app. + * + * Gets a named add-on of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} premierAddOnName Add-on name. + * + * @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 PremierAddOn} 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 _getPremierAddOn(resourceGroupName, name, premierAddOnName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (premierAddOnName === null || premierAddOnName === undefined || typeof premierAddOnName.valueOf() !== 'string') { + throw new Error('premierAddOnName cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/premieraddons/{premierAddOnName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{premierAddOnName}', encodeURIComponent(premierAddOnName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['PremierAddOn']().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 Updates a named add-on of an app. + * + * Updates a named add-on of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} premierAddOnName Add-on name. + * + * @param {object} premierAddOn A JSON representation of the edited premier + * add-on. + * + * @param {string} [premierAddOn.sku] Premier add on SKU. + * + * @param {string} [premierAddOn.product] Premier add on Product. + * + * @param {string} [premierAddOn.vendor] Premier add on Vendor. + * + * @param {string} [premierAddOn.marketplacePublisher] Premier add on + * Marketplace publisher. + * + * @param {string} [premierAddOn.marketplaceOffer] Premier add on Marketplace + * offer. + * + * @param {string} [premierAddOn.kind] Kind of resource. + * + * @param {string} premierAddOn.location Resource Location. + * + * @param {object} [premierAddOn.tags] Resource tags. + * + * @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 PremierAddOn} 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 _addPremierAddOn(resourceGroupName, name, premierAddOnName, premierAddOn, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (premierAddOnName === null || premierAddOnName === undefined || typeof premierAddOnName.valueOf() !== 'string') { + throw new Error('premierAddOnName cannot be null or undefined and it must be of type string.'); + } + if (premierAddOn === null || premierAddOn === undefined) { + throw new Error('premierAddOn cannot be null or undefined.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/premieraddons/{premierAddOnName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{premierAddOnName}', encodeURIComponent(premierAddOnName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'PUT'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (premierAddOn !== null && premierAddOn !== undefined) { + let requestModelMapper = new client.models['PremierAddOn']().mapper(); + requestModel = client.serialize(requestModelMapper, premierAddOn, 'premierAddOn'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(premierAddOn, 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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['PremierAddOn']().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 Delete a premier add-on from an app. + * + * Delete a premier add-on from an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} premierAddOnName Add-on name. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _deletePremierAddOn(resourceGroupName, name, premierAddOnName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (premierAddOnName === null || premierAddOnName === undefined || typeof premierAddOnName.valueOf() !== 'string') { + throw new Error('premierAddOnName cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/premieraddons/{premierAddOnName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{premierAddOnName}', encodeURIComponent(premierAddOnName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'DELETE'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + + return callback(null, result, httpRequest, response); + }); +} + +/** + * @summary Updates a named add-on of an app. + * + * Updates a named add-on of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} premierAddOnName Add-on name. + * + * @param {object} premierAddOn A JSON representation of the edited premier + * add-on. + * + * @param {string} [premierAddOn.sku] Premier add on SKU. + * + * @param {string} [premierAddOn.product] Premier add on Product. + * + * @param {string} [premierAddOn.vendor] Premier add on Vendor. + * + * @param {string} [premierAddOn.marketplacePublisher] Premier add on + * Marketplace publisher. + * + * @param {string} [premierAddOn.marketplaceOffer] Premier add on Marketplace + * offer. + * + * @param {string} [premierAddOn.kind] Kind of resource. + * + * @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 PremierAddOn} 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 _updatePremierAddOn(resourceGroupName, name, premierAddOnName, premierAddOn, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (premierAddOnName === null || premierAddOnName === undefined || typeof premierAddOnName.valueOf() !== 'string') { + throw new Error('premierAddOnName cannot be null or undefined and it must be of type string.'); + } + if (premierAddOn === null || premierAddOn === undefined) { + throw new Error('premierAddOn cannot be null or undefined.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/premieraddons/{premierAddOnName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{premierAddOnName}', encodeURIComponent(premierAddOnName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'PATCH'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (premierAddOn !== null && premierAddOn !== undefined) { + let requestModelMapper = new client.models['PremierAddOnPatchResource']().mapper(); + requestModel = client.serialize(requestModelMapper, premierAddOn, 'premierAddOn'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(premierAddOn, 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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['PremierAddOn']().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 data around private site access enablement and authorized + * Virtual Networks that can access the site. + * + * Gets data around private site access enablement and authorized Virtual + * Networks that can access the site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @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 PrivateAccess} 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 _getPrivateAccess(resourceGroupName, name, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/privateAccess/virtualNetworks'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['PrivateAccess']().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 Sets data around private site access enablement and authorized + * Virtual Networks that can access the site. + * + * Sets data around private site access enablement and authorized Virtual + * Networks that can access the site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @param {object} access The information for the private access + * + * @param {boolean} [access.enabled] Whether private access is enabled or not. + * + * @param {array} [access.virtualNetworks] The Virtual Networks (and subnets) + * allowed to access the site privately. + * + * @param {string} [access.kind] Kind of resource. + * + * @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 PrivateAccess} 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 _putPrivateAccessVnet(resourceGroupName, name, access, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (access === null || access === undefined) { + throw new Error('access cannot be null or undefined.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/privateAccess/virtualNetworks'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'PUT'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (access !== null && access !== undefined) { + let requestModelMapper = new client.models['PrivateAccess']().mapper(); + requestModel = client.serialize(requestModelMapper, access, 'access'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(access, 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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['PrivateAccess']().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 Get list of processes for a web site, or a deployment slot, or for + * a specific scaled-out instance in a web site. + * + * Get list of processes for a web site, or a deployment slot, or for a + * specific scaled-out instance in a web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @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 ProcessInfoCollection} 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 _listProcesses(resourceGroupName, name, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/processes'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 404) { + 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['ProcessInfoCollection']().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 Get process information by its ID for a specific scaled-out + * instance in a web site. + * + * Get process information by its ID for a specific scaled-out instance in a + * web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @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 ProcessInfo} 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 _getProcess(resourceGroupName, name, processId, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (processId === null || processId === undefined || typeof processId.valueOf() !== 'string') { + throw new Error('processId cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/processes/{processId}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{processId}', encodeURIComponent(processId)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 404) { + 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['ProcessInfo']().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 Terminate a process by its ID for a web site, or a deployment slot, + * or specific scaled-out instance in a web site. + * + * Terminate a process by its ID for a web site, or a deployment slot, or + * specific scaled-out instance in a web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _deleteProcess(resourceGroupName, name, processId, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (processId === null || processId === undefined || typeof processId.valueOf() !== 'string') { + throw new Error('processId cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/processes/{processId}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{processId}', encodeURIComponent(processId)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'DELETE'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 204 && statusCode !== 404) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + + return callback(null, result, httpRequest, response); + }); +} + +/** + * @summary Get a memory dump of a process by its ID for a specific scaled-out + * instance in a web site. + * + * Get a memory dump of a process by its ID for a specific scaled-out instance + * in a web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @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. + * + * {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 _getProcessDump(resourceGroupName, name, processId, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (processId === null || processId === undefined || typeof processId.valueOf() !== 'string') { + throw new Error('processId cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/processes/{processId}/dump'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{processId}', encodeURIComponent(processId)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + httpRequest.streamedResponse = true; + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 404) { + let error = new Error(`Unexpected status code: ${statusCode}`); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + if (responseBody !== undefined) 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 = response; + return callback(null, result, httpRequest, response); + }); +} + +/** + * @summary List module information for a process by its ID for a specific + * scaled-out instance in a web site. + * + * List module information for a process by its ID for a specific scaled-out + * instance in a web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @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 ProcessModuleInfoCollection} 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 _listProcessModules(resourceGroupName, name, processId, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (processId === null || processId === undefined || typeof processId.valueOf() !== 'string') { + throw new Error('processId cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/processes/{processId}/modules'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{processId}', encodeURIComponent(processId)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 404) { + 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['ProcessModuleInfoCollection']().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 Get process information by its ID for a specific scaled-out + * instance in a web site. + * + * Get process information by its ID for a specific scaled-out instance in a + * web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @param {string} baseAddress Module base address. + * + * @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 ProcessModuleInfo} 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 _getProcessModule(resourceGroupName, name, processId, baseAddress, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (processId === null || processId === undefined || typeof processId.valueOf() !== 'string') { + throw new Error('processId cannot be null or undefined and it must be of type string.'); + } + if (baseAddress === null || baseAddress === undefined || typeof baseAddress.valueOf() !== 'string') { + throw new Error('baseAddress cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/processes/{processId}/modules/{baseAddress}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{processId}', encodeURIComponent(processId)); + requestUrl = requestUrl.replace('{baseAddress}', encodeURIComponent(baseAddress)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 404) { + 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['ProcessModuleInfo']().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 List the threads in a process by its ID for a specific scaled-out + * instance in a web site. + * + * List the threads in a process by its ID for a specific scaled-out instance + * in a web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @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 ProcessThreadInfoCollection} 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 _listProcessThreads(resourceGroupName, name, processId, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (processId === null || processId === undefined || typeof processId.valueOf() !== 'string') { + throw new Error('processId cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/processes/{processId}/threads'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{processId}', encodeURIComponent(processId)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 404) { + 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['ProcessThreadInfoCollection']().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 Get thread information by Thread ID for a specific process, in a + * specific scaled-out instance in a web site. + * + * Get thread information by Thread ID for a specific process, in a specific + * scaled-out instance in a web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @param {string} threadId TID. + * + * @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 ProcessThreadInfo} 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 _getProcessThread(resourceGroupName, name, processId, threadId, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (processId === null || processId === undefined || typeof processId.valueOf() !== 'string') { + throw new Error('processId cannot be null or undefined and it must be of type string.'); + } + if (threadId === null || threadId === undefined || typeof threadId.valueOf() !== 'string') { + throw new Error('threadId cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/processes/{processId}/threads/{threadId}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{processId}', encodeURIComponent(processId)); + requestUrl = requestUrl.replace('{threadId}', encodeURIComponent(threadId)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 404) { + 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['ProcessThreadInfo']().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 Get public certificates for an app or a deployment slot. + * + * Get public certificates for an app or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @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 PublicCertificateCollection} 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 _listPublicCertificates(resourceGroupName, name, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/publicCertificates'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['PublicCertificateCollection']().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 Get the named public certificate for an app (or deployment slot, if + * specified). + * + * Get the named public certificate for an app (or deployment slot, if + * specified). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} publicCertificateName Public certificate name. + * + * @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 PublicCertificate} 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 _getPublicCertificate(resourceGroupName, name, publicCertificateName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (publicCertificateName === null || publicCertificateName === undefined || typeof publicCertificateName.valueOf() !== 'string') { + throw new Error('publicCertificateName cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/publicCertificates/{publicCertificateName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{publicCertificateName}', encodeURIComponent(publicCertificateName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['PublicCertificate']().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 Creates a hostname binding for an app. + * + * Creates a hostname binding for an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} publicCertificateName Public certificate name. + * + * @param {object} publicCertificate Public certificate details. This is the + * JSON representation of a PublicCertificate object. + * + * @param {buffer} [publicCertificate.blob] Public Certificate byte array + * + * @param {string} [publicCertificate.publicCertificateLocation] Public + * Certificate Location. Possible values include: 'CurrentUserMy', + * 'LocalMachineMy', 'Unknown' + * + * @param {string} [publicCertificate.kind] Kind of resource. + * + * @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 PublicCertificate} 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 _createOrUpdatePublicCertificate(resourceGroupName, name, publicCertificateName, publicCertificate, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (publicCertificateName === null || publicCertificateName === undefined || typeof publicCertificateName.valueOf() !== 'string') { + throw new Error('publicCertificateName cannot be null or undefined and it must be of type string.'); + } + if (publicCertificate === null || publicCertificate === undefined) { + throw new Error('publicCertificate cannot be null or undefined.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/publicCertificates/{publicCertificateName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{publicCertificateName}', encodeURIComponent(publicCertificateName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'PUT'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (publicCertificate !== null && publicCertificate !== undefined) { + let requestModelMapper = new client.models['PublicCertificate']().mapper(); + requestModel = client.serialize(requestModelMapper, publicCertificate, 'publicCertificate'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(publicCertificate, 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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['PublicCertificate']().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 Deletes a hostname binding for an app. + * + * Deletes a hostname binding for an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} publicCertificateName Public certificate name. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _deletePublicCertificate(resourceGroupName, name, publicCertificateName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (publicCertificateName === null || publicCertificateName === undefined || typeof publicCertificateName.valueOf() !== 'string') { + throw new Error('publicCertificateName cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/publicCertificates/{publicCertificateName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{publicCertificateName}', encodeURIComponent(publicCertificateName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'DELETE'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 204) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + + return callback(null, result, httpRequest, response); + }); +} + +/** + * @summary Gets the publishing profile for an app (or deployment slot, if + * specified). + * + * Gets the publishing profile for an app (or deployment slot, if specified). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} publishingProfileOptions Specifies publishingProfileOptions + * for publishing profile. For example, use {"format": "FileZilla3"} to get a + * FileZilla publishing profile. + * + * @param {string} [publishingProfileOptions.format] Name of the format. Valid + * values are: + * FileZilla3 + * WebDeploy -- default + * Ftp. Possible values include: 'FileZilla3', 'WebDeploy', 'Ftp' + * + * @param {boolean} [publishingProfileOptions.includeDisasterRecoveryEndpoints] + * Include the DisasterRecover endpoint if true + * + * @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. + * + * {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 _listPublishingProfileXmlWithSecrets(resourceGroupName, name, publishingProfileOptions, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (publishingProfileOptions === null || publishingProfileOptions === undefined) { + throw new Error('publishingProfileOptions cannot be null or undefined.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/publishxml'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + 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 (publishingProfileOptions !== null && publishingProfileOptions !== undefined) { + let requestModelMapper = new client.models['CsmPublishingProfileOptions']().mapper(); + requestModel = client.serialize(requestModelMapper, publishingProfileOptions, 'publishingProfileOptions'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(publishingProfileOptions, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + httpRequest.streamedResponse = true; + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(`Unexpected status code: ${statusCode}`); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + if (responseBody !== undefined) parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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 = response; + return callback(null, result, httpRequest, response); + }); +} + +/** + * @summary Resets the configuration settings of the current slot if they were + * previously modified by calling the API with POST. + * + * Resets the configuration settings of the current slot if they were + * previously modified by calling the API with POST. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _resetProductionSlotConfig(resourceGroupName, name, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/resetSlotConfig'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + 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]; + } + } + } + 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; + + return callback(null, result, httpRequest, response); + }); +} + +/** + * @summary Restarts an app (or deployment slot, if specified). + * + * Restarts an app (or deployment slot, if specified). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} [options] Optional Parameters. + * + * @param {boolean} [options.softRestart] Specify true to apply the + * configuration settings and restarts the app only if necessary. By default, + * the API always restarts and reprovisions the app. + * + * @param {boolean} [options.synchronous] Specify true to block until the app + * is restarted. By default, it is set to false, and the API responds + * immediately (asynchronous). + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _restart(resourceGroupName, name, 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 softRestart = (options && options.softRestart !== undefined) ? options.softRestart : undefined; + let synchronous = (options && options.synchronous !== undefined) ? options.synchronous : undefined; + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (softRestart !== null && softRestart !== undefined && typeof softRestart !== 'boolean') { + throw new Error('softRestart must be of type boolean.'); + } + if (synchronous !== null && synchronous !== undefined && typeof synchronous !== 'boolean') { + throw new Error('synchronous 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.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/restart'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + if (softRestart !== null && softRestart !== undefined) { + queryParameters.push('softRestart=' + encodeURIComponent(softRestart.toString())); + } + if (synchronous !== null && synchronous !== undefined) { + queryParameters.push('synchronous=' + encodeURIComponent(synchronous.toString())); + } + 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]; + } + } + } + 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; + + return callback(null, result, httpRequest, response); + }); +} + + +/** + * @summary Restores an app from a backup blob in Azure Storage. + * + * Restores an app from a backup blob in Azure Storage. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} request Information on restore request . + * + * @param {string} request.storageAccountUrl SAS URL to the container. + * + * @param {string} [request.blobName] Name of a blob which contains the backup. + * + * @param {boolean} request.overwrite true if the restore + * operation can overwrite target app; otherwise, false. + * true is needed if trying to restore over an existing app. + * + * @param {string} [request.siteName] Name of an app. + * + * @param {array} [request.databases] Collection of databases which should be + * restored. This list has to match the list of databases included in the + * backup. + * + * @param {boolean} [request.ignoreConflictingHostNames] Changes a logic when + * restoring an app with custom domains. true to remove custom + * domains automatically. If false, custom domains are added to + * the app's object when it is being restored, but that might fail due to + * conflicts during the operation. + * + * @param {boolean} [request.ignoreDatabases] Ignore the databases and only + * restore the site content + * + * @param {string} [request.appServicePlan] Specify app service plan that will + * own restored site. + * + * @param {string} [request.operationType] Operation type. Possible values + * include: 'Default', 'Clone', 'Relocation', 'Snapshot', 'CloudFS' + * + * @param {boolean} [request.adjustConnectionStrings] true if + * SiteConfig.ConnectionStrings should be set in new app; otherwise, + * false. + * + * @param {string} [request.hostingEnvironment] App Service Environment name, + * if needed (only when restoring an app to an App Service Environment). + * + * @param {string} [request.kind] Kind of resource. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _restoreFromBackupBlob(resourceGroupName, name, request, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + + if (!callback) { + throw new Error('callback cannot be null.'); + } + + // Send request + this.beginRestoreFromBackupBlob(resourceGroupName, name, request, options, (err, parsedResult, httpRequest, response) => { + if (err) return callback(err); + + let initialResult = new msRest.HttpOperationResponse(); + initialResult.request = httpRequest; + initialResult.response = response; + initialResult.body = response.body; + client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { + if (err) return callback(err); + + // Create Result + let result = null; + + httpRequest = pollingResult.request; + response = pollingResult.response; + let responseBody = pollingResult.body; + if (responseBody === '') responseBody = null; + + // Deserialize Response + + return callback(null, result, httpRequest, response); + }); + }); +} + + +/** + * @summary Restores a deleted web app to this web app. + * + * Restores a deleted web app to this web app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {object} restoreRequest Deleted web app restore information. + * + * @param {string} [restoreRequest.deletedSiteId] ARM resource ID of the + * deleted app. Example: + * /subscriptions/{subId}/providers/Microsoft.Web/deletedSites/{deletedSiteId} + * + * @param {boolean} [restoreRequest.recoverConfiguration] If true, deleted site + * configuration, in addition to content, will be restored. + * + * @param {string} [restoreRequest.snapshotTime] Point in time to restore the + * deleted app from, formatted as a DateTime string. + * If unspecified, default value is the time that the app was deleted. + * + * @param {string} [restoreRequest.kind] Kind of resource. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _restoreFromDeletedApp(resourceGroupName, name, restoreRequest, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + + if (!callback) { + throw new Error('callback cannot be null.'); + } + + // Send request + this.beginRestoreFromDeletedApp(resourceGroupName, name, restoreRequest, options, (err, parsedResult, httpRequest, response) => { + if (err) return callback(err); + + let initialResult = new msRest.HttpOperationResponse(); + initialResult.request = httpRequest; + initialResult.response = response; + initialResult.body = response.body; + client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { + if (err) return callback(err); + + // Create Result + let result = null; + + httpRequest = pollingResult.request; + response = pollingResult.response; + let responseBody = pollingResult.body; + if (responseBody === '') responseBody = null; + + // Deserialize Response + + return callback(null, result, httpRequest, response); + }); + }); +} + + +/** + * @summary Restores a web app from a snapshot. + * + * Restores a web app from a snapshot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {object} restoreRequest Snapshot restore settings. Snapshot + * information can be obtained by calling GetDeletedSites or GetSiteSnapshots + * API. + * + * @param {string} [restoreRequest.snapshotTime] Point in time in which the app + * restore should be done, formatted as a DateTime string. + * + * @param {object} [restoreRequest.recoverySource] Optional. Specifies the web + * app that snapshot contents will be retrieved from. + * If empty, the targeted web app will be used as the source. + * + * @param {string} [restoreRequest.recoverySource.location] Geographical + * location of the source web app, e.g. SouthEastAsia, SouthCentralUS + * + * @param {string} [restoreRequest.recoverySource.id] ARM resource ID of the + * source app. + * /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName} + * for production slots and + * /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/slots/{slotName} + * for other slots. + * + * @param {boolean} restoreRequest.overwrite If true the restore + * operation can overwrite source app; otherwise, false. + * + * @param {boolean} [restoreRequest.recoverConfiguration] If true, site + * configuration, in addition to content, will be reverted. + * + * @param {boolean} [restoreRequest.ignoreConflictingHostNames] If true, custom + * hostname conflicts will be ignored when recovering to a target web app. + * This setting is only necessary when RecoverConfiguration is enabled. + * + * @param {string} [restoreRequest.kind] Kind of resource. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _restoreSnapshot(resourceGroupName, name, restoreRequest, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + + if (!callback) { + throw new Error('callback cannot be null.'); + } + + // Send request + this.beginRestoreSnapshot(resourceGroupName, name, restoreRequest, options, (err, parsedResult, httpRequest, response) => { + if (err) return callback(err); + + let initialResult = new msRest.HttpOperationResponse(); + initialResult.request = httpRequest; + initialResult.response = response; + initialResult.body = response.body; + client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { + if (err) return callback(err); + + // Create Result + let result = null; + + httpRequest = pollingResult.request; + response = pollingResult.response; + let responseBody = pollingResult.body; + if (responseBody === '') responseBody = null; + + // Deserialize Response + + return callback(null, result, httpRequest, response); + }); + }); +} + +/** + * @summary Get list of siteextensions for a web site, or a deployment slot. + * + * Get list of siteextensions for a web site, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @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 SiteExtensionInfoCollection} 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 _listSiteExtensions(resourceGroupName, name, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/siteextensions'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 404) { + 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['SiteExtensionInfoCollection']().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 Get site extension information by its ID for a web site, or a + * deployment slot. + * + * Get site extension information by its ID for a web site, or a deployment + * slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} siteExtensionId Site extension name. + * + * @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 SiteExtensionInfo} 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 _getSiteExtension(resourceGroupName, name, siteExtensionId, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (siteExtensionId === null || siteExtensionId === undefined || typeof siteExtensionId.valueOf() !== 'string') { + throw new Error('siteExtensionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/siteextensions/{siteExtensionId}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{siteExtensionId}', encodeURIComponent(siteExtensionId)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 404) { + 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['SiteExtensionInfo']().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 Install site extension on a web site, or a deployment slot. + * + * Install site extension on a web site, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} siteExtensionId Site extension name. + * + * @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 SiteExtensionInfo} 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 _installSiteExtension(resourceGroupName, name, siteExtensionId, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + + if (!callback) { + throw new Error('callback cannot be null.'); + } + + // Send request + this.beginInstallSiteExtension(resourceGroupName, name, siteExtensionId, options, (err, parsedResult, httpRequest, response) => { + if (err) return callback(err); + + let initialResult = new msRest.HttpOperationResponse(); + initialResult.request = httpRequest; + initialResult.response = response; + initialResult.body = response.body; + client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { + if (err) return callback(err); + + // Create Result + let result = null; + + httpRequest = pollingResult.request; + response = pollingResult.response; + let responseBody = pollingResult.body; + if (responseBody === '') responseBody = null; + + // Deserialize Response + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['SiteExtensionInfo']().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 Remove a site extension from a web site, or a deployment slot. + * + * Remove a site extension from a web site, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} siteExtensionId Site extension name. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _deleteSiteExtension(resourceGroupName, name, siteExtensionId, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (siteExtensionId === null || siteExtensionId === undefined || typeof siteExtensionId.valueOf() !== 'string') { + throw new Error('siteExtensionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/siteextensions/{siteExtensionId}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{siteExtensionId}', encodeURIComponent(siteExtensionId)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'DELETE'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 204 && statusCode !== 404) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + + return callback(null, result, httpRequest, response); + }); +} + +/** + * @summary Gets an app's deployment slots. + * + * Gets an app's deployment slots. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @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 WebAppCollection} 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 _listSlots(resourceGroupName, name, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['WebAppCollection']().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 the details of a web, mobile, or API app. + * + * Gets the details of a web, mobile, or API app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. By default, this API + * returns the production slot. + * + * @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 Site} 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 _getSlot(resourceGroupName, name, slot, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (slot === null || slot === undefined || typeof slot.valueOf() !== 'string') { + throw new Error('slot cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 404) { + 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['Site']().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 Creates a new web, mobile, or API app in an existing resource + * group, or updates an existing app. + * + * Creates a new web, mobile, or API app in an existing resource group, or + * updates an existing app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Unique name of the app to create or update. To create + * or update a deployment slot, use the {slot} parameter. + * + * @param {object} siteEnvelope A JSON representation of the app properties. + * See example. + * + * @param {boolean} [siteEnvelope.enabled] true if the app is + * enabled; otherwise, false. Setting this value to false disables + * the app (takes the app offline). + * + * @param {array} [siteEnvelope.hostNameSslStates] Hostname SSL states are used + * to manage the SSL bindings for app's hostnames. + * + * @param {string} [siteEnvelope.serverFarmId] Resource ID of the associated + * App Service plan, formatted as: + * "/subscriptions/{subscriptionID}/resourceGroups/{groupName}/providers/Microsoft.Web/serverfarms/{appServicePlanName}". + * + * @param {boolean} [siteEnvelope.reserved] true if reserved; + * otherwise, false. + * + * @param {boolean} [siteEnvelope.isXenon] Obsolete: Hyper-V sandbox. + * + * @param {boolean} [siteEnvelope.hyperV] Hyper-V sandbox. + * + * @param {object} [siteEnvelope.siteConfig] Configuration of the app. + * + * @param {number} [siteEnvelope.siteConfig.numberOfWorkers] Number of workers. + * + * @param {array} [siteEnvelope.siteConfig.defaultDocuments] Default documents. + * + * @param {string} [siteEnvelope.siteConfig.netFrameworkVersion] .NET Framework + * version. + * + * @param {string} [siteEnvelope.siteConfig.phpVersion] Version of PHP. + * + * @param {string} [siteEnvelope.siteConfig.pythonVersion] Version of Python. + * + * @param {string} [siteEnvelope.siteConfig.nodeVersion] Version of Node.js. + * + * @param {string} [siteEnvelope.siteConfig.linuxFxVersion] Linux App Framework + * and version + * + * @param {string} [siteEnvelope.siteConfig.windowsFxVersion] Xenon App + * Framework and version + * + * @param {boolean} [siteEnvelope.siteConfig.requestTracingEnabled] + * true if request tracing is enabled; otherwise, + * false. + * + * @param {date} [siteEnvelope.siteConfig.requestTracingExpirationTime] Request + * tracing expiration time. + * + * @param {boolean} [siteEnvelope.siteConfig.remoteDebuggingEnabled] + * true if remote debugging is enabled; otherwise, + * false. + * + * @param {string} [siteEnvelope.siteConfig.remoteDebuggingVersion] Remote + * debugging version. + * + * @param {boolean} [siteEnvelope.siteConfig.httpLoggingEnabled] + * true if HTTP logging is enabled; otherwise, false. + * + * @param {number} [siteEnvelope.siteConfig.logsDirectorySizeLimit] HTTP logs + * directory size limit. + * + * @param {boolean} [siteEnvelope.siteConfig.detailedErrorLoggingEnabled] + * true if detailed error logging is enabled; otherwise, + * false. + * + * @param {string} [siteEnvelope.siteConfig.publishingUsername] Publishing user + * name. + * + * @param {array} [siteEnvelope.siteConfig.appSettings] Application settings. + * + * @param {object} [siteEnvelope.siteConfig.azureStorageAccounts] User-provided + * Azure storage accounts. + * + * @param {array} [siteEnvelope.siteConfig.connectionStrings] Connection + * strings. + * + * @param {array} [siteEnvelope.siteConfig.handlerMappings] Handler mappings. + * + * @param {string} [siteEnvelope.siteConfig.documentRoot] Document root. + * + * @param {string} [siteEnvelope.siteConfig.scmType] SCM type. Possible values + * include: 'None', 'Dropbox', 'Tfs', 'LocalGit', 'GitHub', 'CodePlexGit', + * 'CodePlexHg', 'BitbucketGit', 'BitbucketHg', 'ExternalGit', 'ExternalHg', + * 'OneDrive', 'VSO' + * + * @param {boolean} [siteEnvelope.siteConfig.use32BitWorkerProcess] + * true to use 32-bit worker process; otherwise, + * false. + * + * @param {boolean} [siteEnvelope.siteConfig.webSocketsEnabled] + * true if WebSocket is enabled; otherwise, false. + * + * @param {boolean} [siteEnvelope.siteConfig.alwaysOn] true if + * Always On is enabled; otherwise, false. + * + * @param {string} [siteEnvelope.siteConfig.javaVersion] Java version. + * + * @param {string} [siteEnvelope.siteConfig.javaContainer] Java container. + * + * @param {string} [siteEnvelope.siteConfig.javaContainerVersion] Java + * container version. + * + * @param {string} [siteEnvelope.siteConfig.appCommandLine] App command line to + * launch. + * + * @param {string} [siteEnvelope.siteConfig.managedPipelineMode] Managed + * pipeline mode. Possible values include: 'Integrated', 'Classic' + * + * @param {array} [siteEnvelope.siteConfig.virtualApplications] Virtual + * applications. + * + * @param {string} [siteEnvelope.siteConfig.loadBalancing] Site load balancing. + * Possible values include: 'WeightedRoundRobin', 'LeastRequests', + * 'LeastResponseTime', 'WeightedTotalTraffic', 'RequestHash' + * + * @param {object} [siteEnvelope.siteConfig.experiments] This is work around + * for polymophic types. + * + * @param {array} [siteEnvelope.siteConfig.experiments.rampUpRules] List of + * ramp-up rules. + * + * @param {object} [siteEnvelope.siteConfig.limits] Site limits. + * + * @param {number} [siteEnvelope.siteConfig.limits.maxPercentageCpu] Maximum + * allowed CPU usage percentage. + * + * @param {number} [siteEnvelope.siteConfig.limits.maxMemoryInMb] Maximum + * allowed memory usage in MB. + * + * @param {number} [siteEnvelope.siteConfig.limits.maxDiskSizeInMb] Maximum + * allowed disk size usage in MB. + * + * @param {boolean} [siteEnvelope.siteConfig.autoHealEnabled] true + * if Auto Heal is enabled; otherwise, false. + * + * @param {object} [siteEnvelope.siteConfig.autoHealRules] Auto Heal rules. + * + * @param {object} [siteEnvelope.siteConfig.autoHealRules.triggers] Conditions + * that describe when to execute the auto-heal actions. + * + * @param {object} [siteEnvelope.siteConfig.autoHealRules.triggers.requests] A + * rule based on total requests. + * + * @param {number} + * [siteEnvelope.siteConfig.autoHealRules.triggers.requests.count] Request + * Count. + * + * @param {string} + * [siteEnvelope.siteConfig.autoHealRules.triggers.requests.timeInterval] Time + * interval. + * + * @param {number} + * [siteEnvelope.siteConfig.autoHealRules.triggers.privateBytesInKB] A rule + * based on private bytes. + * + * @param {array} [siteEnvelope.siteConfig.autoHealRules.triggers.statusCodes] + * A rule based on status codes. + * + * @param {object} + * [siteEnvelope.siteConfig.autoHealRules.triggers.slowRequests] A rule based + * on request execution time. + * + * @param {string} + * [siteEnvelope.siteConfig.autoHealRules.triggers.slowRequests.timeTaken] Time + * taken. + * + * @param {number} + * [siteEnvelope.siteConfig.autoHealRules.triggers.slowRequests.count] Request + * Count. + * + * @param {string} + * [siteEnvelope.siteConfig.autoHealRules.triggers.slowRequests.timeInterval] + * Time interval. + * + * @param {object} [siteEnvelope.siteConfig.autoHealRules.actions] Actions to + * be executed when a rule is triggered. + * + * @param {string} [siteEnvelope.siteConfig.autoHealRules.actions.actionType] + * Predefined action to be taken. Possible values include: 'Recycle', + * 'LogEvent', 'CustomAction' + * + * @param {object} [siteEnvelope.siteConfig.autoHealRules.actions.customAction] + * Custom action to be taken. + * + * @param {string} + * [siteEnvelope.siteConfig.autoHealRules.actions.customAction.exe] Executable + * to be run. + * + * @param {string} + * [siteEnvelope.siteConfig.autoHealRules.actions.customAction.parameters] + * Parameters for the executable. + * + * @param {string} + * [siteEnvelope.siteConfig.autoHealRules.actions.minProcessExecutionTime] + * Minimum time the process must execute + * before taking the action + * + * @param {string} [siteEnvelope.siteConfig.tracingOptions] Tracing options. + * + * @param {string} [siteEnvelope.siteConfig.vnetName] Virtual Network name. + * + * @param {object} [siteEnvelope.siteConfig.cors] Cross-Origin Resource Sharing + * (CORS) settings. + * + * @param {array} [siteEnvelope.siteConfig.cors.allowedOrigins] Gets or sets + * the list of origins that should be allowed to make cross-origin + * calls (for example: http://example.com:12345). Use "*" to allow all. + * + * @param {object} [siteEnvelope.siteConfig.push] Push endpoint settings. + * + * @param {boolean} siteEnvelope.siteConfig.push.isPushEnabled Gets or sets a + * flag indicating whether the Push endpoint is enabled. + * + * @param {string} [siteEnvelope.siteConfig.push.tagWhitelistJson] Gets or sets + * a JSON string containing a list of tags that are whitelisted for use by the + * push registration endpoint. + * + * @param {string} [siteEnvelope.siteConfig.push.tagsRequiringAuth] Gets or + * sets a JSON string containing a list of tags that require user + * authentication to be used in the push registration endpoint. + * Tags can consist of alphanumeric characters and the following: + * '_', '@', '#', '.', ':', '-'. + * Validation should be performed at the PushRequestHandler. + * + * @param {string} [siteEnvelope.siteConfig.push.dynamicTagsJson] Gets or sets + * a JSON string containing a list of dynamic tags that will be evaluated from + * user claims in the push registration endpoint. + * + * @param {string} [siteEnvelope.siteConfig.push.kind] Kind of resource. + * + * @param {object} [siteEnvelope.siteConfig.apiDefinition] Information about + * the formal API definition for the app. + * + * @param {string} [siteEnvelope.siteConfig.apiDefinition.url] The URL of the + * API definition. + * + * @param {string} [siteEnvelope.siteConfig.autoSwapSlotName] Auto-swap slot + * name. + * + * @param {boolean} [siteEnvelope.siteConfig.localMySqlEnabled] + * true to enable local MySQL; otherwise, false. + * + * @param {number} [siteEnvelope.siteConfig.managedServiceIdentityId] Managed + * Service Identity Id + * + * @param {number} [siteEnvelope.siteConfig.xManagedServiceIdentityId] Explicit + * Managed Service Identity Id + * + * @param {array} [siteEnvelope.siteConfig.ipSecurityRestrictions] IP security + * restrictions. + * + * @param {boolean} [siteEnvelope.siteConfig.http20Enabled] Http20Enabled: + * configures a web site to allow clients to connect over http2.0 + * + * @param {string} [siteEnvelope.siteConfig.minTlsVersion] MinTlsVersion: + * configures the minimum version of TLS required for SSL requests. Possible + * values include: '1.0', '1.1', '1.2' + * + * @param {string} [siteEnvelope.siteConfig.ftpsState] State of FTP / FTPS + * service. Possible values include: 'AllAllowed', 'FtpsOnly', 'Disabled' + * + * @param {number} [siteEnvelope.siteConfig.reservedInstanceCount] Number of + * reserved instances. + * This setting only applies to the Consumption Plan + * + * @param {boolean} [siteEnvelope.scmSiteAlsoStopped] true to stop + * SCM (KUDU) site when the app is stopped; otherwise, false. The + * default is false. + * + * @param {object} [siteEnvelope.hostingEnvironmentProfile] App Service + * Environment to use for the app. + * + * @param {string} [siteEnvelope.hostingEnvironmentProfile.id] Resource ID of + * the App Service Environment. + * + * @param {boolean} [siteEnvelope.clientAffinityEnabled] true to + * enable client affinity; false to stop sending session affinity + * cookies, which route client requests in the same session to the same + * instance. Default is true. + * + * @param {boolean} [siteEnvelope.clientCertEnabled] true to + * enable client certificate authentication (TLS mutual authentication); + * otherwise, false. Default is false. + * + * @param {boolean} [siteEnvelope.hostNamesDisabled] true to + * disable the public hostnames of the app; otherwise, false. + * If true, the app is only accessible via API management process. + * + * @param {number} [siteEnvelope.containerSize] Size of the function container. + * + * @param {number} [siteEnvelope.dailyMemoryTimeQuota] Maximum allowed daily + * memory-time quota (applicable on dynamic apps only). + * + * @param {object} [siteEnvelope.cloningInfo] If specified during app creation, + * the app is cloned from a source app. + * + * @param {uuid} [siteEnvelope.cloningInfo.correlationId] Correlation ID of + * cloning operation. This ID ties multiple cloning operations + * together to use the same snapshot. + * + * @param {boolean} [siteEnvelope.cloningInfo.overwrite] true to + * overwrite destination app; otherwise, false. + * + * @param {boolean} [siteEnvelope.cloningInfo.cloneCustomHostNames] + * true to clone custom hostnames from source app; otherwise, + * false. + * + * @param {boolean} [siteEnvelope.cloningInfo.cloneSourceControl] + * true to clone source control from source app; otherwise, + * false. + * + * @param {string} siteEnvelope.cloningInfo.sourceWebAppId ARM resource ID of + * the source app. App resource ID is of the form + * /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName} + * for production slots and + * /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/slots/{slotName} + * for other slots. + * + * @param {string} [siteEnvelope.cloningInfo.hostingEnvironment] App Service + * Environment. + * + * @param {object} [siteEnvelope.cloningInfo.appSettingsOverrides] Application + * setting overrides for cloned app. If specified, these settings override the + * settings cloned + * from source app. Otherwise, application settings from source app are + * retained. + * + * @param {boolean} [siteEnvelope.cloningInfo.configureLoadBalancing] + * true to configure load balancing for source and destination + * app. + * + * @param {string} [siteEnvelope.cloningInfo.trafficManagerProfileId] ARM + * resource ID of the Traffic Manager profile to use, if it exists. Traffic + * Manager resource ID is of the form + * /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/trafficManagerProfiles/{profileName}. + * + * @param {string} [siteEnvelope.cloningInfo.trafficManagerProfileName] Name of + * Traffic Manager profile to create. This is only needed if Traffic Manager + * profile does not already exist. + * + * @param {boolean} [siteEnvelope.httpsOnly] HttpsOnly: configures a web site + * to accept only https requests. Issues redirect for + * http requests + * + * @param {object} [siteEnvelope.identity] + * + * @param {string} [siteEnvelope.identity.type] Type of managed service + * identity. Possible values include: 'SystemAssigned', 'UserAssigned' + * + * @param {array} [siteEnvelope.identity.identityIds] Array of UserAssigned + * managed service identities. + * + * @param {string} [siteEnvelope.kind] Kind of resource. + * + * @param {string} siteEnvelope.location Resource Location. + * + * @param {object} [siteEnvelope.tags] Resource tags. + * + * @param {string} slot Name of the deployment slot to create or update. By + * default, this API attempts to create or modify the production slot. + * + * @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 Site} 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 _createOrUpdateSlot(resourceGroupName, name, siteEnvelope, slot, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + + if (!callback) { + throw new Error('callback cannot be null.'); + } + + // Send request + this.beginCreateOrUpdateSlot(resourceGroupName, name, siteEnvelope, slot, options, (err, parsedResult, httpRequest, response) => { + if (err) return callback(err); + + let initialResult = new msRest.HttpOperationResponse(); + initialResult.request = httpRequest; + initialResult.response = response; + initialResult.body = response.body; + client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { + if (err) return callback(err); + + // Create Result + let result = null; + + httpRequest = pollingResult.request; + response = pollingResult.response; + let responseBody = pollingResult.body; + if (responseBody === '') responseBody = null; + + // Deserialize Response + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['Site']().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 Deletes a web, mobile, or API app, or one of the deployment slots. + * + * Deletes a web, mobile, or API app, or one of the deployment slots. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app to delete. + * + * @param {string} slot Name of the deployment slot to delete. By default, the + * API deletes the production slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {boolean} [options.deleteMetrics] If true, web app metrics are also + * deleted. + * + * @param {boolean} [options.deleteEmptyServerFarm] Specify true if the App + * Service plan will be empty after app deletion and you want to delete the + * empty App Service plan. By default, the empty App Service plan is not + * deleted. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _deleteSlot(resourceGroupName, name, slot, 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 deleteMetrics = (options && options.deleteMetrics !== undefined) ? options.deleteMetrics : undefined; + let deleteEmptyServerFarm = (options && options.deleteEmptyServerFarm !== undefined) ? options.deleteEmptyServerFarm : undefined; + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (slot === null || slot === undefined || typeof slot.valueOf() !== 'string') { + throw new Error('slot cannot be null or undefined and it must be of type string.'); + } + if (deleteMetrics !== null && deleteMetrics !== undefined && typeof deleteMetrics !== 'boolean') { + throw new Error('deleteMetrics must be of type boolean.'); + } + if (deleteEmptyServerFarm !== null && deleteEmptyServerFarm !== undefined && typeof deleteEmptyServerFarm !== 'boolean') { + throw new Error('deleteEmptyServerFarm 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.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + if (deleteMetrics !== null && deleteMetrics !== undefined) { + queryParameters.push('deleteMetrics=' + encodeURIComponent(deleteMetrics.toString())); + } + if (deleteEmptyServerFarm !== null && deleteEmptyServerFarm !== undefined) { + queryParameters.push('deleteEmptyServerFarm=' + encodeURIComponent(deleteEmptyServerFarm.toString())); + } + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'DELETE'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 204 && statusCode !== 404) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + + return callback(null, result, httpRequest, response); + }); +} + +/** + * @summary Creates a new web, mobile, or API app in an existing resource + * group, or updates an existing app. + * + * Creates a new web, mobile, or API app in an existing resource group, or + * updates an existing app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Unique name of the app to create or update. To create + * or update a deployment slot, use the {slot} parameter. + * + * @param {object} siteEnvelope A JSON representation of the app properties. + * See example. + * + * @param {boolean} [siteEnvelope.enabled] true if the app is + * enabled; otherwise, false. Setting this value to false disables + * the app (takes the app offline). + * + * @param {array} [siteEnvelope.hostNameSslStates] Hostname SSL states are used + * to manage the SSL bindings for app's hostnames. + * + * @param {string} [siteEnvelope.serverFarmId] Resource ID of the associated + * App Service plan, formatted as: + * "/subscriptions/{subscriptionID}/resourceGroups/{groupName}/providers/Microsoft.Web/serverfarms/{appServicePlanName}". + * + * @param {boolean} [siteEnvelope.reserved] true if reserved; + * otherwise, false. + * + * @param {boolean} [siteEnvelope.isXenon] Obsolete: Hyper-V sandbox. + * + * @param {boolean} [siteEnvelope.hyperV] Hyper-V sandbox. + * + * @param {object} [siteEnvelope.siteConfig] Configuration of the app. + * + * @param {number} [siteEnvelope.siteConfig.numberOfWorkers] Number of workers. + * + * @param {array} [siteEnvelope.siteConfig.defaultDocuments] Default documents. + * + * @param {string} [siteEnvelope.siteConfig.netFrameworkVersion] .NET Framework + * version. + * + * @param {string} [siteEnvelope.siteConfig.phpVersion] Version of PHP. + * + * @param {string} [siteEnvelope.siteConfig.pythonVersion] Version of Python. + * + * @param {string} [siteEnvelope.siteConfig.nodeVersion] Version of Node.js. + * + * @param {string} [siteEnvelope.siteConfig.linuxFxVersion] Linux App Framework + * and version + * + * @param {string} [siteEnvelope.siteConfig.windowsFxVersion] Xenon App + * Framework and version + * + * @param {boolean} [siteEnvelope.siteConfig.requestTracingEnabled] + * true if request tracing is enabled; otherwise, + * false. + * + * @param {date} [siteEnvelope.siteConfig.requestTracingExpirationTime] Request + * tracing expiration time. + * + * @param {boolean} [siteEnvelope.siteConfig.remoteDebuggingEnabled] + * true if remote debugging is enabled; otherwise, + * false. + * + * @param {string} [siteEnvelope.siteConfig.remoteDebuggingVersion] Remote + * debugging version. + * + * @param {boolean} [siteEnvelope.siteConfig.httpLoggingEnabled] + * true if HTTP logging is enabled; otherwise, false. + * + * @param {number} [siteEnvelope.siteConfig.logsDirectorySizeLimit] HTTP logs + * directory size limit. + * + * @param {boolean} [siteEnvelope.siteConfig.detailedErrorLoggingEnabled] + * true if detailed error logging is enabled; otherwise, + * false. + * + * @param {string} [siteEnvelope.siteConfig.publishingUsername] Publishing user + * name. + * + * @param {array} [siteEnvelope.siteConfig.appSettings] Application settings. + * + * @param {object} [siteEnvelope.siteConfig.azureStorageAccounts] User-provided + * Azure storage accounts. + * + * @param {array} [siteEnvelope.siteConfig.connectionStrings] Connection + * strings. + * + * @param {array} [siteEnvelope.siteConfig.handlerMappings] Handler mappings. + * + * @param {string} [siteEnvelope.siteConfig.documentRoot] Document root. + * + * @param {string} [siteEnvelope.siteConfig.scmType] SCM type. Possible values + * include: 'None', 'Dropbox', 'Tfs', 'LocalGit', 'GitHub', 'CodePlexGit', + * 'CodePlexHg', 'BitbucketGit', 'BitbucketHg', 'ExternalGit', 'ExternalHg', + * 'OneDrive', 'VSO' + * + * @param {boolean} [siteEnvelope.siteConfig.use32BitWorkerProcess] + * true to use 32-bit worker process; otherwise, + * false. + * + * @param {boolean} [siteEnvelope.siteConfig.webSocketsEnabled] + * true if WebSocket is enabled; otherwise, false. + * + * @param {boolean} [siteEnvelope.siteConfig.alwaysOn] true if + * Always On is enabled; otherwise, false. + * + * @param {string} [siteEnvelope.siteConfig.javaVersion] Java version. + * + * @param {string} [siteEnvelope.siteConfig.javaContainer] Java container. + * + * @param {string} [siteEnvelope.siteConfig.javaContainerVersion] Java + * container version. + * + * @param {string} [siteEnvelope.siteConfig.appCommandLine] App command line to + * launch. + * + * @param {string} [siteEnvelope.siteConfig.managedPipelineMode] Managed + * pipeline mode. Possible values include: 'Integrated', 'Classic' + * + * @param {array} [siteEnvelope.siteConfig.virtualApplications] Virtual + * applications. + * + * @param {string} [siteEnvelope.siteConfig.loadBalancing] Site load balancing. + * Possible values include: 'WeightedRoundRobin', 'LeastRequests', + * 'LeastResponseTime', 'WeightedTotalTraffic', 'RequestHash' + * + * @param {object} [siteEnvelope.siteConfig.experiments] This is work around + * for polymophic types. + * + * @param {array} [siteEnvelope.siteConfig.experiments.rampUpRules] List of + * ramp-up rules. + * + * @param {object} [siteEnvelope.siteConfig.limits] Site limits. + * + * @param {number} [siteEnvelope.siteConfig.limits.maxPercentageCpu] Maximum + * allowed CPU usage percentage. + * + * @param {number} [siteEnvelope.siteConfig.limits.maxMemoryInMb] Maximum + * allowed memory usage in MB. + * + * @param {number} [siteEnvelope.siteConfig.limits.maxDiskSizeInMb] Maximum + * allowed disk size usage in MB. + * + * @param {boolean} [siteEnvelope.siteConfig.autoHealEnabled] true + * if Auto Heal is enabled; otherwise, false. + * + * @param {object} [siteEnvelope.siteConfig.autoHealRules] Auto Heal rules. + * + * @param {object} [siteEnvelope.siteConfig.autoHealRules.triggers] Conditions + * that describe when to execute the auto-heal actions. + * + * @param {object} [siteEnvelope.siteConfig.autoHealRules.triggers.requests] A + * rule based on total requests. + * + * @param {number} + * [siteEnvelope.siteConfig.autoHealRules.triggers.requests.count] Request + * Count. + * + * @param {string} + * [siteEnvelope.siteConfig.autoHealRules.triggers.requests.timeInterval] Time + * interval. + * + * @param {number} + * [siteEnvelope.siteConfig.autoHealRules.triggers.privateBytesInKB] A rule + * based on private bytes. + * + * @param {array} [siteEnvelope.siteConfig.autoHealRules.triggers.statusCodes] + * A rule based on status codes. + * + * @param {object} + * [siteEnvelope.siteConfig.autoHealRules.triggers.slowRequests] A rule based + * on request execution time. + * + * @param {string} + * [siteEnvelope.siteConfig.autoHealRules.triggers.slowRequests.timeTaken] Time + * taken. + * + * @param {number} + * [siteEnvelope.siteConfig.autoHealRules.triggers.slowRequests.count] Request + * Count. + * + * @param {string} + * [siteEnvelope.siteConfig.autoHealRules.triggers.slowRequests.timeInterval] + * Time interval. + * + * @param {object} [siteEnvelope.siteConfig.autoHealRules.actions] Actions to + * be executed when a rule is triggered. + * + * @param {string} [siteEnvelope.siteConfig.autoHealRules.actions.actionType] + * Predefined action to be taken. Possible values include: 'Recycle', + * 'LogEvent', 'CustomAction' + * + * @param {object} [siteEnvelope.siteConfig.autoHealRules.actions.customAction] + * Custom action to be taken. + * + * @param {string} + * [siteEnvelope.siteConfig.autoHealRules.actions.customAction.exe] Executable + * to be run. + * + * @param {string} + * [siteEnvelope.siteConfig.autoHealRules.actions.customAction.parameters] + * Parameters for the executable. + * + * @param {string} + * [siteEnvelope.siteConfig.autoHealRules.actions.minProcessExecutionTime] + * Minimum time the process must execute + * before taking the action + * + * @param {string} [siteEnvelope.siteConfig.tracingOptions] Tracing options. + * + * @param {string} [siteEnvelope.siteConfig.vnetName] Virtual Network name. + * + * @param {object} [siteEnvelope.siteConfig.cors] Cross-Origin Resource Sharing + * (CORS) settings. + * + * @param {array} [siteEnvelope.siteConfig.cors.allowedOrigins] Gets or sets + * the list of origins that should be allowed to make cross-origin + * calls (for example: http://example.com:12345). Use "*" to allow all. + * + * @param {object} [siteEnvelope.siteConfig.push] Push endpoint settings. + * + * @param {boolean} siteEnvelope.siteConfig.push.isPushEnabled Gets or sets a + * flag indicating whether the Push endpoint is enabled. + * + * @param {string} [siteEnvelope.siteConfig.push.tagWhitelistJson] Gets or sets + * a JSON string containing a list of tags that are whitelisted for use by the + * push registration endpoint. + * + * @param {string} [siteEnvelope.siteConfig.push.tagsRequiringAuth] Gets or + * sets a JSON string containing a list of tags that require user + * authentication to be used in the push registration endpoint. + * Tags can consist of alphanumeric characters and the following: + * '_', '@', '#', '.', ':', '-'. + * Validation should be performed at the PushRequestHandler. + * + * @param {string} [siteEnvelope.siteConfig.push.dynamicTagsJson] Gets or sets + * a JSON string containing a list of dynamic tags that will be evaluated from + * user claims in the push registration endpoint. + * + * @param {string} [siteEnvelope.siteConfig.push.kind] Kind of resource. + * + * @param {object} [siteEnvelope.siteConfig.apiDefinition] Information about + * the formal API definition for the app. + * + * @param {string} [siteEnvelope.siteConfig.apiDefinition.url] The URL of the + * API definition. + * + * @param {string} [siteEnvelope.siteConfig.autoSwapSlotName] Auto-swap slot + * name. + * + * @param {boolean} [siteEnvelope.siteConfig.localMySqlEnabled] + * true to enable local MySQL; otherwise, false. + * + * @param {number} [siteEnvelope.siteConfig.managedServiceIdentityId] Managed + * Service Identity Id + * + * @param {number} [siteEnvelope.siteConfig.xManagedServiceIdentityId] Explicit + * Managed Service Identity Id + * + * @param {array} [siteEnvelope.siteConfig.ipSecurityRestrictions] IP security + * restrictions. + * + * @param {boolean} [siteEnvelope.siteConfig.http20Enabled] Http20Enabled: + * configures a web site to allow clients to connect over http2.0 + * + * @param {string} [siteEnvelope.siteConfig.minTlsVersion] MinTlsVersion: + * configures the minimum version of TLS required for SSL requests. Possible + * values include: '1.0', '1.1', '1.2' + * + * @param {string} [siteEnvelope.siteConfig.ftpsState] State of FTP / FTPS + * service. Possible values include: 'AllAllowed', 'FtpsOnly', 'Disabled' + * + * @param {number} [siteEnvelope.siteConfig.reservedInstanceCount] Number of + * reserved instances. + * This setting only applies to the Consumption Plan + * + * @param {boolean} [siteEnvelope.scmSiteAlsoStopped] true to stop + * SCM (KUDU) site when the app is stopped; otherwise, false. The + * default is false. + * + * @param {object} [siteEnvelope.hostingEnvironmentProfile] App Service + * Environment to use for the app. + * + * @param {string} [siteEnvelope.hostingEnvironmentProfile.id] Resource ID of + * the App Service Environment. + * + * @param {boolean} [siteEnvelope.clientAffinityEnabled] true to + * enable client affinity; false to stop sending session affinity + * cookies, which route client requests in the same session to the same + * instance. Default is true. + * + * @param {boolean} [siteEnvelope.clientCertEnabled] true to + * enable client certificate authentication (TLS mutual authentication); + * otherwise, false. Default is false. + * + * @param {boolean} [siteEnvelope.hostNamesDisabled] true to + * disable the public hostnames of the app; otherwise, false. + * If true, the app is only accessible via API management process. + * + * @param {number} [siteEnvelope.containerSize] Size of the function container. + * + * @param {number} [siteEnvelope.dailyMemoryTimeQuota] Maximum allowed daily + * memory-time quota (applicable on dynamic apps only). + * + * @param {object} [siteEnvelope.cloningInfo] If specified during app creation, + * the app is cloned from a source app. + * + * @param {uuid} [siteEnvelope.cloningInfo.correlationId] Correlation ID of + * cloning operation. This ID ties multiple cloning operations + * together to use the same snapshot. + * + * @param {boolean} [siteEnvelope.cloningInfo.overwrite] true to + * overwrite destination app; otherwise, false. + * + * @param {boolean} [siteEnvelope.cloningInfo.cloneCustomHostNames] + * true to clone custom hostnames from source app; otherwise, + * false. + * + * @param {boolean} [siteEnvelope.cloningInfo.cloneSourceControl] + * true to clone source control from source app; otherwise, + * false. + * + * @param {string} siteEnvelope.cloningInfo.sourceWebAppId ARM resource ID of + * the source app. App resource ID is of the form + * /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName} + * for production slots and + * /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/slots/{slotName} + * for other slots. + * + * @param {string} [siteEnvelope.cloningInfo.hostingEnvironment] App Service + * Environment. + * + * @param {object} [siteEnvelope.cloningInfo.appSettingsOverrides] Application + * setting overrides for cloned app. If specified, these settings override the + * settings cloned + * from source app. Otherwise, application settings from source app are + * retained. + * + * @param {boolean} [siteEnvelope.cloningInfo.configureLoadBalancing] + * true to configure load balancing for source and destination + * app. + * + * @param {string} [siteEnvelope.cloningInfo.trafficManagerProfileId] ARM + * resource ID of the Traffic Manager profile to use, if it exists. Traffic + * Manager resource ID is of the form + * /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/trafficManagerProfiles/{profileName}. + * + * @param {string} [siteEnvelope.cloningInfo.trafficManagerProfileName] Name of + * Traffic Manager profile to create. This is only needed if Traffic Manager + * profile does not already exist. + * + * @param {boolean} [siteEnvelope.httpsOnly] HttpsOnly: configures a web site + * to accept only https requests. Issues redirect for + * http requests + * + * @param {string} [siteEnvelope.kind] Kind of resource. + * + * @param {string} slot Name of the deployment slot to create or update. By + * default, this API attempts to create or modify the production slot. + * + * @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 Site} 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 _updateSlot(resourceGroupName, name, siteEnvelope, slot, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (siteEnvelope === null || siteEnvelope === undefined) { + throw new Error('siteEnvelope cannot be null or undefined.'); + } + if (slot === null || slot === undefined || typeof slot.valueOf() !== 'string') { + throw new Error('slot cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'PATCH'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (siteEnvelope !== null && siteEnvelope !== undefined) { + let requestModelMapper = new client.models['SitePatchResource']().mapper(); + requestModel = client.serialize(requestModelMapper, siteEnvelope, 'siteEnvelope'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(siteEnvelope, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 202) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['Site']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + // Deserialize Response + if (statusCode === 202) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['Site']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError1 = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError1.request = msRest.stripRequest(httpRequest); + deserializationError1.response = msRest.stripResponse(response); + return callback(deserializationError1); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * @summary Analyze a custom hostname. + * + * Analyze a custom hostname. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {string} slot Name of web app slot. If not specified then will + * default to production slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.hostName] Custom hostname. + * + * @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 CustomHostnameAnalysisResult} 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 _analyzeCustomHostnameSlot(resourceGroupName, name, slot, 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 hostName = (options && options.hostName !== undefined) ? options.hostName : undefined; + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (slot === null || slot === undefined || typeof slot.valueOf() !== 'string') { + throw new Error('slot cannot be null or undefined and it must be of type string.'); + } + if (hostName !== null && hostName !== undefined && typeof hostName.valueOf() !== 'string') { + throw new Error('hostName must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/analyzeCustomHostname'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + if (hostName !== null && hostName !== undefined) { + queryParameters.push('hostName=' + encodeURIComponent(hostName)); + } + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['CustomHostnameAnalysisResult']().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 Applies the configuration settings from the target slot onto the + * current slot. + * + * Applies the configuration settings from the target slot onto the current + * slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} slotSwapEntity JSON object that contains the target slot + * name. See example. + * + * @param {string} slotSwapEntity.targetSlot Destination deployment slot during + * swap operation. + * + * @param {boolean} slotSwapEntity.preserveVnet true to preserve + * Virtual Network to the slot during swap; otherwise, false. + * + * @param {string} slot Name of the source slot. If a slot is not specified, + * the production slot is used as the source slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _applySlotConfigurationSlot(resourceGroupName, name, slotSwapEntity, slot, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (slotSwapEntity === null || slotSwapEntity === undefined) { + throw new Error('slotSwapEntity cannot be null or undefined.'); + } + if (slot === null || slot === undefined || typeof slot.valueOf() !== 'string') { + throw new Error('slot cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/applySlotConfig'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); + 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 (slotSwapEntity !== null && slotSwapEntity !== undefined) { + let requestModelMapper = new client.models['CsmSlotEntity']().mapper(); + requestModel = client.serialize(requestModelMapper, slotSwapEntity, 'slotSwapEntity'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(slotSwapEntity, 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; + + return callback(null, result, httpRequest, response); + }); +} + +/** + * @summary Creates a backup of an app. + * + * Creates a backup of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} request Backup configuration. You can use the JSON response + * from the POST action as input here. + * + * @param {string} [request.backupName] Name of the backup. + * + * @param {boolean} [request.enabled] True if the backup schedule is enabled + * (must be included in that case), false if the backup schedule should be + * disabled. + * + * @param {string} request.storageAccountUrl SAS URL to the container. + * + * @param {object} [request.backupSchedule] Schedule for the backup if it is + * executed periodically. + * + * @param {number} request.backupSchedule.frequencyInterval How often the + * backup should be executed (e.g. for weekly backup, this should be set to 7 + * and FrequencyUnit should be set to Day) + * + * @param {string} request.backupSchedule.frequencyUnit The unit of time for + * how often the backup should be executed (e.g. for weekly backup, this should + * be set to Day and FrequencyInterval should be set to 7). Possible values + * include: 'Day', 'Hour' + * + * @param {boolean} request.backupSchedule.keepAtLeastOneBackup True if the + * retention policy should always keep at least one backup in the storage + * account, regardless how old it is; false otherwise. + * + * @param {number} request.backupSchedule.retentionPeriodInDays After how many + * days backups should be deleted. + * + * @param {date} [request.backupSchedule.startTime] When the schedule should + * start working. + * + * @param {array} [request.databases] Databases included in the backup. + * + * @param {string} [request.kind] Kind of resource. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will create a backup for the production slot. + * + * @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 BackupItem} 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 _backupSlot(resourceGroupName, name, request, slot, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (request === null || request === undefined) { + throw new Error('request cannot be null or undefined.'); + } + if (slot === null || slot === undefined || typeof slot.valueOf() !== 'string') { + throw new Error('slot cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/backup'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); + 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 (request !== null && request !== undefined) { + let requestModelMapper = new client.models['BackupRequest']().mapper(); + requestModel = client.serialize(requestModelMapper, request, 'request'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(request, 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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['BackupItem']().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 existing backups of an app. + * + * Gets existing backups of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will get backups of the production slot. + * + * @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 BackupItemCollection} 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 _listBackupsSlot(resourceGroupName, name, slot, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (slot === null || slot === undefined || typeof slot.valueOf() !== 'string') { + throw new Error('slot cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/backups'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['BackupItemCollection']().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 backup of an app by its ID. + * + * Gets a backup of an app by its ID. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} backupId ID of the backup. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will get a backup of the production slot. + * + * @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 BackupItem} 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 _getBackupStatusSlot(resourceGroupName, name, backupId, slot, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (backupId === null || backupId === undefined || typeof backupId.valueOf() !== 'string') { + throw new Error('backupId cannot be null or undefined and it must be of type string.'); + } + if (slot === null || slot === undefined || typeof slot.valueOf() !== 'string') { + throw new Error('slot cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/backups/{backupId}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{backupId}', encodeURIComponent(backupId)); + requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['BackupItem']().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 Deletes a backup of an app by its ID. + * + * Deletes a backup of an app by its ID. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} backupId ID of the backup. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will delete a backup of the production slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _deleteBackupSlot(resourceGroupName, name, backupId, slot, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (backupId === null || backupId === undefined || typeof backupId.valueOf() !== 'string') { + throw new Error('backupId cannot be null or undefined and it must be of type string.'); + } + if (slot === null || slot === undefined || typeof slot.valueOf() !== 'string') { + throw new Error('slot cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/backups/{backupId}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{backupId}', encodeURIComponent(backupId)); + requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'DELETE'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 404) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + + return callback(null, result, httpRequest, response); + }); +} + +/** + * @summary Gets status of a web app backup that may be in progress, including + * secrets associated with the backup, such as the Azure Storage SAS URL. Also + * can be used to update the SAS URL for the backup if a new URL is passed in + * the request body. + * + * Gets status of a web app backup that may be in progress, including secrets + * associated with the backup, such as the Azure Storage SAS URL. Also can be + * used to update the SAS URL for the backup if a new URL is passed in the + * request body. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {string} backupId ID of backup. + * + * @param {object} request Information on backup request. + * + * @param {string} [request.backupName] Name of the backup. + * + * @param {boolean} [request.enabled] True if the backup schedule is enabled + * (must be included in that case), false if the backup schedule should be + * disabled. + * + * @param {string} request.storageAccountUrl SAS URL to the container. + * + * @param {object} [request.backupSchedule] Schedule for the backup if it is + * executed periodically. + * + * @param {number} request.backupSchedule.frequencyInterval How often the + * backup should be executed (e.g. for weekly backup, this should be set to 7 + * and FrequencyUnit should be set to Day) + * + * @param {string} request.backupSchedule.frequencyUnit The unit of time for + * how often the backup should be executed (e.g. for weekly backup, this should + * be set to Day and FrequencyInterval should be set to 7). Possible values + * include: 'Day', 'Hour' + * + * @param {boolean} request.backupSchedule.keepAtLeastOneBackup True if the + * retention policy should always keep at least one backup in the storage + * account, regardless how old it is; false otherwise. + * + * @param {number} request.backupSchedule.retentionPeriodInDays After how many + * days backups should be deleted. + * + * @param {date} [request.backupSchedule.startTime] When the schedule should + * start working. + * + * @param {array} [request.databases] Databases included in the backup. + * + * @param {string} [request.kind] Kind of resource. + * + * @param {string} slot Name of web app slot. If not specified then will + * default to production slot. + * + * @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 BackupItem} 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 _listBackupStatusSecretsSlot(resourceGroupName, name, backupId, request, slot, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (backupId === null || backupId === undefined || typeof backupId.valueOf() !== 'string') { + throw new Error('backupId cannot be null or undefined and it must be of type string.'); + } + if (request === null || request === undefined) { + throw new Error('request cannot be null or undefined.'); + } + if (slot === null || slot === undefined || typeof slot.valueOf() !== 'string') { + throw new Error('slot cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/backups/{backupId}/list'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{backupId}', encodeURIComponent(backupId)); + requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); + 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 (request !== null && request !== undefined) { + let requestModelMapper = new client.models['BackupRequest']().mapper(); + requestModel = client.serialize(requestModelMapper, request, 'request'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(request, 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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['BackupItem']().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 Restores a specific backup to another app (or deployment slot, if + * specified). + * + * Restores a specific backup to another app (or deployment slot, if + * specified). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} backupId ID of the backup. + * + * @param {object} request Information on restore request . + * + * @param {string} request.storageAccountUrl SAS URL to the container. + * + * @param {string} [request.blobName] Name of a blob which contains the backup. + * + * @param {boolean} request.overwrite true if the restore + * operation can overwrite target app; otherwise, false. + * true is needed if trying to restore over an existing app. + * + * @param {string} [request.siteName] Name of an app. + * + * @param {array} [request.databases] Collection of databases which should be + * restored. This list has to match the list of databases included in the + * backup. + * + * @param {boolean} [request.ignoreConflictingHostNames] Changes a logic when + * restoring an app with custom domains. true to remove custom + * domains automatically. If false, custom domains are added to + * the app's object when it is being restored, but that might fail due to + * conflicts during the operation. + * + * @param {boolean} [request.ignoreDatabases] Ignore the databases and only + * restore the site content + * + * @param {string} [request.appServicePlan] Specify app service plan that will + * own restored site. + * + * @param {string} [request.operationType] Operation type. Possible values + * include: 'Default', 'Clone', 'Relocation', 'Snapshot', 'CloudFS' + * + * @param {boolean} [request.adjustConnectionStrings] true if + * SiteConfig.ConnectionStrings should be set in new app; otherwise, + * false. + * + * @param {string} [request.hostingEnvironment] App Service Environment name, + * if needed (only when restoring an app to an App Service Environment). + * + * @param {string} [request.kind] Kind of resource. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will restore a backup of the production slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _restoreSlot(resourceGroupName, name, backupId, request, slot, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + + if (!callback) { + throw new Error('callback cannot be null.'); + } + + // Send request + this.beginRestoreSlot(resourceGroupName, name, backupId, request, slot, options, (err, parsedResult, httpRequest, response) => { + if (err) return callback(err); + + let initialResult = new msRest.HttpOperationResponse(); + initialResult.request = httpRequest; + initialResult.response = response; + initialResult.body = response.body; + client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { + if (err) return callback(err); + + // Create Result + let result = null; + + httpRequest = pollingResult.request; + response = pollingResult.response; + let responseBody = pollingResult.body; + if (responseBody === '') responseBody = null; + + // Deserialize Response + + return callback(null, result, httpRequest, response); + }); + }); +} + +/** + * @summary List the configurations of an app + * + * List the configurations of an app + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will return configuration for the production slot. + * + * @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 SiteConfigResourceCollection} 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 _listConfigurationsSlot(resourceGroupName, name, slot, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (slot === null || slot === undefined || typeof slot.valueOf() !== 'string') { + throw new Error('slot cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['SiteConfigResourceCollection']().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 Replaces the application settings of an app. + * + * Replaces the application settings of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} appSettings Application settings of the app. + * + * @param {object} [appSettings.properties] Settings. + * + * @param {string} [appSettings.kind] Kind of resource. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will update the application settings for the production + * slot. + * + * @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 StringDictionary} 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 _updateApplicationSettingsSlot(resourceGroupName, name, appSettings, slot, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (appSettings === null || appSettings === undefined) { + throw new Error('appSettings cannot be null or undefined.'); + } + if (slot === null || slot === undefined || typeof slot.valueOf() !== 'string') { + throw new Error('slot cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/appsettings'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'PUT'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (appSettings !== null && appSettings !== undefined) { + let requestModelMapper = new client.models['StringDictionary']().mapper(); + requestModel = client.serialize(requestModelMapper, appSettings, 'appSettings'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(appSettings, 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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['StringDictionary']().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 the application settings of an app. + * + * Gets the application settings of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will get the application settings for the production + * slot. + * + * @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 StringDictionary} 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 _listApplicationSettingsSlot(resourceGroupName, name, slot, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (slot === null || slot === undefined || typeof slot.valueOf() !== 'string') { + throw new Error('slot cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/appsettings/list'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); + 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]; + } + } + } + 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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['StringDictionary']().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 Updates the Authentication / Authorization settings associated with + * web app. + * + * Updates the Authentication / Authorization settings associated with web app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {object} siteAuthSettings Auth settings associated with web app. + * + * @param {boolean} [siteAuthSettings.enabled] true if the + * Authentication / Authorization feature is enabled for the current app; + * otherwise, false. + * + * @param {string} [siteAuthSettings.runtimeVersion] The RuntimeVersion of the + * Authentication / Authorization feature in use for the current app. + * The setting in this value can control the behavior of certain features in + * the Authentication / Authorization module. + * + * @param {string} [siteAuthSettings.unauthenticatedClientAction] The action to + * take when an unauthenticated client attempts to access the app. Possible + * values include: 'RedirectToLoginPage', 'AllowAnonymous' + * + * @param {boolean} [siteAuthSettings.tokenStoreEnabled] true to + * durably store platform-specific security tokens that are obtained during + * login flows; otherwise, false. + * The default is false. + * + * @param {array} [siteAuthSettings.allowedExternalRedirectUrls] External URLs + * that can be redirected to as part of logging in or logging out of the app. + * Note that the query string part of the URL is ignored. + * This is an advanced setting typically only needed by Windows Store + * application backends. + * Note that URLs within the current domain are always implicitly allowed. + * + * @param {string} [siteAuthSettings.defaultProvider] The default + * authentication provider to use when multiple providers are configured. + * This setting is only needed if multiple providers are configured and the + * unauthenticated client + * action is set to "RedirectToLoginPage". Possible values include: + * 'AzureActiveDirectory', 'Facebook', 'Google', 'MicrosoftAccount', 'Twitter' + * + * @param {number} [siteAuthSettings.tokenRefreshExtensionHours] The number of + * hours after session token expiration that a session token can be used to + * call the token refresh API. The default is 72 hours. + * + * @param {string} [siteAuthSettings.clientId] The Client ID of this relying + * party application, known as the client_id. + * This setting is required for enabling OpenID Connection authentication with + * Azure Active Directory or + * other 3rd party OpenID Connect providers. + * More information on OpenID Connect: + * http://openid.net/specs/openid-connect-core-1_0.html + * + * @param {string} [siteAuthSettings.clientSecret] The Client Secret of this + * relying party application (in Azure Active Directory, this is also referred + * to as the Key). + * This setting is optional. If no client secret is configured, the OpenID + * Connect implicit auth flow is used to authenticate end users. + * Otherwise, the OpenID Connect Authorization Code Flow is used to + * authenticate end users. + * More information on OpenID Connect: + * http://openid.net/specs/openid-connect-core-1_0.html + * + * @param {string} [siteAuthSettings.issuer] The OpenID Connect Issuer URI that + * represents the entity which issues access tokens for this application. + * When using Azure Active Directory, this value is the URI of the directory + * tenant, e.g. https://sts.windows.net/{tenant-guid}/. + * This URI is a case-sensitive identifier for the token issuer. + * More information on OpenID Connect Discovery: + * http://openid.net/specs/openid-connect-discovery-1_0.html + * + * @param {boolean} [siteAuthSettings.validateIssuer] Gets a value indicating + * whether the issuer should be a valid HTTPS url and be validated as such. + * + * @param {array} [siteAuthSettings.allowedAudiences] Allowed audience values + * to consider when validating JWTs issued by + * Azure Active Directory. Note that the ClientID value is always + * considered an + * allowed audience, regardless of this setting. + * + * @param {array} [siteAuthSettings.additionalLoginParams] Login parameters to + * send to the OpenID Connect authorization endpoint when + * a user logs in. Each parameter must be in the form "key=value". + * + * @param {string} [siteAuthSettings.googleClientId] The OpenID Connect Client + * ID for the Google web application. + * This setting is required for enabling Google Sign-In. + * Google Sign-In documentation: + * https://developers.google.com/identity/sign-in/web/ + * + * @param {string} [siteAuthSettings.googleClientSecret] The client secret + * associated with the Google web application. + * This setting is required for enabling Google Sign-In. + * Google Sign-In documentation: + * https://developers.google.com/identity/sign-in/web/ + * + * @param {array} [siteAuthSettings.googleOAuthScopes] The OAuth 2.0 scopes + * that will be requested as part of Google Sign-In authentication. + * This setting is optional. If not specified, "openid", "profile", and "email" + * are used as default scopes. + * Google Sign-In documentation: + * https://developers.google.com/identity/sign-in/web/ + * + * @param {string} [siteAuthSettings.facebookAppId] The App ID of the Facebook + * app used for login. + * This setting is required for enabling Facebook Login. + * Facebook Login documentation: + * https://developers.facebook.com/docs/facebook-login + * + * @param {string} [siteAuthSettings.facebookAppSecret] The App Secret of the + * Facebook app used for Facebook Login. + * This setting is required for enabling Facebook Login. + * Facebook Login documentation: + * https://developers.facebook.com/docs/facebook-login + * + * @param {array} [siteAuthSettings.facebookOAuthScopes] The OAuth 2.0 scopes + * that will be requested as part of Facebook Login authentication. + * This setting is optional. + * Facebook Login documentation: + * https://developers.facebook.com/docs/facebook-login + * + * @param {string} [siteAuthSettings.twitterConsumerKey] The OAuth 1.0a + * consumer key of the Twitter application used for sign-in. + * This setting is required for enabling Twitter Sign-In. + * Twitter Sign-In documentation: https://dev.twitter.com/web/sign-in + * + * @param {string} [siteAuthSettings.twitterConsumerSecret] The OAuth 1.0a + * consumer secret of the Twitter application used for sign-in. + * This setting is required for enabling Twitter Sign-In. + * Twitter Sign-In documentation: https://dev.twitter.com/web/sign-in + * + * @param {string} [siteAuthSettings.microsoftAccountClientId] The OAuth 2.0 + * client ID that was created for the app used for authentication. + * This setting is required for enabling Microsoft Account authentication. + * Microsoft Account OAuth documentation: + * https://dev.onedrive.com/auth/msa_oauth.htm + * + * @param {string} [siteAuthSettings.microsoftAccountClientSecret] The OAuth + * 2.0 client secret that was created for the app used for authentication. + * This setting is required for enabling Microsoft Account authentication. + * Microsoft Account OAuth documentation: + * https://dev.onedrive.com/auth/msa_oauth.htm + * + * @param {array} [siteAuthSettings.microsoftAccountOAuthScopes] The OAuth 2.0 + * scopes that will be requested as part of Microsoft Account authentication. + * This setting is optional. If not specified, "wl.basic" is used as the + * default scope. + * Microsoft Account Scopes and permissions documentation: + * https://msdn.microsoft.com/en-us/library/dn631845.aspx + * + * @param {string} [siteAuthSettings.kind] Kind of resource. + * + * @param {string} slot Name of web app slot. If not specified then will + * default to production slot. + * + * @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 SiteAuthSettings} 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 _updateAuthSettingsSlot(resourceGroupName, name, siteAuthSettings, slot, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (siteAuthSettings === null || siteAuthSettings === undefined) { + throw new Error('siteAuthSettings cannot be null or undefined.'); + } + if (slot === null || slot === undefined || typeof slot.valueOf() !== 'string') { + throw new Error('slot cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/authsettings'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'PUT'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (siteAuthSettings !== null && siteAuthSettings !== undefined) { + let requestModelMapper = new client.models['SiteAuthSettings']().mapper(); + requestModel = client.serialize(requestModelMapper, siteAuthSettings, 'siteAuthSettings'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(siteAuthSettings, 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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['SiteAuthSettings']().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 the Authentication/Authorization settings of an app. + * + * Gets the Authentication/Authorization settings of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will get the settings for the production slot. + * + * @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 SiteAuthSettings} 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 _getAuthSettingsSlot(resourceGroupName, name, slot, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (slot === null || slot === undefined || typeof slot.valueOf() !== 'string') { + throw new Error('slot cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/authsettings/list'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); + 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]; + } + } + } + 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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['SiteAuthSettings']().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 Updates the Azure storage account configurations of an app. + * + * Updates the Azure storage account configurations of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} azureStorageAccounts Azure storage accounts of the app. + * + * @param {object} [azureStorageAccounts.properties] Azure storage accounts. + * + * @param {string} [azureStorageAccounts.kind] Kind of resource. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will update the Azure storage account configurations for + * the production slot. + * + * @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 AzureStoragePropertyDictionaryResource} 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 _updateAzureStorageAccountsSlot(resourceGroupName, name, azureStorageAccounts, slot, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (azureStorageAccounts === null || azureStorageAccounts === undefined) { + throw new Error('azureStorageAccounts cannot be null or undefined.'); + } + if (slot === null || slot === undefined || typeof slot.valueOf() !== 'string') { + throw new Error('slot cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/azurestorageaccounts'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'PUT'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (azureStorageAccounts !== null && azureStorageAccounts !== undefined) { + let requestModelMapper = new client.models['AzureStoragePropertyDictionaryResource']().mapper(); + requestModel = client.serialize(requestModelMapper, azureStorageAccounts, 'azureStorageAccounts'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(azureStorageAccounts, 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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['AzureStoragePropertyDictionaryResource']().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 the Azure storage account configurations of an app. + * + * Gets the Azure storage account configurations of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will update the Azure storage account configurations for + * the production slot. + * + * @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 AzureStoragePropertyDictionaryResource} 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 _listAzureStorageAccountsSlot(resourceGroupName, name, slot, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (slot === null || slot === undefined || typeof slot.valueOf() !== 'string') { + throw new Error('slot cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/azurestorageaccounts/list'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); + 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]; + } + } + } + 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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['AzureStoragePropertyDictionaryResource']().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 Updates the backup configuration of an app. + * + * Updates the backup configuration of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} request Edited backup configuration. + * + * @param {string} [request.backupName] Name of the backup. + * + * @param {boolean} [request.enabled] True if the backup schedule is enabled + * (must be included in that case), false if the backup schedule should be + * disabled. + * + * @param {string} request.storageAccountUrl SAS URL to the container. + * + * @param {object} [request.backupSchedule] Schedule for the backup if it is + * executed periodically. + * + * @param {number} request.backupSchedule.frequencyInterval How often the + * backup should be executed (e.g. for weekly backup, this should be set to 7 + * and FrequencyUnit should be set to Day) + * + * @param {string} request.backupSchedule.frequencyUnit The unit of time for + * how often the backup should be executed (e.g. for weekly backup, this should + * be set to Day and FrequencyInterval should be set to 7). Possible values + * include: 'Day', 'Hour' + * + * @param {boolean} request.backupSchedule.keepAtLeastOneBackup True if the + * retention policy should always keep at least one backup in the storage + * account, regardless how old it is; false otherwise. + * + * @param {number} request.backupSchedule.retentionPeriodInDays After how many + * days backups should be deleted. + * + * @param {date} [request.backupSchedule.startTime] When the schedule should + * start working. + * + * @param {array} [request.databases] Databases included in the backup. + * + * @param {string} [request.kind] Kind of resource. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will update the backup configuration for the production + * slot. + * + * @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 BackupRequest} 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 _updateBackupConfigurationSlot(resourceGroupName, name, request, slot, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (request === null || request === undefined) { + throw new Error('request cannot be null or undefined.'); + } + if (slot === null || slot === undefined || typeof slot.valueOf() !== 'string') { + throw new Error('slot cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/backup'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'PUT'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (request !== null && request !== undefined) { + let requestModelMapper = new client.models['BackupRequest']().mapper(); + requestModel = client.serialize(requestModelMapper, request, 'request'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(request, 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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['BackupRequest']().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 Deletes the backup configuration of an app. + * + * Deletes the backup configuration of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will delete the backup configuration for the production + * slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _deleteBackupConfigurationSlot(resourceGroupName, name, slot, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (slot === null || slot === undefined || typeof slot.valueOf() !== 'string') { + throw new Error('slot cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/backup'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'DELETE'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + + return callback(null, result, httpRequest, response); + }); +} + +/** + * @summary Gets the backup configuration of an app. + * + * Gets the backup configuration of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will get the backup configuration for the production + * slot. + * + * @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 BackupRequest} 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 _getBackupConfigurationSlot(resourceGroupName, name, slot, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (slot === null || slot === undefined || typeof slot.valueOf() !== 'string') { + throw new Error('slot cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/backup/list'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); + 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]; + } + } + } + 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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['BackupRequest']().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 Replaces the connection strings of an app. + * + * Replaces the connection strings of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} connectionStrings Connection strings of the app or + * deployment slot. See example. + * + * @param {object} [connectionStrings.properties] Connection strings. + * + * @param {string} [connectionStrings.kind] Kind of resource. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will update the connection settings for the production + * slot. + * + * @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 ConnectionStringDictionary} 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 _updateConnectionStringsSlot(resourceGroupName, name, connectionStrings, slot, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (connectionStrings === null || connectionStrings === undefined) { + throw new Error('connectionStrings cannot be null or undefined.'); + } + if (slot === null || slot === undefined || typeof slot.valueOf() !== 'string') { + throw new Error('slot cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/connectionstrings'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'PUT'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (connectionStrings !== null && connectionStrings !== undefined) { + let requestModelMapper = new client.models['ConnectionStringDictionary']().mapper(); + requestModel = client.serialize(requestModelMapper, connectionStrings, 'connectionStrings'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(connectionStrings, 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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['ConnectionStringDictionary']().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 the connection strings of an app. + * + * Gets the connection strings of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will get the connection settings for the production slot. + * + * @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 ConnectionStringDictionary} 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 _listConnectionStringsSlot(resourceGroupName, name, slot, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (slot === null || slot === undefined || typeof slot.valueOf() !== 'string') { + throw new Error('slot cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/connectionstrings/list'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); + 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]; + } + } + } + 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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['ConnectionStringDictionary']().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 the logging configuration of an app. + * + * Gets the logging configuration of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will get the logging configuration for the production + * slot. + * + * @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 SiteLogsConfig} 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 _getDiagnosticLogsConfigurationSlot(resourceGroupName, name, slot, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (slot === null || slot === undefined || typeof slot.valueOf() !== 'string') { + throw new Error('slot cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/logs'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['SiteLogsConfig']().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 Updates the logging configuration of an app. + * + * Updates the logging configuration of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} siteLogsConfig A SiteLogsConfig JSON object that contains + * the logging configuration to change in the "properties" property. + * + * @param {object} [siteLogsConfig.applicationLogs] Application logs + * configuration. + * + * @param {object} [siteLogsConfig.applicationLogs.fileSystem] Application logs + * to file system configuration. + * + * @param {string} [siteLogsConfig.applicationLogs.fileSystem.level] Log level. + * Possible values include: 'Off', 'Verbose', 'Information', 'Warning', 'Error' + * + * @param {object} [siteLogsConfig.applicationLogs.azureTableStorage] + * Application logs to azure table storage configuration. + * + * @param {string} [siteLogsConfig.applicationLogs.azureTableStorage.level] Log + * level. Possible values include: 'Off', 'Verbose', 'Information', 'Warning', + * 'Error' + * + * @param {string} siteLogsConfig.applicationLogs.azureTableStorage.sasUrl SAS + * URL to an Azure table with add/query/delete permissions. + * + * @param {object} [siteLogsConfig.applicationLogs.azureBlobStorage] + * Application logs to blob storage configuration. + * + * @param {string} [siteLogsConfig.applicationLogs.azureBlobStorage.level] Log + * level. Possible values include: 'Off', 'Verbose', 'Information', 'Warning', + * 'Error' + * + * @param {string} [siteLogsConfig.applicationLogs.azureBlobStorage.sasUrl] SAS + * url to a azure blob container with read/write/list/delete permissions. + * + * @param {number} + * [siteLogsConfig.applicationLogs.azureBlobStorage.retentionInDays] Retention + * in days. + * Remove blobs older than X days. + * 0 or lower means no retention. + * + * @param {object} [siteLogsConfig.httpLogs] HTTP logs configuration. + * + * @param {object} [siteLogsConfig.httpLogs.fileSystem] Http logs to file + * system configuration. + * + * @param {number} [siteLogsConfig.httpLogs.fileSystem.retentionInMb] Maximum + * size in megabytes that http log files can use. + * When reached old log files will be removed to make space for new ones. + * Value can range between 25 and 100. + * + * @param {number} [siteLogsConfig.httpLogs.fileSystem.retentionInDays] + * Retention in days. + * Remove files older than X days. + * 0 or lower means no retention. + * + * @param {boolean} [siteLogsConfig.httpLogs.fileSystem.enabled] True if + * configuration is enabled, false if it is disabled and null if configuration + * is not set. + * + * @param {object} [siteLogsConfig.httpLogs.azureBlobStorage] Http logs to + * azure blob storage configuration. + * + * @param {string} [siteLogsConfig.httpLogs.azureBlobStorage.sasUrl] SAS url to + * a azure blob container with read/write/list/delete permissions. + * + * @param {number} [siteLogsConfig.httpLogs.azureBlobStorage.retentionInDays] + * Retention in days. + * Remove blobs older than X days. + * 0 or lower means no retention. + * + * @param {boolean} [siteLogsConfig.httpLogs.azureBlobStorage.enabled] True if + * configuration is enabled, false if it is disabled and null if configuration + * is not set. + * + * @param {object} [siteLogsConfig.failedRequestsTracing] Failed requests + * tracing configuration. + * + * @param {object} [siteLogsConfig.detailedErrorMessages] Detailed error + * messages configuration. + * + * @param {boolean} [siteLogsConfig.detailedErrorMessages.enabled] True if + * configuration is enabled, false if it is disabled and null if configuration + * is not set. + * + * @param {string} [siteLogsConfig.kind] Kind of resource. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will update the logging configuration for the production + * slot. + * + * @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 SiteLogsConfig} 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 _updateDiagnosticLogsConfigSlot(resourceGroupName, name, siteLogsConfig, slot, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (siteLogsConfig === null || siteLogsConfig === undefined) { + throw new Error('siteLogsConfig cannot be null or undefined.'); + } + if (slot === null || slot === undefined || typeof slot.valueOf() !== 'string') { + throw new Error('slot cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/logs'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'PUT'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (siteLogsConfig !== null && siteLogsConfig !== undefined) { + let requestModelMapper = new client.models['SiteLogsConfig']().mapper(); + requestModel = client.serialize(requestModelMapper, siteLogsConfig, 'siteLogsConfig'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(siteLogsConfig, 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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['SiteLogsConfig']().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 Replaces the metadata of an app. + * + * Replaces the metadata of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} metadata Edited metadata of the app or deployment slot. See + * example. + * + * @param {object} [metadata.properties] Settings. + * + * @param {string} [metadata.kind] Kind of resource. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will update the metadata for the production slot. + * + * @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 StringDictionary} 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 _updateMetadataSlot(resourceGroupName, name, metadata, slot, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (metadata === null || metadata === undefined) { + throw new Error('metadata cannot be null or undefined.'); + } + if (slot === null || slot === undefined || typeof slot.valueOf() !== 'string') { + throw new Error('slot cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/metadata'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'PUT'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (metadata !== null && metadata !== undefined) { + let requestModelMapper = new client.models['StringDictionary']().mapper(); + requestModel = client.serialize(requestModelMapper, metadata, 'metadata'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(metadata, 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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['StringDictionary']().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 the metadata of an app. + * + * Gets the metadata of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will get the metadata for the production slot. + * + * @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 StringDictionary} 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 _listMetadataSlot(resourceGroupName, name, slot, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (slot === null || slot === undefined || typeof slot.valueOf() !== 'string') { + throw new Error('slot cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/metadata/list'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); + 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]; + } + } + } + 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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['StringDictionary']().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 the Git/FTP publishing credentials of an app. + * + * Gets the Git/FTP publishing credentials of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will get the publishing credentials for the production + * slot. + * + * @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 User} 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 _listPublishingCredentialsSlot(resourceGroupName, name, slot, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + + if (!callback) { + throw new Error('callback cannot be null.'); + } + + // Send request + this.beginListPublishingCredentialsSlot(resourceGroupName, name, slot, options, (err, parsedResult, httpRequest, response) => { + if (err) return callback(err); + + let initialResult = new msRest.HttpOperationResponse(); + initialResult.request = httpRequest; + initialResult.response = response; + initialResult.body = response.body; + client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { + if (err) return callback(err); + + // Create Result + let result = null; + + httpRequest = pollingResult.request; + response = pollingResult.response; + let responseBody = pollingResult.body; + if (responseBody === '') responseBody = null; + + // Deserialize Response + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['User']().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 Updates the Push settings associated with web app. + * + * Updates the Push settings associated with web app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {object} pushSettings Push settings associated with web app. + * + * @param {boolean} pushSettings.isPushEnabled Gets or sets a flag indicating + * whether the Push endpoint is enabled. + * + * @param {string} [pushSettings.tagWhitelistJson] Gets or sets a JSON string + * containing a list of tags that are whitelisted for use by the push + * registration endpoint. + * + * @param {string} [pushSettings.tagsRequiringAuth] Gets or sets a JSON string + * containing a list of tags that require user authentication to be used in the + * push registration endpoint. + * Tags can consist of alphanumeric characters and the following: + * '_', '@', '#', '.', ':', '-'. + * Validation should be performed at the PushRequestHandler. + * + * @param {string} [pushSettings.dynamicTagsJson] Gets or sets a JSON string + * containing a list of dynamic tags that will be evaluated from user claims in + * the push registration endpoint. + * + * @param {string} [pushSettings.kind] Kind of resource. + * + * @param {string} slot Name of web app slot. If not specified then will + * default to production slot. + * + * @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 PushSettings} 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 _updateSitePushSettingsSlot(resourceGroupName, name, pushSettings, slot, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (pushSettings === null || pushSettings === undefined) { + throw new Error('pushSettings cannot be null or undefined.'); + } + if (slot === null || slot === undefined || typeof slot.valueOf() !== 'string') { + throw new Error('slot cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/pushsettings'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'PUT'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (pushSettings !== null && pushSettings !== undefined) { + let requestModelMapper = new client.models['PushSettings']().mapper(); + requestModel = client.serialize(requestModelMapper, pushSettings, 'pushSettings'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(pushSettings, 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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['PushSettings']().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 the Push settings associated with web app. + * + * Gets the Push settings associated with web app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {string} slot Name of web app slot. If not specified then will + * default to production slot. + * + * @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 PushSettings} 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 _listSitePushSettingsSlot(resourceGroupName, name, slot, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (slot === null || slot === undefined || typeof slot.valueOf() !== 'string') { + throw new Error('slot cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/pushsettings/list'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); + 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]; + } + } + } + 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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['PushSettings']().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 Swift Virtual Network connection. + * + * Gets a Swift Virtual Network connection. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will get a gateway for the production slot's Virtual + * Network. + * + * @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 SwiftVirtualNetwork} 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 _getSwiftVirtualNetworkConnectionSlot(resourceGroupName, name, slot, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (slot === null || slot === undefined || typeof slot.valueOf() !== 'string') { + throw new Error('slot cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/virtualNetwork'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['SwiftVirtualNetwork']().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 Integrates this Web App with a Virtual Network. This requires that + * 1) "swiftSupported" is true when doing a GET against this resource, and 2) + * that the target Subnet has already been delegated, and is not + * in use by another App Service Plan other than the one this App is in. + * + * Integrates this Web App with a Virtual Network. This requires that 1) + * "swiftSupported" is true when doing a GET against this resource, and 2) that + * the target Subnet has already been delegated, and is not + * in use by another App Service Plan other than the one this App is in. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} connectionEnvelope Properties of the Virtual Network + * connection. See example. + * + * @param {string} [connectionEnvelope.subnetResourceId] The Virtual Network + * subnet's resource ID. This is the subnet that this Web App will join. This + * subnet must have a delegation to Microsoft.Web/serverFarms defined first. + * + * @param {boolean} [connectionEnvelope.swiftSupported] A flag that specifies + * if the scale unit this Web App is on supports Swift integration. + * + * @param {string} [connectionEnvelope.kind] Kind of resource. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will add or update connections for the production slot. + * + * @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 SwiftVirtualNetwork} 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 _createOrUpdateSwiftVirtualNetworkConnectionSlot(resourceGroupName, name, connectionEnvelope, slot, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (connectionEnvelope === null || connectionEnvelope === undefined) { + throw new Error('connectionEnvelope cannot be null or undefined.'); + } + if (slot === null || slot === undefined || typeof slot.valueOf() !== 'string') { + throw new Error('slot cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/virtualNetwork'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'PUT'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (connectionEnvelope !== null && connectionEnvelope !== undefined) { + let requestModelMapper = new client.models['SwiftVirtualNetwork']().mapper(); + requestModel = client.serialize(requestModelMapper, connectionEnvelope, 'connectionEnvelope'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(connectionEnvelope, 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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['SwiftVirtualNetwork']().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 Deletes a Swift Virtual Network connection from an app (or + * deployment slot). + * + * Deletes a Swift Virtual Network connection from an app (or deployment slot). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will delete the connection for the production slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _deleteSwiftVirtualNetworkSlot(resourceGroupName, name, slot, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (slot === null || slot === undefined || typeof slot.valueOf() !== 'string') { + throw new Error('slot cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/virtualNetwork'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'DELETE'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 404) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + + return callback(null, result, httpRequest, response); + }); +} + +/** + * @summary Integrates this Web App with a Virtual Network. This requires that + * 1) "swiftSupported" is true when doing a GET against this resource, and 2) + * that the target Subnet has already been delegated, and is not + * in use by another App Service Plan other than the one this App is in. + * + * Integrates this Web App with a Virtual Network. This requires that 1) + * "swiftSupported" is true when doing a GET against this resource, and 2) that + * the target Subnet has already been delegated, and is not + * in use by another App Service Plan other than the one this App is in. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} connectionEnvelope Properties of the Virtual Network + * connection. See example. + * + * @param {string} [connectionEnvelope.subnetResourceId] The Virtual Network + * subnet's resource ID. This is the subnet that this Web App will join. This + * subnet must have a delegation to Microsoft.Web/serverFarms defined first. + * + * @param {boolean} [connectionEnvelope.swiftSupported] A flag that specifies + * if the scale unit this Web App is on supports Swift integration. + * + * @param {string} [connectionEnvelope.kind] Kind of resource. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will add or update connections for the production slot. + * + * @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 SwiftVirtualNetwork} 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 _updateSwiftVirtualNetworkConnectionSlot(resourceGroupName, name, connectionEnvelope, slot, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (connectionEnvelope === null || connectionEnvelope === undefined) { + throw new Error('connectionEnvelope cannot be null or undefined.'); + } + if (slot === null || slot === undefined || typeof slot.valueOf() !== 'string') { + throw new Error('slot cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/virtualNetwork'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'PATCH'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (connectionEnvelope !== null && connectionEnvelope !== undefined) { + let requestModelMapper = new client.models['SwiftVirtualNetwork']().mapper(); + requestModel = client.serialize(requestModelMapper, connectionEnvelope, 'connectionEnvelope'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(connectionEnvelope, 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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['SwiftVirtualNetwork']().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 the configuration of an app, such as platform version and + * bitness, default documents, virtual applications, Always On, etc. + * + * Gets the configuration of an app, such as platform version and bitness, + * default documents, virtual applications, Always On, etc. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will return configuration for the production slot. + * + * @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 SiteConfigResource} 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 _getConfigurationSlot(resourceGroupName, name, slot, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (slot === null || slot === undefined || typeof slot.valueOf() !== 'string') { + throw new Error('slot cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/web'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['SiteConfigResource']().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 Updates the configuration of an app. + * + * Updates the configuration of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} siteConfig JSON representation of a SiteConfig object. See + * example. + * + * @param {number} [siteConfig.numberOfWorkers] Number of workers. + * + * @param {array} [siteConfig.defaultDocuments] Default documents. + * + * @param {string} [siteConfig.netFrameworkVersion] .NET Framework version. + * + * @param {string} [siteConfig.phpVersion] Version of PHP. + * + * @param {string} [siteConfig.pythonVersion] Version of Python. + * + * @param {string} [siteConfig.nodeVersion] Version of Node.js. + * + * @param {string} [siteConfig.linuxFxVersion] Linux App Framework and version + * + * @param {string} [siteConfig.windowsFxVersion] Xenon App Framework and + * version + * + * @param {boolean} [siteConfig.requestTracingEnabled] true if + * request tracing is enabled; otherwise, false. + * + * @param {date} [siteConfig.requestTracingExpirationTime] Request tracing + * expiration time. + * + * @param {boolean} [siteConfig.remoteDebuggingEnabled] true if + * remote debugging is enabled; otherwise, false. + * + * @param {string} [siteConfig.remoteDebuggingVersion] Remote debugging + * version. + * + * @param {boolean} [siteConfig.httpLoggingEnabled] true if HTTP + * logging is enabled; otherwise, false. + * + * @param {number} [siteConfig.logsDirectorySizeLimit] HTTP logs directory size + * limit. + * + * @param {boolean} [siteConfig.detailedErrorLoggingEnabled] true + * if detailed error logging is enabled; otherwise, false. + * + * @param {string} [siteConfig.publishingUsername] Publishing user name. + * + * @param {array} [siteConfig.appSettings] Application settings. + * + * @param {object} [siteConfig.azureStorageAccounts] User-provided Azure + * storage accounts. + * + * @param {array} [siteConfig.connectionStrings] Connection strings. + * + * @param {array} [siteConfig.handlerMappings] Handler mappings. + * + * @param {string} [siteConfig.documentRoot] Document root. + * + * @param {string} [siteConfig.scmType] SCM type. Possible values include: + * 'None', 'Dropbox', 'Tfs', 'LocalGit', 'GitHub', 'CodePlexGit', 'CodePlexHg', + * 'BitbucketGit', 'BitbucketHg', 'ExternalGit', 'ExternalHg', 'OneDrive', + * 'VSO' + * + * @param {boolean} [siteConfig.use32BitWorkerProcess] true to use + * 32-bit worker process; otherwise, false. + * + * @param {boolean} [siteConfig.webSocketsEnabled] true if + * WebSocket is enabled; otherwise, false. + * + * @param {boolean} [siteConfig.alwaysOn] true if Always On is + * enabled; otherwise, false. + * + * @param {string} [siteConfig.javaVersion] Java version. + * + * @param {string} [siteConfig.javaContainer] Java container. + * + * @param {string} [siteConfig.javaContainerVersion] Java container version. + * + * @param {string} [siteConfig.appCommandLine] App command line to launch. + * + * @param {string} [siteConfig.managedPipelineMode] Managed pipeline mode. + * Possible values include: 'Integrated', 'Classic' + * + * @param {array} [siteConfig.virtualApplications] Virtual applications. + * + * @param {string} [siteConfig.loadBalancing] Site load balancing. Possible + * values include: 'WeightedRoundRobin', 'LeastRequests', 'LeastResponseTime', + * 'WeightedTotalTraffic', 'RequestHash' + * + * @param {object} [siteConfig.experiments] This is work around for polymophic + * types. + * + * @param {array} [siteConfig.experiments.rampUpRules] List of ramp-up rules. + * + * @param {object} [siteConfig.limits] Site limits. + * + * @param {number} [siteConfig.limits.maxPercentageCpu] Maximum allowed CPU + * usage percentage. + * + * @param {number} [siteConfig.limits.maxMemoryInMb] Maximum allowed memory + * usage in MB. + * + * @param {number} [siteConfig.limits.maxDiskSizeInMb] Maximum allowed disk + * size usage in MB. + * + * @param {boolean} [siteConfig.autoHealEnabled] true if Auto Heal + * is enabled; otherwise, false. + * + * @param {object} [siteConfig.autoHealRules] Auto Heal rules. + * + * @param {object} [siteConfig.autoHealRules.triggers] Conditions that describe + * when to execute the auto-heal actions. + * + * @param {object} [siteConfig.autoHealRules.triggers.requests] A rule based on + * total requests. + * + * @param {number} [siteConfig.autoHealRules.triggers.requests.count] Request + * Count. + * + * @param {string} [siteConfig.autoHealRules.triggers.requests.timeInterval] + * Time interval. + * + * @param {number} [siteConfig.autoHealRules.triggers.privateBytesInKB] A rule + * based on private bytes. + * + * @param {array} [siteConfig.autoHealRules.triggers.statusCodes] A rule based + * on status codes. + * + * @param {object} [siteConfig.autoHealRules.triggers.slowRequests] A rule + * based on request execution time. + * + * @param {string} [siteConfig.autoHealRules.triggers.slowRequests.timeTaken] + * Time taken. + * + * @param {number} [siteConfig.autoHealRules.triggers.slowRequests.count] + * Request Count. + * + * @param {string} + * [siteConfig.autoHealRules.triggers.slowRequests.timeInterval] Time interval. + * + * @param {object} [siteConfig.autoHealRules.actions] Actions to be executed + * when a rule is triggered. + * + * @param {string} [siteConfig.autoHealRules.actions.actionType] Predefined + * action to be taken. Possible values include: 'Recycle', 'LogEvent', + * 'CustomAction' + * + * @param {object} [siteConfig.autoHealRules.actions.customAction] Custom + * action to be taken. + * + * @param {string} [siteConfig.autoHealRules.actions.customAction.exe] + * Executable to be run. + * + * @param {string} [siteConfig.autoHealRules.actions.customAction.parameters] + * Parameters for the executable. + * + * @param {string} [siteConfig.autoHealRules.actions.minProcessExecutionTime] + * Minimum time the process must execute + * before taking the action + * + * @param {string} [siteConfig.tracingOptions] Tracing options. + * + * @param {string} [siteConfig.vnetName] Virtual Network name. + * + * @param {object} [siteConfig.cors] Cross-Origin Resource Sharing (CORS) + * settings. + * + * @param {array} [siteConfig.cors.allowedOrigins] Gets or sets the list of + * origins that should be allowed to make cross-origin + * calls (for example: http://example.com:12345). Use "*" to allow all. + * + * @param {object} [siteConfig.push] Push endpoint settings. + * + * @param {boolean} siteConfig.push.isPushEnabled Gets or sets a flag + * indicating whether the Push endpoint is enabled. + * + * @param {string} [siteConfig.push.tagWhitelistJson] Gets or sets a JSON + * string containing a list of tags that are whitelisted for use by the push + * registration endpoint. + * + * @param {string} [siteConfig.push.tagsRequiringAuth] Gets or sets a JSON + * string containing a list of tags that require user authentication to be used + * in the push registration endpoint. + * Tags can consist of alphanumeric characters and the following: + * '_', '@', '#', '.', ':', '-'. + * Validation should be performed at the PushRequestHandler. + * + * @param {string} [siteConfig.push.dynamicTagsJson] Gets or sets a JSON string + * containing a list of dynamic tags that will be evaluated from user claims in + * the push registration endpoint. + * + * @param {string} [siteConfig.push.kind] Kind of resource. + * + * @param {object} [siteConfig.apiDefinition] Information about the formal API + * definition for the app. + * + * @param {string} [siteConfig.apiDefinition.url] The URL of the API + * definition. + * + * @param {string} [siteConfig.autoSwapSlotName] Auto-swap slot name. + * + * @param {boolean} [siteConfig.localMySqlEnabled] true to enable + * local MySQL; otherwise, false. + * + * @param {number} [siteConfig.managedServiceIdentityId] Managed Service + * Identity Id + * + * @param {number} [siteConfig.xManagedServiceIdentityId] Explicit Managed + * Service Identity Id + * + * @param {array} [siteConfig.ipSecurityRestrictions] IP security restrictions. + * + * @param {boolean} [siteConfig.http20Enabled] Http20Enabled: configures a web + * site to allow clients to connect over http2.0 + * + * @param {string} [siteConfig.minTlsVersion] MinTlsVersion: configures the + * minimum version of TLS required for SSL requests. Possible values include: + * '1.0', '1.1', '1.2' + * + * @param {string} [siteConfig.ftpsState] State of FTP / FTPS service. Possible + * values include: 'AllAllowed', 'FtpsOnly', 'Disabled' + * + * @param {number} [siteConfig.reservedInstanceCount] Number of reserved + * instances. + * This setting only applies to the Consumption Plan + * + * @param {string} [siteConfig.kind] Kind of resource. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will update configuration for the production slot. + * + * @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 SiteConfigResource} 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 _createOrUpdateConfigurationSlot(resourceGroupName, name, siteConfig, slot, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (siteConfig === null || siteConfig === undefined) { + throw new Error('siteConfig cannot be null or undefined.'); + } + if (slot === null || slot === undefined || typeof slot.valueOf() !== 'string') { + throw new Error('slot cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/web'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'PUT'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (siteConfig !== null && siteConfig !== undefined) { + let requestModelMapper = new client.models['SiteConfigResource']().mapper(); + requestModel = client.serialize(requestModelMapper, siteConfig, 'siteConfig'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(siteConfig, 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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['SiteConfigResource']().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 Updates the configuration of an app. + * + * Updates the configuration of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} siteConfig JSON representation of a SiteConfig object. See + * example. + * + * @param {number} [siteConfig.numberOfWorkers] Number of workers. + * + * @param {array} [siteConfig.defaultDocuments] Default documents. + * + * @param {string} [siteConfig.netFrameworkVersion] .NET Framework version. + * + * @param {string} [siteConfig.phpVersion] Version of PHP. + * + * @param {string} [siteConfig.pythonVersion] Version of Python. + * + * @param {string} [siteConfig.nodeVersion] Version of Node.js. + * + * @param {string} [siteConfig.linuxFxVersion] Linux App Framework and version + * + * @param {string} [siteConfig.windowsFxVersion] Xenon App Framework and + * version + * + * @param {boolean} [siteConfig.requestTracingEnabled] true if + * request tracing is enabled; otherwise, false. + * + * @param {date} [siteConfig.requestTracingExpirationTime] Request tracing + * expiration time. + * + * @param {boolean} [siteConfig.remoteDebuggingEnabled] true if + * remote debugging is enabled; otherwise, false. + * + * @param {string} [siteConfig.remoteDebuggingVersion] Remote debugging + * version. + * + * @param {boolean} [siteConfig.httpLoggingEnabled] true if HTTP + * logging is enabled; otherwise, false. + * + * @param {number} [siteConfig.logsDirectorySizeLimit] HTTP logs directory size + * limit. + * + * @param {boolean} [siteConfig.detailedErrorLoggingEnabled] true + * if detailed error logging is enabled; otherwise, false. + * + * @param {string} [siteConfig.publishingUsername] Publishing user name. + * + * @param {array} [siteConfig.appSettings] Application settings. + * + * @param {object} [siteConfig.azureStorageAccounts] User-provided Azure + * storage accounts. + * + * @param {array} [siteConfig.connectionStrings] Connection strings. + * + * @param {array} [siteConfig.handlerMappings] Handler mappings. + * + * @param {string} [siteConfig.documentRoot] Document root. + * + * @param {string} [siteConfig.scmType] SCM type. Possible values include: + * 'None', 'Dropbox', 'Tfs', 'LocalGit', 'GitHub', 'CodePlexGit', 'CodePlexHg', + * 'BitbucketGit', 'BitbucketHg', 'ExternalGit', 'ExternalHg', 'OneDrive', + * 'VSO' + * + * @param {boolean} [siteConfig.use32BitWorkerProcess] true to use + * 32-bit worker process; otherwise, false. + * + * @param {boolean} [siteConfig.webSocketsEnabled] true if + * WebSocket is enabled; otherwise, false. + * + * @param {boolean} [siteConfig.alwaysOn] true if Always On is + * enabled; otherwise, false. + * + * @param {string} [siteConfig.javaVersion] Java version. + * + * @param {string} [siteConfig.javaContainer] Java container. + * + * @param {string} [siteConfig.javaContainerVersion] Java container version. + * + * @param {string} [siteConfig.appCommandLine] App command line to launch. + * + * @param {string} [siteConfig.managedPipelineMode] Managed pipeline mode. + * Possible values include: 'Integrated', 'Classic' + * + * @param {array} [siteConfig.virtualApplications] Virtual applications. + * + * @param {string} [siteConfig.loadBalancing] Site load balancing. Possible + * values include: 'WeightedRoundRobin', 'LeastRequests', 'LeastResponseTime', + * 'WeightedTotalTraffic', 'RequestHash' + * + * @param {object} [siteConfig.experiments] This is work around for polymophic + * types. + * + * @param {array} [siteConfig.experiments.rampUpRules] List of ramp-up rules. + * + * @param {object} [siteConfig.limits] Site limits. + * + * @param {number} [siteConfig.limits.maxPercentageCpu] Maximum allowed CPU + * usage percentage. + * + * @param {number} [siteConfig.limits.maxMemoryInMb] Maximum allowed memory + * usage in MB. + * + * @param {number} [siteConfig.limits.maxDiskSizeInMb] Maximum allowed disk + * size usage in MB. + * + * @param {boolean} [siteConfig.autoHealEnabled] true if Auto Heal + * is enabled; otherwise, false. + * + * @param {object} [siteConfig.autoHealRules] Auto Heal rules. + * + * @param {object} [siteConfig.autoHealRules.triggers] Conditions that describe + * when to execute the auto-heal actions. + * + * @param {object} [siteConfig.autoHealRules.triggers.requests] A rule based on + * total requests. + * + * @param {number} [siteConfig.autoHealRules.triggers.requests.count] Request + * Count. + * + * @param {string} [siteConfig.autoHealRules.triggers.requests.timeInterval] + * Time interval. + * + * @param {number} [siteConfig.autoHealRules.triggers.privateBytesInKB] A rule + * based on private bytes. + * + * @param {array} [siteConfig.autoHealRules.triggers.statusCodes] A rule based + * on status codes. + * + * @param {object} [siteConfig.autoHealRules.triggers.slowRequests] A rule + * based on request execution time. + * + * @param {string} [siteConfig.autoHealRules.triggers.slowRequests.timeTaken] + * Time taken. + * + * @param {number} [siteConfig.autoHealRules.triggers.slowRequests.count] + * Request Count. + * + * @param {string} + * [siteConfig.autoHealRules.triggers.slowRequests.timeInterval] Time interval. + * + * @param {object} [siteConfig.autoHealRules.actions] Actions to be executed + * when a rule is triggered. + * + * @param {string} [siteConfig.autoHealRules.actions.actionType] Predefined + * action to be taken. Possible values include: 'Recycle', 'LogEvent', + * 'CustomAction' + * + * @param {object} [siteConfig.autoHealRules.actions.customAction] Custom + * action to be taken. + * + * @param {string} [siteConfig.autoHealRules.actions.customAction.exe] + * Executable to be run. + * + * @param {string} [siteConfig.autoHealRules.actions.customAction.parameters] + * Parameters for the executable. + * + * @param {string} [siteConfig.autoHealRules.actions.minProcessExecutionTime] + * Minimum time the process must execute + * before taking the action + * + * @param {string} [siteConfig.tracingOptions] Tracing options. + * + * @param {string} [siteConfig.vnetName] Virtual Network name. + * + * @param {object} [siteConfig.cors] Cross-Origin Resource Sharing (CORS) + * settings. + * + * @param {array} [siteConfig.cors.allowedOrigins] Gets or sets the list of + * origins that should be allowed to make cross-origin + * calls (for example: http://example.com:12345). Use "*" to allow all. + * + * @param {object} [siteConfig.push] Push endpoint settings. + * + * @param {boolean} siteConfig.push.isPushEnabled Gets or sets a flag + * indicating whether the Push endpoint is enabled. + * + * @param {string} [siteConfig.push.tagWhitelistJson] Gets or sets a JSON + * string containing a list of tags that are whitelisted for use by the push + * registration endpoint. + * + * @param {string} [siteConfig.push.tagsRequiringAuth] Gets or sets a JSON + * string containing a list of tags that require user authentication to be used + * in the push registration endpoint. + * Tags can consist of alphanumeric characters and the following: + * '_', '@', '#', '.', ':', '-'. + * Validation should be performed at the PushRequestHandler. + * + * @param {string} [siteConfig.push.dynamicTagsJson] Gets or sets a JSON string + * containing a list of dynamic tags that will be evaluated from user claims in + * the push registration endpoint. + * + * @param {string} [siteConfig.push.kind] Kind of resource. + * + * @param {object} [siteConfig.apiDefinition] Information about the formal API + * definition for the app. + * + * @param {string} [siteConfig.apiDefinition.url] The URL of the API + * definition. + * + * @param {string} [siteConfig.autoSwapSlotName] Auto-swap slot name. + * + * @param {boolean} [siteConfig.localMySqlEnabled] true to enable + * local MySQL; otherwise, false. + * + * @param {number} [siteConfig.managedServiceIdentityId] Managed Service + * Identity Id + * + * @param {number} [siteConfig.xManagedServiceIdentityId] Explicit Managed + * Service Identity Id + * + * @param {array} [siteConfig.ipSecurityRestrictions] IP security restrictions. + * + * @param {boolean} [siteConfig.http20Enabled] Http20Enabled: configures a web + * site to allow clients to connect over http2.0 + * + * @param {string} [siteConfig.minTlsVersion] MinTlsVersion: configures the + * minimum version of TLS required for SSL requests. Possible values include: + * '1.0', '1.1', '1.2' + * + * @param {string} [siteConfig.ftpsState] State of FTP / FTPS service. Possible + * values include: 'AllAllowed', 'FtpsOnly', 'Disabled' + * + * @param {number} [siteConfig.reservedInstanceCount] Number of reserved + * instances. + * This setting only applies to the Consumption Plan + * + * @param {string} [siteConfig.kind] Kind of resource. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will update configuration for the production slot. + * + * @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 SiteConfigResource} 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 _updateConfigurationSlot(resourceGroupName, name, siteConfig, slot, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (siteConfig === null || siteConfig === undefined) { + throw new Error('siteConfig cannot be null or undefined.'); + } + if (slot === null || slot === undefined || typeof slot.valueOf() !== 'string') { + throw new Error('slot cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/web'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'PATCH'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (siteConfig !== null && siteConfig !== undefined) { + let requestModelMapper = new client.models['SiteConfigResource']().mapper(); + requestModel = client.serialize(requestModelMapper, siteConfig, 'siteConfig'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(siteConfig, 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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['SiteConfigResource']().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 web app configuration snapshots identifiers. Each + * element of the list contains a timestamp and the ID of the snapshot. + * + * Gets a list of web app configuration snapshots identifiers. Each element of + * the list contains a timestamp and the ID of the snapshot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will return configuration for the production slot. + * + * @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 SiteConfigurationSnapshotInfoCollection} 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 _listConfigurationSnapshotInfoSlot(resourceGroupName, name, slot, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (slot === null || slot === undefined || typeof slot.valueOf() !== 'string') { + throw new Error('slot cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/web/snapshots'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['SiteConfigurationSnapshotInfoCollection']().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 snapshot of the configuration of an app at a previous point + * in time. + * + * Gets a snapshot of the configuration of an app at a previous point in time. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} snapshotId The ID of the snapshot to read. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will return configuration for the production slot. + * + * @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 SiteConfigResource} 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 _getConfigurationSnapshotSlot(resourceGroupName, name, snapshotId, slot, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (snapshotId === null || snapshotId === undefined || typeof snapshotId.valueOf() !== 'string') { + throw new Error('snapshotId cannot be null or undefined and it must be of type string.'); + } + if (slot === null || slot === undefined || typeof slot.valueOf() !== 'string') { + throw new Error('slot cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/web/snapshots/{snapshotId}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{snapshotId}', encodeURIComponent(snapshotId)); + requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['SiteConfigResource']().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 Reverts the configuration of an app to a previous snapshot. + * + * Reverts the configuration of an app to a previous snapshot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} snapshotId The ID of the snapshot to read. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will return configuration for the production slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _recoverSiteConfigurationSnapshotSlot(resourceGroupName, name, snapshotId, slot, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (snapshotId === null || snapshotId === undefined || typeof snapshotId.valueOf() !== 'string') { + throw new Error('snapshotId cannot be null or undefined and it must be of type string.'); + } + if (slot === null || slot === undefined || typeof slot.valueOf() !== 'string') { + throw new Error('slot cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/web/snapshots/{snapshotId}/recover'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{snapshotId}', encodeURIComponent(snapshotId)); + requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); + 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]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 204) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + + return callback(null, result, httpRequest, response); + }); +} + +/** + * @summary Gets the last lines of docker logs for the given site + * + * Gets the last lines of docker logs for the given site + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {string} slot Name of web app slot. If not specified then will + * default to production slot. + * + * @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. + * + * {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 _getWebSiteContainerLogsSlot(resourceGroupName, name, slot, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (slot === null || slot === undefined || typeof slot.valueOf() !== 'string') { + throw new Error('slot cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/containerlogs'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); + 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]; + } + } + } + httpRequest.body = null; + // Send Request + httpRequest.streamedResponse = true; + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 204) { + let error = new Error(`Unexpected status code: ${statusCode}`); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + if (responseBody !== undefined) 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 = response; + return callback(null, result, httpRequest, response); + }); +} + +/** + * @summary Gets the ZIP archived docker log files for the given site + * + * Gets the ZIP archived docker log files for the given site + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {string} slot Name of web app slot. If not specified then will + * default to production slot. + * + * @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. + * + * {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 _getContainerLogsZipSlot(resourceGroupName, name, slot, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (slot === null || slot === undefined || typeof slot.valueOf() !== 'string') { + throw new Error('slot cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/containerlogs/zip/download'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); + 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]; + } + } + } + httpRequest.body = null; + // Send Request + httpRequest.streamedResponse = true; + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 204) { + let error = new Error(`Unexpected status code: ${statusCode}`); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + if (responseBody !== undefined) 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 = response; + return callback(null, result, httpRequest, response); + }); +} + +/** + * @summary List continuous web jobs for an app, or a deployment slot. + * + * List continuous web jobs for an app, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API deletes a deployment for the production slot. + * + * @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 ContinuousWebJobCollection} 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 _listContinuousWebJobsSlot(resourceGroupName, name, slot, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (slot === null || slot === undefined || typeof slot.valueOf() !== 'string') { + throw new Error('slot cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/continuouswebjobs'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['ContinuousWebJobCollection']().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 continuous web job by its ID for an app, or a deployment + * slot. + * + * Gets a continuous web job by its ID for an app, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} webJobName Name of Web Job. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API deletes a deployment for the production slot. + * + * @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 ContinuousWebJob} 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 _getContinuousWebJobSlot(resourceGroupName, name, webJobName, slot, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (webJobName === null || webJobName === undefined || typeof webJobName.valueOf() !== 'string') { + throw new Error('webJobName cannot be null or undefined and it must be of type string.'); + } + if (slot === null || slot === undefined || typeof slot.valueOf() !== 'string') { + throw new Error('slot cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/continuouswebjobs/{webJobName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{webJobName}', encodeURIComponent(webJobName)); + requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 404) { + 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['ContinuousWebJob']().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 Delete a continuous web job by its ID for an app, or a deployment + * slot. + * + * Delete a continuous web job by its ID for an app, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} webJobName Name of Web Job. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API deletes a deployment for the production slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _deleteContinuousWebJobSlot(resourceGroupName, name, webJobName, slot, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (webJobName === null || webJobName === undefined || typeof webJobName.valueOf() !== 'string') { + throw new Error('webJobName cannot be null or undefined and it must be of type string.'); + } + if (slot === null || slot === undefined || typeof slot.valueOf() !== 'string') { + throw new Error('slot cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/continuouswebjobs/{webJobName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{webJobName}', encodeURIComponent(webJobName)); + requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'DELETE'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 204) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + + return callback(null, result, httpRequest, response); + }); +} + +/** + * @summary Start a continuous web job for an app, or a deployment slot. + * + * Start a continuous web job for an app, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} webJobName Name of Web Job. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API deletes a deployment for the production slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _startContinuousWebJobSlot(resourceGroupName, name, webJobName, slot, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (webJobName === null || webJobName === undefined || typeof webJobName.valueOf() !== 'string') { + throw new Error('webJobName cannot be null or undefined and it must be of type string.'); + } + if (slot === null || slot === undefined || typeof slot.valueOf() !== 'string') { + throw new Error('slot cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/continuouswebjobs/{webJobName}/start'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{webJobName}', encodeURIComponent(webJobName)); + requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); + 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]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 404) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + + return callback(null, result, httpRequest, response); + }); +} + +/** + * @summary Stop a continuous web job for an app, or a deployment slot. + * + * Stop a continuous web job for an app, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} webJobName Name of Web Job. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API deletes a deployment for the production slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _stopContinuousWebJobSlot(resourceGroupName, name, webJobName, slot, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (webJobName === null || webJobName === undefined || typeof webJobName.valueOf() !== 'string') { + throw new Error('webJobName cannot be null or undefined and it must be of type string.'); + } + if (slot === null || slot === undefined || typeof slot.valueOf() !== 'string') { + throw new Error('slot cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/continuouswebjobs/{webJobName}/stop'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{webJobName}', encodeURIComponent(webJobName)); + requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); + 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]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 404) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + + return callback(null, result, httpRequest, response); + }); +} + +/** + * @summary List deployments for an app, or a deployment slot. + * + * List deployments for an app, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API returns deployments for the production slot. + * + * @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 DeploymentCollection} 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 _listDeploymentsSlot(resourceGroupName, name, slot, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (slot === null || slot === undefined || typeof slot.valueOf() !== 'string') { + throw new Error('slot cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/deployments'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['DeploymentCollection']().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 Get a deployment by its ID for an app, or a deployment slot. + * + * Get a deployment by its ID for an app, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} id Deployment ID. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API gets a deployment for the production slot. + * + * @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 Deployment} 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 _getDeploymentSlot(resourceGroupName, name, id, slot, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (id === null || id === undefined || typeof id.valueOf() !== 'string') { + throw new Error('id cannot be null or undefined and it must be of type string.'); + } + if (slot === null || slot === undefined || typeof slot.valueOf() !== 'string') { + throw new Error('slot cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/deployments/{id}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{id}', encodeURIComponent(id)); + requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['Deployment']().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 Create a deployment for an app, or a deployment slot. + * + * Create a deployment for an app, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} id ID of an existing deployment. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API creates a deployment for the production slot. + * + * @param {object} deployment Deployment details. + * + * @param {number} [deployment.status] Deployment status. + * + * @param {string} [deployment.message] Details about deployment status. + * + * @param {string} [deployment.author] Who authored the deployment. + * + * @param {string} [deployment.deployer] Who performed the deployment. + * + * @param {string} [deployment.authorEmail] Author email. + * + * @param {date} [deployment.startTime] Start time. + * + * @param {date} [deployment.endTime] End time. + * + * @param {boolean} [deployment.active] True if deployment is currently active, + * false if completed and null if not started. + * + * @param {string} [deployment.details] Details on deployment. + * + * @param {string} [deployment.kind] Kind of resource. + * + * @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 Deployment} 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 _createDeploymentSlot(resourceGroupName, name, id, slot, deployment, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (id === null || id === undefined || typeof id.valueOf() !== 'string') { + throw new Error('id cannot be null or undefined and it must be of type string.'); + } + if (slot === null || slot === undefined || typeof slot.valueOf() !== 'string') { + throw new Error('slot cannot be null or undefined and it must be of type string.'); + } + if (deployment === null || deployment === undefined) { + throw new Error('deployment cannot be null or undefined.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/deployments/{id}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{id}', encodeURIComponent(id)); + requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'PUT'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (deployment !== null && deployment !== undefined) { + let requestModelMapper = new client.models['Deployment']().mapper(); + requestModel = client.serialize(requestModelMapper, deployment, 'deployment'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(deployment, 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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['Deployment']().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 Delete a deployment by its ID for an app, or a deployment slot. + * + * Delete a deployment by its ID for an app, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} id Deployment ID. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API deletes a deployment for the production slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _deleteDeploymentSlot(resourceGroupName, name, id, slot, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (id === null || id === undefined || typeof id.valueOf() !== 'string') { + throw new Error('id cannot be null or undefined and it must be of type string.'); + } + if (slot === null || slot === undefined || typeof slot.valueOf() !== 'string') { + throw new Error('slot cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/deployments/{id}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{id}', encodeURIComponent(id)); + requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'DELETE'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 204) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + + return callback(null, result, httpRequest, response); + }); +} + +/** + * @summary List deployment log for specific deployment for an app, or a + * deployment slot. + * + * List deployment log for specific deployment for an app, or a deployment + * slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} id The ID of a specific deployment. This is the value of the + * name property in the JSON response from "GET + * /api/sites/{siteName}/deployments". + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API returns deployments for the production slot. + * + * @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 Deployment} 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 _listDeploymentLogSlot(resourceGroupName, name, id, slot, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (id === null || id === undefined || typeof id.valueOf() !== 'string') { + throw new Error('id cannot be null or undefined and it must be of type string.'); + } + if (slot === null || slot === undefined || typeof slot.valueOf() !== 'string') { + throw new Error('slot cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/deployments/{id}/log'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{id}', encodeURIComponent(id)); + requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['Deployment']().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 Discovers an existing app backup that can be restored from a blob + * in Azure storage. Use this to get information about the databases stored in + * a backup. + * + * Discovers an existing app backup that can be restored from a blob in Azure + * storage. Use this to get information about the databases stored in a backup. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} request A RestoreRequest object that includes Azure storage + * URL and blog name for discovery of backup. + * + * @param {string} request.storageAccountUrl SAS URL to the container. + * + * @param {string} [request.blobName] Name of a blob which contains the backup. + * + * @param {boolean} request.overwrite true if the restore + * operation can overwrite target app; otherwise, false. + * true is needed if trying to restore over an existing app. + * + * @param {string} [request.siteName] Name of an app. + * + * @param {array} [request.databases] Collection of databases which should be + * restored. This list has to match the list of databases included in the + * backup. + * + * @param {boolean} [request.ignoreConflictingHostNames] Changes a logic when + * restoring an app with custom domains. true to remove custom + * domains automatically. If false, custom domains are added to + * the app's object when it is being restored, but that might fail due to + * conflicts during the operation. + * + * @param {boolean} [request.ignoreDatabases] Ignore the databases and only + * restore the site content + * + * @param {string} [request.appServicePlan] Specify app service plan that will + * own restored site. + * + * @param {string} [request.operationType] Operation type. Possible values + * include: 'Default', 'Clone', 'Relocation', 'Snapshot', 'CloudFS' + * + * @param {boolean} [request.adjustConnectionStrings] true if + * SiteConfig.ConnectionStrings should be set in new app; otherwise, + * false. + * + * @param {string} [request.hostingEnvironment] App Service Environment name, + * if needed (only when restoring an app to an App Service Environment). + * + * @param {string} [request.kind] Kind of resource. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will perform discovery for the production slot. + * + * @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 RestoreRequest} 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 _discoverBackupSlot(resourceGroupName, name, request, slot, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (request === null || request === undefined) { + throw new Error('request cannot be null or undefined.'); + } + if (slot === null || slot === undefined || typeof slot.valueOf() !== 'string') { + throw new Error('slot cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/discoverbackup'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); + 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 (request !== null && request !== undefined) { + let requestModelMapper = new client.models['RestoreRequest']().mapper(); + requestModel = client.serialize(requestModelMapper, request, 'request'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(request, 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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['RestoreRequest']().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 Lists ownership identifiers for domain associated with web app. + * + * Lists ownership identifiers for domain associated with web app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will delete the binding for the production slot. + * + * @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 IdentifierCollection} 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 _listDomainOwnershipIdentifiersSlot(resourceGroupName, name, slot, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (slot === null || slot === undefined || typeof slot.valueOf() !== 'string') { + throw new Error('slot cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/domainOwnershipIdentifiers'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['IdentifierCollection']().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 Get domain ownership identifier for web app. + * + * Get domain ownership identifier for web app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} domainOwnershipIdentifierName Name of domain ownership + * identifier. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will delete the binding for the production slot. + * + * @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 Identifier} 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 _getDomainOwnershipIdentifierSlot(resourceGroupName, name, domainOwnershipIdentifierName, slot, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (domainOwnershipIdentifierName === null || domainOwnershipIdentifierName === undefined || typeof domainOwnershipIdentifierName.valueOf() !== 'string') { + throw new Error('domainOwnershipIdentifierName cannot be null or undefined and it must be of type string.'); + } + if (slot === null || slot === undefined || typeof slot.valueOf() !== 'string') { + throw new Error('slot cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/domainOwnershipIdentifiers/{domainOwnershipIdentifierName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{domainOwnershipIdentifierName}', encodeURIComponent(domainOwnershipIdentifierName)); + requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['Identifier']().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 Creates a domain ownership identifier for web app, or updates an + * existing ownership identifier. + * + * Creates a domain ownership identifier for web app, or updates an existing + * ownership identifier. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} domainOwnershipIdentifierName Name of domain ownership + * identifier. + * + * @param {object} domainOwnershipIdentifier A JSON representation of the + * domain ownership properties. + * + * @param {string} [domainOwnershipIdentifier.identifierId] String + * representation of the identity. + * + * @param {string} [domainOwnershipIdentifier.kind] Kind of resource. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will delete the binding for the production slot. + * + * @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 Identifier} 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 _createOrUpdateDomainOwnershipIdentifierSlot(resourceGroupName, name, domainOwnershipIdentifierName, domainOwnershipIdentifier, slot, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (domainOwnershipIdentifierName === null || domainOwnershipIdentifierName === undefined || typeof domainOwnershipIdentifierName.valueOf() !== 'string') { + throw new Error('domainOwnershipIdentifierName cannot be null or undefined and it must be of type string.'); + } + if (domainOwnershipIdentifier === null || domainOwnershipIdentifier === undefined) { + throw new Error('domainOwnershipIdentifier cannot be null or undefined.'); + } + if (slot === null || slot === undefined || typeof slot.valueOf() !== 'string') { + throw new Error('slot cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/domainOwnershipIdentifiers/{domainOwnershipIdentifierName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{domainOwnershipIdentifierName}', encodeURIComponent(domainOwnershipIdentifierName)); + requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'PUT'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (domainOwnershipIdentifier !== null && domainOwnershipIdentifier !== undefined) { + let requestModelMapper = new client.models['Identifier']().mapper(); + requestModel = client.serialize(requestModelMapper, domainOwnershipIdentifier, 'domainOwnershipIdentifier'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(domainOwnershipIdentifier, 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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['Identifier']().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 Deletes a domain ownership identifier for a web app. + * + * Deletes a domain ownership identifier for a web app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} domainOwnershipIdentifierName Name of domain ownership + * identifier. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will delete the binding for the production slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _deleteDomainOwnershipIdentifierSlot(resourceGroupName, name, domainOwnershipIdentifierName, slot, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (domainOwnershipIdentifierName === null || domainOwnershipIdentifierName === undefined || typeof domainOwnershipIdentifierName.valueOf() !== 'string') { + throw new Error('domainOwnershipIdentifierName cannot be null or undefined and it must be of type string.'); + } + if (slot === null || slot === undefined || typeof slot.valueOf() !== 'string') { + throw new Error('slot cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/domainOwnershipIdentifiers/{domainOwnershipIdentifierName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{domainOwnershipIdentifierName}', encodeURIComponent(domainOwnershipIdentifierName)); + requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'DELETE'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 204) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + + return callback(null, result, httpRequest, response); + }); +} + +/** + * @summary Creates a domain ownership identifier for web app, or updates an + * existing ownership identifier. + * + * Creates a domain ownership identifier for web app, or updates an existing + * ownership identifier. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} domainOwnershipIdentifierName Name of domain ownership + * identifier. + * + * @param {object} domainOwnershipIdentifier A JSON representation of the + * domain ownership properties. + * + * @param {string} [domainOwnershipIdentifier.identifierId] String + * representation of the identity. + * + * @param {string} [domainOwnershipIdentifier.kind] Kind of resource. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will delete the binding for the production slot. + * + * @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 Identifier} 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 _updateDomainOwnershipIdentifierSlot(resourceGroupName, name, domainOwnershipIdentifierName, domainOwnershipIdentifier, slot, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (domainOwnershipIdentifierName === null || domainOwnershipIdentifierName === undefined || typeof domainOwnershipIdentifierName.valueOf() !== 'string') { + throw new Error('domainOwnershipIdentifierName cannot be null or undefined and it must be of type string.'); + } + if (domainOwnershipIdentifier === null || domainOwnershipIdentifier === undefined) { + throw new Error('domainOwnershipIdentifier cannot be null or undefined.'); + } + if (slot === null || slot === undefined || typeof slot.valueOf() !== 'string') { + throw new Error('slot cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/domainOwnershipIdentifiers/{domainOwnershipIdentifierName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{domainOwnershipIdentifierName}', encodeURIComponent(domainOwnershipIdentifierName)); + requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'PATCH'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (domainOwnershipIdentifier !== null && domainOwnershipIdentifier !== undefined) { + let requestModelMapper = new client.models['Identifier']().mapper(); + requestModel = client.serialize(requestModelMapper, domainOwnershipIdentifier, 'domainOwnershipIdentifier'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(domainOwnershipIdentifier, 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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['Identifier']().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 Get the status of the last MSDeploy operation. + * + * Get the status of the last MSDeploy operation. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {string} slot Name of web app slot. If not specified then will + * default to production slot. + * + * @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 MSDeployStatus} 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 _getMSDeployStatusSlot(resourceGroupName, name, slot, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (slot === null || slot === undefined || typeof slot.valueOf() !== 'string') { + throw new Error('slot cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/extensions/MSDeploy'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['MSDeployStatus']().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 Invoke the MSDeploy web app extension. + * + * Invoke the MSDeploy web app extension. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {string} slot Name of web app slot. If not specified then will + * default to production slot. + * + * @param {object} mSDeploy Details of MSDeploy operation + * + * @param {string} [mSDeploy.packageUri] Package URI + * + * @param {string} [mSDeploy.connectionString] SQL Connection String + * + * @param {string} [mSDeploy.dbType] Database Type + * + * @param {string} [mSDeploy.setParametersXmlFileUri] URI of MSDeploy + * Parameters file. Must not be set if SetParameters is used. + * + * @param {object} [mSDeploy.setParameters] MSDeploy Parameters. Must not be + * set if SetParametersXmlFileUri is used. + * + * @param {boolean} [mSDeploy.skipAppData] Controls whether the MSDeploy + * operation skips the App_Data directory. + * If set to true, the existing App_Data directory on the + * destination + * will not be deleted, and any App_Data directory in the source will be + * ignored. + * Setting is false by default. + * + * @param {boolean} [mSDeploy.appOffline] Sets the AppOffline rule while the + * MSDeploy operation executes. + * Setting is false by default. + * + * @param {string} [mSDeploy.kind] Kind of resource. + * + * @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 MSDeployStatus} 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 _createMSDeployOperationSlot(resourceGroupName, name, slot, mSDeploy, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + + if (!callback) { + throw new Error('callback cannot be null.'); + } + + // Send request + this.beginCreateMSDeployOperationSlot(resourceGroupName, name, slot, mSDeploy, options, (err, parsedResult, httpRequest, response) => { + if (err) return callback(err); + + let initialResult = new msRest.HttpOperationResponse(); + initialResult.request = httpRequest; + initialResult.response = response; + initialResult.body = response.body; + client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { + if (err) return callback(err); + + // Create Result + let result = null; + + httpRequest = pollingResult.request; + response = pollingResult.response; + let responseBody = pollingResult.body; + if (responseBody === '') responseBody = null; + + // Deserialize Response + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['MSDeployStatus']().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 Get the MSDeploy Log for the last MSDeploy operation. + * + * Get the MSDeploy Log for the last MSDeploy operation. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {string} slot Name of web app slot. If not specified then will + * default to production slot. + * + * @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 MSDeployLog} 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 _getMSDeployLogSlot(resourceGroupName, name, slot, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (slot === null || slot === undefined || typeof slot.valueOf() !== 'string') { + throw new Error('slot cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/extensions/MSDeploy/log'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 404) { + 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['MSDeployLog']().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 List the functions for a web site, or a deployment slot. + * + * List the functions for a web site, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API deletes a deployment for the production slot. + * + * @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 FunctionEnvelopeCollection} 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 _listInstanceFunctionsSlot(resourceGroupName, name, slot, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (slot === null || slot === undefined || typeof slot.valueOf() !== 'string') { + throw new Error('slot cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/functions'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 404) { + 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['FunctionEnvelopeCollection']().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 Fetch a short lived token that can be exchanged for a master key. + * + * Fetch a short lived token that can be exchanged for a master key. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {string} slot Name of web app slot. If not specified then will + * default to production slot. + * + * @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. + * + * {string} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _getFunctionsAdminTokenSlot(resourceGroupName, name, slot, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (slot === null || slot === undefined || typeof slot.valueOf() !== 'string') { + throw new Error('slot cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/functions/admin/token'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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 = { + required: false, + serializedName: 'parsedResponse', + type: { + name: 'String' + } + }; + 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 Get function information by its ID for web site, or a deployment + * slot. + * + * Get function information by its ID for web site, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} functionName Function name. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API deletes a deployment for the production slot. + * + * @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 FunctionEnvelope} 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 _getInstanceFunctionSlot(resourceGroupName, name, functionName, slot, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (functionName === null || functionName === undefined || typeof functionName.valueOf() !== 'string') { + throw new Error('functionName cannot be null or undefined and it must be of type string.'); + } + if (slot === null || slot === undefined || typeof slot.valueOf() !== 'string') { + throw new Error('slot cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/functions/{functionName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{functionName}', encodeURIComponent(functionName)); + requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 404) { + 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['FunctionEnvelope']().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 Create function for web site, or a deployment slot. + * + * Create function for web site, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} functionName Function name. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API deletes a deployment for the production slot. + * + * @param {object} functionEnvelope Function details. + * + * @param {string} [functionEnvelope.functionAppId] Function App ID. + * + * @param {string} [functionEnvelope.scriptRootPathHref] Script root path URI. + * + * @param {string} [functionEnvelope.scriptHref] Script URI. + * + * @param {string} [functionEnvelope.configHref] Config URI. + * + * @param {string} [functionEnvelope.secretsFileHref] Secrets file URI. + * + * @param {string} [functionEnvelope.href] Function URI. + * + * @param {object} [functionEnvelope.config] Config information. + * + * @param {object} [functionEnvelope.files] File list. + * + * @param {string} [functionEnvelope.testData] Test data used when testing via + * the Azure Portal. + * + * @param {string} [functionEnvelope.kind] Kind of resource. + * + * @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 FunctionEnvelope} 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 _createInstanceFunctionSlot(resourceGroupName, name, functionName, slot, functionEnvelope, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + + if (!callback) { + throw new Error('callback cannot be null.'); + } + + // Send request + this.beginCreateInstanceFunctionSlot(resourceGroupName, name, functionName, slot, functionEnvelope, options, (err, parsedResult, httpRequest, response) => { + if (err) return callback(err); + + let initialResult = new msRest.HttpOperationResponse(); + initialResult.request = httpRequest; + initialResult.response = response; + initialResult.body = response.body; + client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { + if (err) return callback(err); + + // Create Result + let result = null; + + httpRequest = pollingResult.request; + response = pollingResult.response; + let responseBody = pollingResult.body; + if (responseBody === '') responseBody = null; + + // Deserialize Response + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['FunctionEnvelope']().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 Delete a function for web site, or a deployment slot. + * + * Delete a function for web site, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} functionName Function name. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API deletes a deployment for the production slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _deleteInstanceFunctionSlot(resourceGroupName, name, functionName, slot, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (functionName === null || functionName === undefined || typeof functionName.valueOf() !== 'string') { + throw new Error('functionName cannot be null or undefined and it must be of type string.'); + } + if (slot === null || slot === undefined || typeof slot.valueOf() !== 'string') { + throw new Error('slot cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/functions/{functionName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{functionName}', encodeURIComponent(functionName)); + requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'DELETE'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 204 && statusCode !== 404) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + + return callback(null, result, httpRequest, response); + }); +} + +/** + * @summary Get function secrets for a function in a web site, or a deployment + * slot. + * + * Get function secrets for a function in a web site, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} functionName Function name. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API deletes a deployment for the production slot. + * + * @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 FunctionSecrets} 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 _listFunctionSecretsSlot(resourceGroupName, name, functionName, slot, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (functionName === null || functionName === undefined || typeof functionName.valueOf() !== 'string') { + throw new Error('functionName cannot be null or undefined and it must be of type string.'); + } + if (slot === null || slot === undefined || typeof slot.valueOf() !== 'string') { + throw new Error('slot cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/functions/{functionName}/listsecrets'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{functionName}', encodeURIComponent(functionName)); + requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); + 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]; + } + } + } + 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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['FunctionSecrets']().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 Get hostname bindings for an app or a deployment slot. + * + * Get hostname bindings for an app or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API gets hostname bindings for the production slot. + * + * @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 HostNameBindingCollection} 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 _listHostNameBindingsSlot(resourceGroupName, name, slot, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (slot === null || slot === undefined || typeof slot.valueOf() !== 'string') { + throw new Error('slot cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hostNameBindings'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['HostNameBindingCollection']().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 Get the named hostname binding for an app (or deployment slot, if + * specified). + * + * Get the named hostname binding for an app (or deployment slot, if + * specified). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API the named binding for the production slot. + * + * @param {string} hostName Hostname in the hostname binding. + * + * @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 HostNameBinding} 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 _getHostNameBindingSlot(resourceGroupName, name, slot, hostName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (slot === null || slot === undefined || typeof slot.valueOf() !== 'string') { + throw new Error('slot cannot be null or undefined and it must be of type string.'); + } + if (hostName === null || hostName === undefined || typeof hostName.valueOf() !== 'string') { + throw new Error('hostName cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hostNameBindings/{hostName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); + requestUrl = requestUrl.replace('{hostName}', encodeURIComponent(hostName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['HostNameBinding']().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 Creates a hostname binding for an app. + * + * Creates a hostname binding for an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} hostName Hostname in the hostname binding. + * + * @param {object} hostNameBinding Binding details. This is the JSON + * representation of a HostNameBinding object. + * + * @param {string} [hostNameBinding.siteName] App Service app name. + * + * @param {string} [hostNameBinding.domainId] Fully qualified ARM domain + * resource URI. + * + * @param {string} [hostNameBinding.azureResourceName] Azure resource name. + * + * @param {string} [hostNameBinding.azureResourceType] Azure resource type. + * Possible values include: 'Website', 'TrafficManager' + * + * @param {string} [hostNameBinding.customHostNameDnsRecordType] Custom DNS + * record type. Possible values include: 'CName', 'A' + * + * @param {string} [hostNameBinding.hostNameType] Hostname type. Possible + * values include: 'Verified', 'Managed' + * + * @param {string} [hostNameBinding.sslState] SSL type. Possible values + * include: 'Disabled', 'SniEnabled', 'IpBasedEnabled' + * + * @param {string} [hostNameBinding.thumbprint] SSL certificate thumbprint + * + * @param {string} [hostNameBinding.kind] Kind of resource. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will create a binding for the production slot. + * + * @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 HostNameBinding} 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 _createOrUpdateHostNameBindingSlot(resourceGroupName, name, hostName, hostNameBinding, slot, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (hostName === null || hostName === undefined || typeof hostName.valueOf() !== 'string') { + throw new Error('hostName cannot be null or undefined and it must be of type string.'); + } + if (hostNameBinding === null || hostNameBinding === undefined) { + throw new Error('hostNameBinding cannot be null or undefined.'); + } + if (slot === null || slot === undefined || typeof slot.valueOf() !== 'string') { + throw new Error('slot cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hostNameBindings/{hostName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{hostName}', encodeURIComponent(hostName)); + requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'PUT'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (hostNameBinding !== null && hostNameBinding !== undefined) { + let requestModelMapper = new client.models['HostNameBinding']().mapper(); + requestModel = client.serialize(requestModelMapper, hostNameBinding, 'hostNameBinding'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(hostNameBinding, 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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['HostNameBinding']().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 Deletes a hostname binding for an app. + * + * Deletes a hostname binding for an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will delete the binding for the production slot. + * + * @param {string} hostName Hostname in the hostname binding. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _deleteHostNameBindingSlot(resourceGroupName, name, slot, hostName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (slot === null || slot === undefined || typeof slot.valueOf() !== 'string') { + throw new Error('slot cannot be null or undefined and it must be of type string.'); + } + if (hostName === null || hostName === undefined || typeof hostName.valueOf() !== 'string') { + throw new Error('hostName cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hostNameBindings/{hostName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); + requestUrl = requestUrl.replace('{hostName}', encodeURIComponent(hostName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'DELETE'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 204) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + + return callback(null, result, httpRequest, response); + }); +} + +/** + * @summary Retrieves a specific Service Bus Hybrid Connection used by this Web + * App. + * + * Retrieves a specific Service Bus Hybrid Connection used by this Web App. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @param {string} namespaceName The namespace for this hybrid connection. + * + * @param {string} relayName The relay name for this hybrid connection. + * + * @param {string} slot The name of the slot for the web app. + * + * @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 HybridConnection} 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 _getHybridConnectionSlot(resourceGroupName, name, namespaceName, relayName, slot, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (namespaceName === null || namespaceName === undefined || typeof namespaceName.valueOf() !== 'string') { + throw new Error('namespaceName cannot be null or undefined and it must be of type string.'); + } + if (relayName === null || relayName === undefined || typeof relayName.valueOf() !== 'string') { + throw new Error('relayName cannot be null or undefined and it must be of type string.'); + } + if (slot === null || slot === undefined || typeof slot.valueOf() !== 'string') { + throw new Error('slot cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{namespaceName}', encodeURIComponent(namespaceName)); + requestUrl = requestUrl.replace('{relayName}', encodeURIComponent(relayName)); + requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['HybridConnection']().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 Creates a new Hybrid Connection using a Service Bus relay. + * + * Creates a new Hybrid Connection using a Service Bus relay. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @param {string} namespaceName The namespace for this hybrid connection. + * + * @param {string} relayName The relay name for this hybrid connection. + * + * @param {object} connectionEnvelope The details of the hybrid connection. + * + * @param {string} [connectionEnvelope.serviceBusNamespace] The name of the + * Service Bus namespace. + * + * @param {string} [connectionEnvelope.relayName] The name of the Service Bus + * relay. + * + * @param {string} [connectionEnvelope.relayArmUri] The ARM URI to the Service + * Bus relay. + * + * @param {string} [connectionEnvelope.hostname] The hostname of the endpoint. + * + * @param {number} [connectionEnvelope.port] The port of the endpoint. + * + * @param {string} [connectionEnvelope.sendKeyName] The name of the Service Bus + * key which has Send permissions. This is used to authenticate to Service Bus. + * + * @param {string} [connectionEnvelope.sendKeyValue] The value of the Service + * Bus key. This is used to authenticate to Service Bus. In ARM this key will + * not be returned + * normally, use the POST /listKeys API instead. + * + * @param {string} [connectionEnvelope.serviceBusSuffix] The suffix for the + * service bus endpoint. By default this is .servicebus.windows.net + * + * @param {string} [connectionEnvelope.kind] Kind of resource. + * + * @param {string} slot The name of the slot for the web app. + * + * @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 HybridConnection} 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 _createOrUpdateHybridConnectionSlot(resourceGroupName, name, namespaceName, relayName, connectionEnvelope, slot, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (namespaceName === null || namespaceName === undefined || typeof namespaceName.valueOf() !== 'string') { + throw new Error('namespaceName cannot be null or undefined and it must be of type string.'); + } + if (relayName === null || relayName === undefined || typeof relayName.valueOf() !== 'string') { + throw new Error('relayName cannot be null or undefined and it must be of type string.'); + } + if (connectionEnvelope === null || connectionEnvelope === undefined) { + throw new Error('connectionEnvelope cannot be null or undefined.'); + } + if (slot === null || slot === undefined || typeof slot.valueOf() !== 'string') { + throw new Error('slot cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{namespaceName}', encodeURIComponent(namespaceName)); + requestUrl = requestUrl.replace('{relayName}', encodeURIComponent(relayName)); + requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'PUT'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (connectionEnvelope !== null && connectionEnvelope !== undefined) { + let requestModelMapper = new client.models['HybridConnection']().mapper(); + requestModel = client.serialize(requestModelMapper, connectionEnvelope, 'connectionEnvelope'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(connectionEnvelope, 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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['HybridConnection']().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 Removes a Hybrid Connection from this site. + * + * Removes a Hybrid Connection from this site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @param {string} namespaceName The namespace for this hybrid connection. + * + * @param {string} relayName The relay name for this hybrid connection. + * + * @param {string} slot The name of the slot for the web app. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _deleteHybridConnectionSlot(resourceGroupName, name, namespaceName, relayName, slot, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (namespaceName === null || namespaceName === undefined || typeof namespaceName.valueOf() !== 'string') { + throw new Error('namespaceName cannot be null or undefined and it must be of type string.'); + } + if (relayName === null || relayName === undefined || typeof relayName.valueOf() !== 'string') { + throw new Error('relayName cannot be null or undefined and it must be of type string.'); + } + if (slot === null || slot === undefined || typeof slot.valueOf() !== 'string') { + throw new Error('slot cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{namespaceName}', encodeURIComponent(namespaceName)); + requestUrl = requestUrl.replace('{relayName}', encodeURIComponent(relayName)); + requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'DELETE'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 404) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + + return callback(null, result, httpRequest, response); + }); +} + +/** + * @summary Creates a new Hybrid Connection using a Service Bus relay. + * + * Creates a new Hybrid Connection using a Service Bus relay. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @param {string} namespaceName The namespace for this hybrid connection. + * + * @param {string} relayName The relay name for this hybrid connection. + * + * @param {object} connectionEnvelope The details of the hybrid connection. + * + * @param {string} [connectionEnvelope.serviceBusNamespace] The name of the + * Service Bus namespace. + * + * @param {string} [connectionEnvelope.relayName] The name of the Service Bus + * relay. + * + * @param {string} [connectionEnvelope.relayArmUri] The ARM URI to the Service + * Bus relay. + * + * @param {string} [connectionEnvelope.hostname] The hostname of the endpoint. + * + * @param {number} [connectionEnvelope.port] The port of the endpoint. + * + * @param {string} [connectionEnvelope.sendKeyName] The name of the Service Bus + * key which has Send permissions. This is used to authenticate to Service Bus. + * + * @param {string} [connectionEnvelope.sendKeyValue] The value of the Service + * Bus key. This is used to authenticate to Service Bus. In ARM this key will + * not be returned + * normally, use the POST /listKeys API instead. + * + * @param {string} [connectionEnvelope.serviceBusSuffix] The suffix for the + * service bus endpoint. By default this is .servicebus.windows.net + * + * @param {string} [connectionEnvelope.kind] Kind of resource. + * + * @param {string} slot The name of the slot for the web app. + * + * @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 HybridConnection} 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 _updateHybridConnectionSlot(resourceGroupName, name, namespaceName, relayName, connectionEnvelope, slot, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (namespaceName === null || namespaceName === undefined || typeof namespaceName.valueOf() !== 'string') { + throw new Error('namespaceName cannot be null or undefined and it must be of type string.'); + } + if (relayName === null || relayName === undefined || typeof relayName.valueOf() !== 'string') { + throw new Error('relayName cannot be null or undefined and it must be of type string.'); + } + if (connectionEnvelope === null || connectionEnvelope === undefined) { + throw new Error('connectionEnvelope cannot be null or undefined.'); + } + if (slot === null || slot === undefined || typeof slot.valueOf() !== 'string') { + throw new Error('slot cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{namespaceName}', encodeURIComponent(namespaceName)); + requestUrl = requestUrl.replace('{relayName}', encodeURIComponent(relayName)); + requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'PATCH'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (connectionEnvelope !== null && connectionEnvelope !== undefined) { + let requestModelMapper = new client.models['HybridConnection']().mapper(); + requestModel = client.serialize(requestModelMapper, connectionEnvelope, 'connectionEnvelope'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(connectionEnvelope, 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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['HybridConnection']().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 the send key name and value for a Hybrid Connection. + * + * Gets the send key name and value for a Hybrid Connection. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @param {string} namespaceName The namespace for this hybrid connection. + * + * @param {string} relayName The relay name for this hybrid connection. + * + * @param {string} slot The name of the slot for the web app. + * + * @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 HybridConnectionKey} 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 _listHybridConnectionKeysSlot(resourceGroupName, name, namespaceName, relayName, slot, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (namespaceName === null || namespaceName === undefined || typeof namespaceName.valueOf() !== 'string') { + throw new Error('namespaceName cannot be null or undefined and it must be of type string.'); + } + if (relayName === null || relayName === undefined || typeof relayName.valueOf() !== 'string') { + throw new Error('relayName cannot be null or undefined and it must be of type string.'); + } + if (slot === null || slot === undefined || typeof slot.valueOf() !== 'string') { + throw new Error('slot cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}/listKeys'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{namespaceName}', encodeURIComponent(namespaceName)); + requestUrl = requestUrl.replace('{relayName}', encodeURIComponent(relayName)); + requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); + 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]; + } + } + } + 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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['HybridConnectionKey']().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 Retrieves all Service Bus Hybrid Connections used by this Web App. + * + * Retrieves all Service Bus Hybrid Connections used by this Web App. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @param {string} slot The name of the slot for the web app. + * + * @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 HybridConnection} 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 _listHybridConnectionsSlot(resourceGroupName, name, slot, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (slot === null || slot === undefined || typeof slot.valueOf() !== 'string') { + throw new Error('slot cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hybridConnectionRelays'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['HybridConnection']().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 hybrid connections configured for an app (or deployment slot, + * if specified). + * + * Gets hybrid connections configured for an app (or deployment slot, if + * specified). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will get hybrid connections for the production slot. + * + * @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 RelayServiceConnectionEntity} 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 _listRelayServiceConnectionsSlot(resourceGroupName, name, slot, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (slot === null || slot === undefined || typeof slot.valueOf() !== 'string') { + throw new Error('slot cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hybridconnection'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['RelayServiceConnectionEntity']().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 hybrid connection configuration by its name. + * + * Gets a hybrid connection configuration by its name. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} entityName Name of the hybrid connection. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will get a hybrid connection for the production slot. + * + * @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 RelayServiceConnectionEntity} 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 _getRelayServiceConnectionSlot(resourceGroupName, name, entityName, slot, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (entityName === null || entityName === undefined || typeof entityName.valueOf() !== 'string') { + throw new Error('entityName cannot be null or undefined and it must be of type string.'); + } + if (slot === null || slot === undefined || typeof slot.valueOf() !== 'string') { + throw new Error('slot cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hybridconnection/{entityName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{entityName}', encodeURIComponent(entityName)); + requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['RelayServiceConnectionEntity']().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 Creates a new hybrid connection configuration (PUT), or updates an + * existing one (PATCH). + * + * Creates a new hybrid connection configuration (PUT), or updates an existing + * one (PATCH). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} entityName Name of the hybrid connection configuration. + * + * @param {object} connectionEnvelope Details of the hybrid connection + * configuration. + * + * @param {string} [connectionEnvelope.entityName] + * + * @param {string} [connectionEnvelope.entityConnectionString] + * + * @param {string} [connectionEnvelope.resourceType] + * + * @param {string} [connectionEnvelope.resourceConnectionString] + * + * @param {string} [connectionEnvelope.hostname] + * + * @param {number} [connectionEnvelope.port] + * + * @param {string} [connectionEnvelope.biztalkUri] + * + * @param {string} [connectionEnvelope.kind] Kind of resource. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will create or update a hybrid connection for the + * production slot. + * + * @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 RelayServiceConnectionEntity} 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 _createOrUpdateRelayServiceConnectionSlot(resourceGroupName, name, entityName, connectionEnvelope, slot, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (entityName === null || entityName === undefined || typeof entityName.valueOf() !== 'string') { + throw new Error('entityName cannot be null or undefined and it must be of type string.'); + } + if (connectionEnvelope === null || connectionEnvelope === undefined) { + throw new Error('connectionEnvelope cannot be null or undefined.'); + } + if (slot === null || slot === undefined || typeof slot.valueOf() !== 'string') { + throw new Error('slot cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hybridconnection/{entityName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{entityName}', encodeURIComponent(entityName)); + requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'PUT'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (connectionEnvelope !== null && connectionEnvelope !== undefined) { + let requestModelMapper = new client.models['RelayServiceConnectionEntity']().mapper(); + requestModel = client.serialize(requestModelMapper, connectionEnvelope, 'connectionEnvelope'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(connectionEnvelope, 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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['RelayServiceConnectionEntity']().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 Deletes a relay service connection by its name. + * + * Deletes a relay service connection by its name. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} entityName Name of the hybrid connection configuration. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will delete a hybrid connection for the production slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _deleteRelayServiceConnectionSlot(resourceGroupName, name, entityName, slot, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (entityName === null || entityName === undefined || typeof entityName.valueOf() !== 'string') { + throw new Error('entityName cannot be null or undefined and it must be of type string.'); + } + if (slot === null || slot === undefined || typeof slot.valueOf() !== 'string') { + throw new Error('slot cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hybridconnection/{entityName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{entityName}', encodeURIComponent(entityName)); + requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'DELETE'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 404) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + + return callback(null, result, httpRequest, response); + }); +} + +/** + * @summary Creates a new hybrid connection configuration (PUT), or updates an + * existing one (PATCH). + * + * Creates a new hybrid connection configuration (PUT), or updates an existing + * one (PATCH). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} entityName Name of the hybrid connection configuration. + * + * @param {object} connectionEnvelope Details of the hybrid connection + * configuration. + * + * @param {string} [connectionEnvelope.entityName] + * + * @param {string} [connectionEnvelope.entityConnectionString] + * + * @param {string} [connectionEnvelope.resourceType] + * + * @param {string} [connectionEnvelope.resourceConnectionString] + * + * @param {string} [connectionEnvelope.hostname] + * + * @param {number} [connectionEnvelope.port] + * + * @param {string} [connectionEnvelope.biztalkUri] + * + * @param {string} [connectionEnvelope.kind] Kind of resource. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will create or update a hybrid connection for the + * production slot. + * + * @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 RelayServiceConnectionEntity} 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 _updateRelayServiceConnectionSlot(resourceGroupName, name, entityName, connectionEnvelope, slot, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (entityName === null || entityName === undefined || typeof entityName.valueOf() !== 'string') { + throw new Error('entityName cannot be null or undefined and it must be of type string.'); + } + if (connectionEnvelope === null || connectionEnvelope === undefined) { + throw new Error('connectionEnvelope cannot be null or undefined.'); + } + if (slot === null || slot === undefined || typeof slot.valueOf() !== 'string') { + throw new Error('slot cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hybridconnection/{entityName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{entityName}', encodeURIComponent(entityName)); + requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'PATCH'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (connectionEnvelope !== null && connectionEnvelope !== undefined) { + let requestModelMapper = new client.models['RelayServiceConnectionEntity']().mapper(); + requestModel = client.serialize(requestModelMapper, connectionEnvelope, 'connectionEnvelope'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(connectionEnvelope, 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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['RelayServiceConnectionEntity']().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 all scale-out instances of an app. + * + * Gets all scale-out instances of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API gets the production slot instances. + * + * @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 WebAppInstanceCollection} 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 _listInstanceIdentifiersSlot(resourceGroupName, name, slot, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (slot === null || slot === undefined || typeof slot.valueOf() !== 'string') { + throw new Error('slot cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['WebAppInstanceCollection']().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 Get the status of the last MSDeploy operation. + * + * Get the status of the last MSDeploy operation. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {string} slot Name of web app slot. If not specified then will + * default to production slot. + * + * @param {string} instanceId ID of web app instance. + * + * @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 MSDeployStatus} 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 _getInstanceMsDeployStatusSlot(resourceGroupName, name, slot, instanceId, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (slot === null || slot === undefined || typeof slot.valueOf() !== 'string') { + throw new Error('slot cannot be null or undefined and it must be of type string.'); + } + if (instanceId === null || instanceId === undefined || typeof instanceId.valueOf() !== 'string') { + throw new Error('instanceId cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances/{instanceId}/extensions/MSDeploy'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); + requestUrl = requestUrl.replace('{instanceId}', encodeURIComponent(instanceId)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['MSDeployStatus']().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 Invoke the MSDeploy web app extension. + * + * Invoke the MSDeploy web app extension. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {string} slot Name of web app slot. If not specified then will + * default to production slot. + * + * @param {string} instanceId ID of web app instance. + * + * @param {object} mSDeploy Details of MSDeploy operation + * + * @param {string} [mSDeploy.packageUri] Package URI + * + * @param {string} [mSDeploy.connectionString] SQL Connection String + * + * @param {string} [mSDeploy.dbType] Database Type + * + * @param {string} [mSDeploy.setParametersXmlFileUri] URI of MSDeploy + * Parameters file. Must not be set if SetParameters is used. + * + * @param {object} [mSDeploy.setParameters] MSDeploy Parameters. Must not be + * set if SetParametersXmlFileUri is used. + * + * @param {boolean} [mSDeploy.skipAppData] Controls whether the MSDeploy + * operation skips the App_Data directory. + * If set to true, the existing App_Data directory on the + * destination + * will not be deleted, and any App_Data directory in the source will be + * ignored. + * Setting is false by default. + * + * @param {boolean} [mSDeploy.appOffline] Sets the AppOffline rule while the + * MSDeploy operation executes. + * Setting is false by default. + * + * @param {string} [mSDeploy.kind] Kind of resource. + * + * @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 MSDeployStatus} 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 _createInstanceMSDeployOperationSlot(resourceGroupName, name, slot, instanceId, mSDeploy, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + + if (!callback) { + throw new Error('callback cannot be null.'); + } + + // Send request + this.beginCreateInstanceMSDeployOperationSlot(resourceGroupName, name, slot, instanceId, mSDeploy, options, (err, parsedResult, httpRequest, response) => { + if (err) return callback(err); + + let initialResult = new msRest.HttpOperationResponse(); + initialResult.request = httpRequest; + initialResult.response = response; + initialResult.body = response.body; + client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { + if (err) return callback(err); + + // Create Result + let result = null; + + httpRequest = pollingResult.request; + response = pollingResult.response; + let responseBody = pollingResult.body; + if (responseBody === '') responseBody = null; + + // Deserialize Response + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['MSDeployStatus']().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 Get the MSDeploy Log for the last MSDeploy operation. + * + * Get the MSDeploy Log for the last MSDeploy operation. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {string} slot Name of web app slot. If not specified then will + * default to production slot. + * + * @param {string} instanceId ID of web app instance. + * + * @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 MSDeployLog} 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 _getInstanceMSDeployLogSlot(resourceGroupName, name, slot, instanceId, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (slot === null || slot === undefined || typeof slot.valueOf() !== 'string') { + throw new Error('slot cannot be null or undefined and it must be of type string.'); + } + if (instanceId === null || instanceId === undefined || typeof instanceId.valueOf() !== 'string') { + throw new Error('instanceId cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances/{instanceId}/extensions/MSDeploy/log'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); + requestUrl = requestUrl.replace('{instanceId}', encodeURIComponent(instanceId)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 404) { + 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['MSDeployLog']().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 Get list of processes for a web site, or a deployment slot, or for + * a specific scaled-out instance in a web site. + * + * Get list of processes for a web site, or a deployment slot, or for a + * specific scaled-out instance in a web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API returns deployments for the production slot. + * + * @param {string} instanceId ID of a specific scaled-out instance. This is the + * value of the name property in the JSON response from "GET + * api/sites/{siteName}/instances". + * + * @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 ProcessInfoCollection} 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 _listInstanceProcessesSlot(resourceGroupName, name, slot, instanceId, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (slot === null || slot === undefined || typeof slot.valueOf() !== 'string') { + throw new Error('slot cannot be null or undefined and it must be of type string.'); + } + if (instanceId === null || instanceId === undefined || typeof instanceId.valueOf() !== 'string') { + throw new Error('instanceId cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances/{instanceId}/processes'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); + requestUrl = requestUrl.replace('{instanceId}', encodeURIComponent(instanceId)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 404) { + 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['ProcessInfoCollection']().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 Get process information by its ID for a specific scaled-out + * instance in a web site. + * + * Get process information by its ID for a specific scaled-out instance in a + * web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API returns deployments for the production slot. + * + * @param {string} instanceId ID of a specific scaled-out instance. This is the + * value of the name property in the JSON response from "GET + * api/sites/{siteName}/instances". + * + * @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 ProcessInfo} 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 _getInstanceProcessSlot(resourceGroupName, name, processId, slot, instanceId, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (processId === null || processId === undefined || typeof processId.valueOf() !== 'string') { + throw new Error('processId cannot be null or undefined and it must be of type string.'); + } + if (slot === null || slot === undefined || typeof slot.valueOf() !== 'string') { + throw new Error('slot cannot be null or undefined and it must be of type string.'); + } + if (instanceId === null || instanceId === undefined || typeof instanceId.valueOf() !== 'string') { + throw new Error('instanceId cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances/{instanceId}/processes/{processId}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{processId}', encodeURIComponent(processId)); + requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); + requestUrl = requestUrl.replace('{instanceId}', encodeURIComponent(instanceId)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 404) { + 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['ProcessInfo']().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 Terminate a process by its ID for a web site, or a deployment slot, + * or specific scaled-out instance in a web site. + * + * Terminate a process by its ID for a web site, or a deployment slot, or + * specific scaled-out instance in a web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API returns deployments for the production slot. + * + * @param {string} instanceId ID of a specific scaled-out instance. This is the + * value of the name property in the JSON response from "GET + * api/sites/{siteName}/instances". + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _deleteInstanceProcessSlot(resourceGroupName, name, processId, slot, instanceId, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (processId === null || processId === undefined || typeof processId.valueOf() !== 'string') { + throw new Error('processId cannot be null or undefined and it must be of type string.'); + } + if (slot === null || slot === undefined || typeof slot.valueOf() !== 'string') { + throw new Error('slot cannot be null or undefined and it must be of type string.'); + } + if (instanceId === null || instanceId === undefined || typeof instanceId.valueOf() !== 'string') { + throw new Error('instanceId cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances/{instanceId}/processes/{processId}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{processId}', encodeURIComponent(processId)); + requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); + requestUrl = requestUrl.replace('{instanceId}', encodeURIComponent(instanceId)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'DELETE'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 204 && statusCode !== 404) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + + return callback(null, result, httpRequest, response); + }); +} + +/** + * @summary Get a memory dump of a process by its ID for a specific scaled-out + * instance in a web site. + * + * Get a memory dump of a process by its ID for a specific scaled-out instance + * in a web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API returns deployments for the production slot. + * + * @param {string} instanceId ID of a specific scaled-out instance. This is the + * value of the name property in the JSON response from "GET + * api/sites/{siteName}/instances". + * + * @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. + * + * {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 _getInstanceProcessDumpSlot(resourceGroupName, name, processId, slot, instanceId, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (processId === null || processId === undefined || typeof processId.valueOf() !== 'string') { + throw new Error('processId cannot be null or undefined and it must be of type string.'); + } + if (slot === null || slot === undefined || typeof slot.valueOf() !== 'string') { + throw new Error('slot cannot be null or undefined and it must be of type string.'); + } + if (instanceId === null || instanceId === undefined || typeof instanceId.valueOf() !== 'string') { + throw new Error('instanceId cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances/{instanceId}/processes/{processId}/dump'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{processId}', encodeURIComponent(processId)); + requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); + requestUrl = requestUrl.replace('{instanceId}', encodeURIComponent(instanceId)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + httpRequest.streamedResponse = true; + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 404) { + let error = new Error(`Unexpected status code: ${statusCode}`); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + if (responseBody !== undefined) 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 = response; + return callback(null, result, httpRequest, response); + }); +} + +/** + * @summary List module information for a process by its ID for a specific + * scaled-out instance in a web site. + * + * List module information for a process by its ID for a specific scaled-out + * instance in a web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API returns deployments for the production slot. + * + * @param {string} instanceId ID of a specific scaled-out instance. This is the + * value of the name property in the JSON response from "GET + * api/sites/{siteName}/instances". + * + * @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 ProcessModuleInfoCollection} 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 _listInstanceProcessModulesSlot(resourceGroupName, name, processId, slot, instanceId, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (processId === null || processId === undefined || typeof processId.valueOf() !== 'string') { + throw new Error('processId cannot be null or undefined and it must be of type string.'); + } + if (slot === null || slot === undefined || typeof slot.valueOf() !== 'string') { + throw new Error('slot cannot be null or undefined and it must be of type string.'); + } + if (instanceId === null || instanceId === undefined || typeof instanceId.valueOf() !== 'string') { + throw new Error('instanceId cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances/{instanceId}/processes/{processId}/modules'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{processId}', encodeURIComponent(processId)); + requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); + requestUrl = requestUrl.replace('{instanceId}', encodeURIComponent(instanceId)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 404) { + 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['ProcessModuleInfoCollection']().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 Get process information by its ID for a specific scaled-out + * instance in a web site. + * + * Get process information by its ID for a specific scaled-out instance in a + * web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @param {string} baseAddress Module base address. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API returns deployments for the production slot. + * + * @param {string} instanceId ID of a specific scaled-out instance. This is the + * value of the name property in the JSON response from "GET + * api/sites/{siteName}/instances". + * + * @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 ProcessModuleInfo} 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 _getInstanceProcessModuleSlot(resourceGroupName, name, processId, baseAddress, slot, instanceId, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (processId === null || processId === undefined || typeof processId.valueOf() !== 'string') { + throw new Error('processId cannot be null or undefined and it must be of type string.'); + } + if (baseAddress === null || baseAddress === undefined || typeof baseAddress.valueOf() !== 'string') { + throw new Error('baseAddress cannot be null or undefined and it must be of type string.'); + } + if (slot === null || slot === undefined || typeof slot.valueOf() !== 'string') { + throw new Error('slot cannot be null or undefined and it must be of type string.'); + } + if (instanceId === null || instanceId === undefined || typeof instanceId.valueOf() !== 'string') { + throw new Error('instanceId cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances/{instanceId}/processes/{processId}/modules/{baseAddress}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{processId}', encodeURIComponent(processId)); + requestUrl = requestUrl.replace('{baseAddress}', encodeURIComponent(baseAddress)); + requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); + requestUrl = requestUrl.replace('{instanceId}', encodeURIComponent(instanceId)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 404) { + 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['ProcessModuleInfo']().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 List the threads in a process by its ID for a specific scaled-out + * instance in a web site. + * + * List the threads in a process by its ID for a specific scaled-out instance + * in a web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API returns deployments for the production slot. + * + * @param {string} instanceId ID of a specific scaled-out instance. This is the + * value of the name property in the JSON response from "GET + * api/sites/{siteName}/instances". + * + * @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 ProcessThreadInfoCollection} 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 _listInstanceProcessThreadsSlot(resourceGroupName, name, processId, slot, instanceId, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (processId === null || processId === undefined || typeof processId.valueOf() !== 'string') { + throw new Error('processId cannot be null or undefined and it must be of type string.'); + } + if (slot === null || slot === undefined || typeof slot.valueOf() !== 'string') { + throw new Error('slot cannot be null or undefined and it must be of type string.'); + } + if (instanceId === null || instanceId === undefined || typeof instanceId.valueOf() !== 'string') { + throw new Error('instanceId cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances/{instanceId}/processes/{processId}/threads'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{processId}', encodeURIComponent(processId)); + requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); + requestUrl = requestUrl.replace('{instanceId}', encodeURIComponent(instanceId)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 404) { + 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['ProcessThreadInfoCollection']().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 Get thread information by Thread ID for a specific process, in a + * specific scaled-out instance in a web site. + * + * Get thread information by Thread ID for a specific process, in a specific + * scaled-out instance in a web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @param {string} threadId TID. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API returns deployments for the production slot. + * + * @param {string} instanceId ID of a specific scaled-out instance. This is the + * value of the name property in the JSON response from "GET + * api/sites/{siteName}/instances". + * + * @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 ProcessThreadInfo} 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 _getInstanceProcessThreadSlot(resourceGroupName, name, processId, threadId, slot, instanceId, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (processId === null || processId === undefined || typeof processId.valueOf() !== 'string') { + throw new Error('processId cannot be null or undefined and it must be of type string.'); + } + if (threadId === null || threadId === undefined || typeof threadId.valueOf() !== 'string') { + throw new Error('threadId cannot be null or undefined and it must be of type string.'); + } + if (slot === null || slot === undefined || typeof slot.valueOf() !== 'string') { + throw new Error('slot cannot be null or undefined and it must be of type string.'); + } + if (instanceId === null || instanceId === undefined || typeof instanceId.valueOf() !== 'string') { + throw new Error('instanceId cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances/{instanceId}/processes/{processId}/threads/{threadId}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{processId}', encodeURIComponent(processId)); + requestUrl = requestUrl.replace('{threadId}', encodeURIComponent(threadId)); + requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); + requestUrl = requestUrl.replace('{instanceId}', encodeURIComponent(instanceId)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 404) { + 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['ProcessThreadInfo']().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 Shows whether an app can be cloned to another resource group or + * subscription. + * + * Shows whether an app can be cloned to another resource group or + * subscription. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. By default, this API + * returns information on the production slot. + * + * @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 SiteCloneability} 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 _isCloneableSlot(resourceGroupName, name, slot, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (slot === null || slot === undefined || typeof slot.valueOf() !== 'string') { + throw new Error('slot cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/iscloneable'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); + 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]; + } + } + } + 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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['SiteCloneability']().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 This is to allow calling via powershell and ARM template. + * + * This is to allow calling via powershell and ARM template. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will restore a backup of the production slot. + * + * @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 FunctionSecrets} 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 _listSyncFunctionTriggersSlot(resourceGroupName, name, slot, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (slot === null || slot === undefined || typeof slot.valueOf() !== 'string') { + throw new Error('slot cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/listsyncfunctiontriggerstatus'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); + 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]; + } + } + } + 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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['FunctionSecrets']().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 all metric definitions of an app (or deployment slot, if + * specified). + * + * Gets all metric definitions of an app (or deployment slot, if specified). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will get metric definitions of the production slot. + * + * @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 ResourceMetricDefinitionCollection} 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 _listMetricDefinitionsSlot(resourceGroupName, name, slot, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (slot === null || slot === undefined || typeof slot.valueOf() !== 'string') { + throw new Error('slot cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/metricdefinitions'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['ResourceMetricDefinitionCollection']().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 performance metrics of an app (or deployment slot, if + * specified). + * + * Gets performance metrics of an app (or deployment slot, if specified). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will get metrics of the production slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {boolean} [options.details] Specify "true" to include metric details + * in the response. It is "false" by default. + * + * @param {string} [options.filter] Return only metrics specified in the filter + * (using OData syntax). For example: $filter=(name.value eq 'Metric1' or + * name.value eq 'Metric2') and startTime eq 2014-01-01T00:00:00Z and endTime + * eq 2014-12-31T23:59:59Z and timeGrain eq duration'[Hour|Minute|Day]'. + * + * @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 ResourceMetricCollection} 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 _listMetricsSlot(resourceGroupName, name, slot, 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 details = (options && options.details !== undefined) ? options.details : undefined; + let filter = (options && options.filter !== undefined) ? options.filter : undefined; + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (slot === null || slot === undefined || typeof slot.valueOf() !== 'string') { + throw new Error('slot cannot be null or undefined and it must be of type string.'); + } + if (details !== null && details !== undefined && typeof details !== 'boolean') { + throw new Error('details must be of type boolean.'); + } + if (filter !== null && filter !== undefined && typeof filter.valueOf() !== 'string') { + throw new Error('filter must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/metrics'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + if (details !== null && details !== undefined) { + queryParameters.push('details=' + encodeURIComponent(details.toString())); + } + if (filter !== null && filter !== undefined) { + queryParameters.push('$filter=' + filter); + } + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['ResourceMetricCollection']().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 Returns the status of MySql in app migration, if one is active, and + * whether or not MySql in app is enabled + * + * Returns the status of MySql in app migration, if one is active, and whether + * or not MySql in app is enabled + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {string} slot Name of the deployment slot. + * + * @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 MigrateMySqlStatus} 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 _getMigrateMySqlStatusSlot(resourceGroupName, name, slot, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (slot === null || slot === undefined || typeof slot.valueOf() !== 'string') { + throw new Error('slot cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/migratemysql/status'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['MigrateMySqlStatus']().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 all network features used by the app (or deployment slot, if + * specified). + * + * Gets all network features used by the app (or deployment slot, if + * specified). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} view The type of view. This can either be "summary" or + * "detailed". + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will get network features for the production slot. + * + * @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 NetworkFeatures} 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 _listNetworkFeaturesSlot(resourceGroupName, name, view, slot, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (view === null || view === undefined || typeof view.valueOf() !== 'string') { + throw new Error('view cannot be null or undefined and it must be of type string.'); + } + if (slot === null || slot === undefined || typeof slot.valueOf() !== 'string') { + throw new Error('slot cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/networkFeatures/{view}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{view}', encodeURIComponent(view)); + requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 404) { + 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['NetworkFeatures']().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 Start capturing network packets for the site. + * + * Start capturing network packets for the site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @param {string} slot The name of the slot for this web app. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.durationInSeconds] The duration to keep capturing + * in seconds. + * + * @param {number} [options.maxFrameLength] The maximum frame length in bytes + * (Optional). + * + * @param {string} [options.sasUrl] The Blob URL to store capture file. + * + * @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. + * + * {string} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _startWebSiteNetworkTraceSlot(resourceGroupName, name, slot, 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 durationInSeconds = (options && options.durationInSeconds !== undefined) ? options.durationInSeconds : undefined; + let maxFrameLength = (options && options.maxFrameLength !== undefined) ? options.maxFrameLength : undefined; + let sasUrl = (options && options.sasUrl !== undefined) ? options.sasUrl : undefined; + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (durationInSeconds !== null && durationInSeconds !== undefined && typeof durationInSeconds !== 'number') { + throw new Error('durationInSeconds must be of type number.'); + } + if (slot === null || slot === undefined || typeof slot.valueOf() !== 'string') { + throw new Error('slot cannot be null or undefined and it must be of type string.'); + } + if (maxFrameLength !== null && maxFrameLength !== undefined && typeof maxFrameLength !== 'number') { + throw new Error('maxFrameLength must be of type number.'); + } + if (sasUrl !== null && sasUrl !== undefined && typeof sasUrl.valueOf() !== 'string') { + throw new Error('sasUrl must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/networkTrace/start'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + if (durationInSeconds !== null && durationInSeconds !== undefined) { + queryParameters.push('durationInSeconds=' + encodeURIComponent(durationInSeconds.toString())); + } + if (maxFrameLength !== null && maxFrameLength !== undefined) { + queryParameters.push('maxFrameLength=' + encodeURIComponent(maxFrameLength.toString())); + } + if (sasUrl !== null && sasUrl !== undefined) { + queryParameters.push('sasUrl=' + encodeURIComponent(sasUrl)); + } + 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]; + } + } + } + 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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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 = { + required: false, + serializedName: 'parsedResponse', + type: { + name: 'String' + } + }; + 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 Stop ongoing capturing network packets for the site. + * + * Stop ongoing capturing network packets for the site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @param {string} slot The name of the slot for this web app. + * + * @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. + * + * {string} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _stopWebSiteNetworkTraceSlot(resourceGroupName, name, slot, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (slot === null || slot === undefined || typeof slot.valueOf() !== 'string') { + throw new Error('slot cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/networkTrace/stop'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); + 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]; + } + } + } + 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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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 = { + required: false, + serializedName: 'parsedResponse', + type: { + name: 'String' + } + }; + 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 Generates a new publishing password for an app (or deployment slot, + * if specified). + * + * Generates a new publishing password for an app (or deployment slot, if + * specified). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API generate a new publishing password for the production + * slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _generateNewSitePublishingPasswordSlot(resourceGroupName, name, slot, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (slot === null || slot === undefined || typeof slot.valueOf() !== 'string') { + throw new Error('slot cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/newpassword'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); + 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]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 204) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + + return callback(null, result, httpRequest, response); + }); +} + +/** + * @summary Gets perfmon counters for web app. + * + * Gets perfmon counters for web app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {string} slot Name of web app slot. If not specified then will + * default to production slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.filter] Return only usages/metrics specified in the + * filter. Filter conforms to odata syntax. Example: $filter=(startTime eq + * 2014-01-01T00:00:00Z and endTime eq 2014-12-31T23:59:59Z and timeGrain eq + * duration'[Hour|Minute|Day]'. + * + * @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 PerfMonCounterCollection} 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 _listPerfMonCountersSlot(resourceGroupName, name, slot, 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 filter = (options && options.filter !== undefined) ? options.filter : undefined; + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (slot === null || slot === undefined || typeof slot.valueOf() !== 'string') { + throw new Error('slot cannot be null or undefined and it must be of type string.'); + } + if (filter !== null && filter !== undefined && typeof filter.valueOf() !== 'string') { + throw new Error('filter must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/perfcounters'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + if (filter !== null && filter !== undefined) { + queryParameters.push('$filter=' + filter); + } + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['PerfMonCounterCollection']().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 web app's event logs. + * + * Gets web app's event logs. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {string} slot Name of web app slot. If not specified then will + * default to production slot. + * + * @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 SitePhpErrorLogFlag} 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 _getSitePhpErrorLogFlagSlot(resourceGroupName, name, slot, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (slot === null || slot === undefined || typeof slot.valueOf() !== 'string') { + throw new Error('slot cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/phplogging'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['SitePhpErrorLogFlag']().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 the premier add-ons of an app. + * + * Gets the premier add-ons of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will get the premier add-ons for the production slot. + * + * @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 PremierAddOn} 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 _listPremierAddOnsSlot(resourceGroupName, name, slot, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (slot === null || slot === undefined || typeof slot.valueOf() !== 'string') { + throw new Error('slot cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/premieraddons'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['PremierAddOn']().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 named add-on of an app. + * + * Gets a named add-on of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} premierAddOnName Add-on name. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will get the named add-on for the production slot. + * + * @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 PremierAddOn} 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 _getPremierAddOnSlot(resourceGroupName, name, premierAddOnName, slot, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (premierAddOnName === null || premierAddOnName === undefined || typeof premierAddOnName.valueOf() !== 'string') { + throw new Error('premierAddOnName cannot be null or undefined and it must be of type string.'); + } + if (slot === null || slot === undefined || typeof slot.valueOf() !== 'string') { + throw new Error('slot cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/premieraddons/{premierAddOnName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{premierAddOnName}', encodeURIComponent(premierAddOnName)); + requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['PremierAddOn']().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 Updates a named add-on of an app. + * + * Updates a named add-on of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} premierAddOnName Add-on name. + * + * @param {object} premierAddOn A JSON representation of the edited premier + * add-on. + * + * @param {string} [premierAddOn.sku] Premier add on SKU. + * + * @param {string} [premierAddOn.product] Premier add on Product. + * + * @param {string} [premierAddOn.vendor] Premier add on Vendor. + * + * @param {string} [premierAddOn.marketplacePublisher] Premier add on + * Marketplace publisher. + * + * @param {string} [premierAddOn.marketplaceOffer] Premier add on Marketplace + * offer. + * + * @param {string} [premierAddOn.kind] Kind of resource. + * + * @param {string} premierAddOn.location Resource Location. + * + * @param {object} [premierAddOn.tags] Resource tags. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will update the named add-on for the production slot. + * + * @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 PremierAddOn} 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 _addPremierAddOnSlot(resourceGroupName, name, premierAddOnName, premierAddOn, slot, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (premierAddOnName === null || premierAddOnName === undefined || typeof premierAddOnName.valueOf() !== 'string') { + throw new Error('premierAddOnName cannot be null or undefined and it must be of type string.'); + } + if (premierAddOn === null || premierAddOn === undefined) { + throw new Error('premierAddOn cannot be null or undefined.'); + } + if (slot === null || slot === undefined || typeof slot.valueOf() !== 'string') { + throw new Error('slot cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/premieraddons/{premierAddOnName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{premierAddOnName}', encodeURIComponent(premierAddOnName)); + requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'PUT'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (premierAddOn !== null && premierAddOn !== undefined) { + let requestModelMapper = new client.models['PremierAddOn']().mapper(); + requestModel = client.serialize(requestModelMapper, premierAddOn, 'premierAddOn'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(premierAddOn, 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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['PremierAddOn']().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 Delete a premier add-on from an app. + * + * Delete a premier add-on from an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} premierAddOnName Add-on name. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will delete the named add-on for the production slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _deletePremierAddOnSlot(resourceGroupName, name, premierAddOnName, slot, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (premierAddOnName === null || premierAddOnName === undefined || typeof premierAddOnName.valueOf() !== 'string') { + throw new Error('premierAddOnName cannot be null or undefined and it must be of type string.'); + } + if (slot === null || slot === undefined || typeof slot.valueOf() !== 'string') { + throw new Error('slot cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/premieraddons/{premierAddOnName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{premierAddOnName}', encodeURIComponent(premierAddOnName)); + requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'DELETE'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + + return callback(null, result, httpRequest, response); + }); +} + +/** + * @summary Updates a named add-on of an app. + * + * Updates a named add-on of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} premierAddOnName Add-on name. + * + * @param {object} premierAddOn A JSON representation of the edited premier + * add-on. + * + * @param {string} [premierAddOn.sku] Premier add on SKU. + * + * @param {string} [premierAddOn.product] Premier add on Product. + * + * @param {string} [premierAddOn.vendor] Premier add on Vendor. + * + * @param {string} [premierAddOn.marketplacePublisher] Premier add on + * Marketplace publisher. + * + * @param {string} [premierAddOn.marketplaceOffer] Premier add on Marketplace + * offer. + * + * @param {string} [premierAddOn.kind] Kind of resource. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will update the named add-on for the production slot. + * + * @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 PremierAddOn} 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 _updatePremierAddOnSlot(resourceGroupName, name, premierAddOnName, premierAddOn, slot, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (premierAddOnName === null || premierAddOnName === undefined || typeof premierAddOnName.valueOf() !== 'string') { + throw new Error('premierAddOnName cannot be null or undefined and it must be of type string.'); + } + if (premierAddOn === null || premierAddOn === undefined) { + throw new Error('premierAddOn cannot be null or undefined.'); + } + if (slot === null || slot === undefined || typeof slot.valueOf() !== 'string') { + throw new Error('slot cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/premieraddons/{premierAddOnName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{premierAddOnName}', encodeURIComponent(premierAddOnName)); + requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'PATCH'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (premierAddOn !== null && premierAddOn !== undefined) { + let requestModelMapper = new client.models['PremierAddOnPatchResource']().mapper(); + requestModel = client.serialize(requestModelMapper, premierAddOn, 'premierAddOn'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(premierAddOn, 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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['PremierAddOn']().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 data around private site access enablement and authorized + * Virtual Networks that can access the site. + * + * Gets data around private site access enablement and authorized Virtual + * Networks that can access the site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @param {string} slot The name of the slot for the web app. + * + * @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 PrivateAccess} 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 _getPrivateAccessSlot(resourceGroupName, name, slot, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (slot === null || slot === undefined || typeof slot.valueOf() !== 'string') { + throw new Error('slot cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/privateAccess/virtualNetworks'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['PrivateAccess']().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 Sets data around private site access enablement and authorized + * Virtual Networks that can access the site. + * + * Sets data around private site access enablement and authorized Virtual + * Networks that can access the site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @param {object} access The information for the private access + * + * @param {boolean} [access.enabled] Whether private access is enabled or not. + * + * @param {array} [access.virtualNetworks] The Virtual Networks (and subnets) + * allowed to access the site privately. + * + * @param {string} [access.kind] Kind of resource. + * + * @param {string} slot The name of the slot for the web app. + * + * @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 PrivateAccess} 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 _putPrivateAccessVnetSlot(resourceGroupName, name, access, slot, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (access === null || access === undefined) { + throw new Error('access cannot be null or undefined.'); + } + if (slot === null || slot === undefined || typeof slot.valueOf() !== 'string') { + throw new Error('slot cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/privateAccess/virtualNetworks'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'PUT'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (access !== null && access !== undefined) { + let requestModelMapper = new client.models['PrivateAccess']().mapper(); + requestModel = client.serialize(requestModelMapper, access, 'access'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(access, 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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['PrivateAccess']().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 Get list of processes for a web site, or a deployment slot, or for + * a specific scaled-out instance in a web site. + * + * Get list of processes for a web site, or a deployment slot, or for a + * specific scaled-out instance in a web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API returns deployments for the production slot. + * + * @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 ProcessInfoCollection} 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 _listProcessesSlot(resourceGroupName, name, slot, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (slot === null || slot === undefined || typeof slot.valueOf() !== 'string') { + throw new Error('slot cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/processes'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 404) { + 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['ProcessInfoCollection']().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 Get process information by its ID for a specific scaled-out + * instance in a web site. + * + * Get process information by its ID for a specific scaled-out instance in a + * web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API returns deployments for the production slot. + * + * @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 ProcessInfo} 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 _getProcessSlot(resourceGroupName, name, processId, slot, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (processId === null || processId === undefined || typeof processId.valueOf() !== 'string') { + throw new Error('processId cannot be null or undefined and it must be of type string.'); + } + if (slot === null || slot === undefined || typeof slot.valueOf() !== 'string') { + throw new Error('slot cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/processes/{processId}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{processId}', encodeURIComponent(processId)); + requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 404) { + 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['ProcessInfo']().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 Terminate a process by its ID for a web site, or a deployment slot, + * or specific scaled-out instance in a web site. + * + * Terminate a process by its ID for a web site, or a deployment slot, or + * specific scaled-out instance in a web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API returns deployments for the production slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _deleteProcessSlot(resourceGroupName, name, processId, slot, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (processId === null || processId === undefined || typeof processId.valueOf() !== 'string') { + throw new Error('processId cannot be null or undefined and it must be of type string.'); + } + if (slot === null || slot === undefined || typeof slot.valueOf() !== 'string') { + throw new Error('slot cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/processes/{processId}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{processId}', encodeURIComponent(processId)); + requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'DELETE'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 204 && statusCode !== 404) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + + return callback(null, result, httpRequest, response); + }); +} + +/** + * @summary Get a memory dump of a process by its ID for a specific scaled-out + * instance in a web site. + * + * Get a memory dump of a process by its ID for a specific scaled-out instance + * in a web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API returns deployments for the production slot. + * + * @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. + * + * {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 _getProcessDumpSlot(resourceGroupName, name, processId, slot, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (processId === null || processId === undefined || typeof processId.valueOf() !== 'string') { + throw new Error('processId cannot be null or undefined and it must be of type string.'); + } + if (slot === null || slot === undefined || typeof slot.valueOf() !== 'string') { + throw new Error('slot cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/processes/{processId}/dump'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{processId}', encodeURIComponent(processId)); + requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + httpRequest.streamedResponse = true; + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 404) { + let error = new Error(`Unexpected status code: ${statusCode}`); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + if (responseBody !== undefined) 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 = response; + return callback(null, result, httpRequest, response); + }); +} + +/** + * @summary List module information for a process by its ID for a specific + * scaled-out instance in a web site. + * + * List module information for a process by its ID for a specific scaled-out + * instance in a web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API returns deployments for the production slot. + * + * @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 ProcessModuleInfoCollection} 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 _listProcessModulesSlot(resourceGroupName, name, processId, slot, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (processId === null || processId === undefined || typeof processId.valueOf() !== 'string') { + throw new Error('processId cannot be null or undefined and it must be of type string.'); + } + if (slot === null || slot === undefined || typeof slot.valueOf() !== 'string') { + throw new Error('slot cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/processes/{processId}/modules'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{processId}', encodeURIComponent(processId)); + requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 404) { + 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['ProcessModuleInfoCollection']().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 Get process information by its ID for a specific scaled-out + * instance in a web site. + * + * Get process information by its ID for a specific scaled-out instance in a + * web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @param {string} baseAddress Module base address. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API returns deployments for the production slot. + * + * @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 ProcessModuleInfo} 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 _getProcessModuleSlot(resourceGroupName, name, processId, baseAddress, slot, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (processId === null || processId === undefined || typeof processId.valueOf() !== 'string') { + throw new Error('processId cannot be null or undefined and it must be of type string.'); + } + if (baseAddress === null || baseAddress === undefined || typeof baseAddress.valueOf() !== 'string') { + throw new Error('baseAddress cannot be null or undefined and it must be of type string.'); + } + if (slot === null || slot === undefined || typeof slot.valueOf() !== 'string') { + throw new Error('slot cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/processes/{processId}/modules/{baseAddress}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{processId}', encodeURIComponent(processId)); + requestUrl = requestUrl.replace('{baseAddress}', encodeURIComponent(baseAddress)); + requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 404) { + 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['ProcessModuleInfo']().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 List the threads in a process by its ID for a specific scaled-out + * instance in a web site. + * + * List the threads in a process by its ID for a specific scaled-out instance + * in a web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API returns deployments for the production slot. + * + * @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 ProcessThreadInfoCollection} 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 _listProcessThreadsSlot(resourceGroupName, name, processId, slot, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (processId === null || processId === undefined || typeof processId.valueOf() !== 'string') { + throw new Error('processId cannot be null or undefined and it must be of type string.'); + } + if (slot === null || slot === undefined || typeof slot.valueOf() !== 'string') { + throw new Error('slot cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/processes/{processId}/threads'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{processId}', encodeURIComponent(processId)); + requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 404) { + 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['ProcessThreadInfoCollection']().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 Get thread information by Thread ID for a specific process, in a + * specific scaled-out instance in a web site. + * + * Get thread information by Thread ID for a specific process, in a specific + * scaled-out instance in a web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @param {string} threadId TID. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API returns deployments for the production slot. + * + * @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 ProcessThreadInfo} 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 _getProcessThreadSlot(resourceGroupName, name, processId, threadId, slot, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (processId === null || processId === undefined || typeof processId.valueOf() !== 'string') { + throw new Error('processId cannot be null or undefined and it must be of type string.'); + } + if (threadId === null || threadId === undefined || typeof threadId.valueOf() !== 'string') { + throw new Error('threadId cannot be null or undefined and it must be of type string.'); + } + if (slot === null || slot === undefined || typeof slot.valueOf() !== 'string') { + throw new Error('slot cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/processes/{processId}/threads/{threadId}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{processId}', encodeURIComponent(processId)); + requestUrl = requestUrl.replace('{threadId}', encodeURIComponent(threadId)); + requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 404) { + 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['ProcessThreadInfo']().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 Get public certificates for an app or a deployment slot. + * + * Get public certificates for an app or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API gets hostname bindings for the production slot. + * + * @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 PublicCertificateCollection} 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 _listPublicCertificatesSlot(resourceGroupName, name, slot, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (slot === null || slot === undefined || typeof slot.valueOf() !== 'string') { + throw new Error('slot cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/publicCertificates'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['PublicCertificateCollection']().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 Get the named public certificate for an app (or deployment slot, if + * specified). + * + * Get the named public certificate for an app (or deployment slot, if + * specified). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API the named binding for the production slot. + * + * @param {string} publicCertificateName Public certificate name. + * + * @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 PublicCertificate} 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 _getPublicCertificateSlot(resourceGroupName, name, slot, publicCertificateName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (slot === null || slot === undefined || typeof slot.valueOf() !== 'string') { + throw new Error('slot cannot be null or undefined and it must be of type string.'); + } + if (publicCertificateName === null || publicCertificateName === undefined || typeof publicCertificateName.valueOf() !== 'string') { + throw new Error('publicCertificateName cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/publicCertificates/{publicCertificateName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); + requestUrl = requestUrl.replace('{publicCertificateName}', encodeURIComponent(publicCertificateName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['PublicCertificate']().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 Creates a hostname binding for an app. + * + * Creates a hostname binding for an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} publicCertificateName Public certificate name. + * + * @param {object} publicCertificate Public certificate details. This is the + * JSON representation of a PublicCertificate object. + * + * @param {buffer} [publicCertificate.blob] Public Certificate byte array + * + * @param {string} [publicCertificate.publicCertificateLocation] Public + * Certificate Location. Possible values include: 'CurrentUserMy', + * 'LocalMachineMy', 'Unknown' + * + * @param {string} [publicCertificate.kind] Kind of resource. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will create a binding for the production slot. + * + * @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 PublicCertificate} 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 _createOrUpdatePublicCertificateSlot(resourceGroupName, name, publicCertificateName, publicCertificate, slot, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (publicCertificateName === null || publicCertificateName === undefined || typeof publicCertificateName.valueOf() !== 'string') { + throw new Error('publicCertificateName cannot be null or undefined and it must be of type string.'); + } + if (publicCertificate === null || publicCertificate === undefined) { + throw new Error('publicCertificate cannot be null or undefined.'); + } + if (slot === null || slot === undefined || typeof slot.valueOf() !== 'string') { + throw new Error('slot cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/publicCertificates/{publicCertificateName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{publicCertificateName}', encodeURIComponent(publicCertificateName)); + requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'PUT'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (publicCertificate !== null && publicCertificate !== undefined) { + let requestModelMapper = new client.models['PublicCertificate']().mapper(); + requestModel = client.serialize(requestModelMapper, publicCertificate, 'publicCertificate'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(publicCertificate, 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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['PublicCertificate']().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 Deletes a hostname binding for an app. + * + * Deletes a hostname binding for an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will delete the binding for the production slot. + * + * @param {string} publicCertificateName Public certificate name. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _deletePublicCertificateSlot(resourceGroupName, name, slot, publicCertificateName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (slot === null || slot === undefined || typeof slot.valueOf() !== 'string') { + throw new Error('slot cannot be null or undefined and it must be of type string.'); + } + if (publicCertificateName === null || publicCertificateName === undefined || typeof publicCertificateName.valueOf() !== 'string') { + throw new Error('publicCertificateName cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/publicCertificates/{publicCertificateName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); + requestUrl = requestUrl.replace('{publicCertificateName}', encodeURIComponent(publicCertificateName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'DELETE'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 204) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + + return callback(null, result, httpRequest, response); + }); +} + +/** + * @summary Gets the publishing profile for an app (or deployment slot, if + * specified). + * + * Gets the publishing profile for an app (or deployment slot, if specified). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} publishingProfileOptions Specifies publishingProfileOptions + * for publishing profile. For example, use {"format": "FileZilla3"} to get a + * FileZilla publishing profile. + * + * @param {string} [publishingProfileOptions.format] Name of the format. Valid + * values are: + * FileZilla3 + * WebDeploy -- default + * Ftp. Possible values include: 'FileZilla3', 'WebDeploy', 'Ftp' + * + * @param {boolean} [publishingProfileOptions.includeDisasterRecoveryEndpoints] + * Include the DisasterRecover endpoint if true + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will get the publishing profile for the production slot. + * + * @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. + * + * {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 _listPublishingProfileXmlWithSecretsSlot(resourceGroupName, name, publishingProfileOptions, slot, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (publishingProfileOptions === null || publishingProfileOptions === undefined) { + throw new Error('publishingProfileOptions cannot be null or undefined.'); + } + if (slot === null || slot === undefined || typeof slot.valueOf() !== 'string') { + throw new Error('slot cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/publishxml'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); + 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 (publishingProfileOptions !== null && publishingProfileOptions !== undefined) { + let requestModelMapper = new client.models['CsmPublishingProfileOptions']().mapper(); + requestModel = client.serialize(requestModelMapper, publishingProfileOptions, 'publishingProfileOptions'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(publishingProfileOptions, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + httpRequest.streamedResponse = true; + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(`Unexpected status code: ${statusCode}`); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + if (responseBody !== undefined) parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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 = response; + return callback(null, result, httpRequest, response); + }); +} + +/** + * @summary Resets the configuration settings of the current slot if they were + * previously modified by calling the API with POST. + * + * Resets the configuration settings of the current slot if they were + * previously modified by calling the API with POST. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API resets configuration settings for the production slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _resetSlotConfigurationSlot(resourceGroupName, name, slot, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (slot === null || slot === undefined || typeof slot.valueOf() !== 'string') { + throw new Error('slot cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/resetSlotConfig'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); + 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]; + } + } + } + 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; + + return callback(null, result, httpRequest, response); + }); +} + +/** + * @summary Restarts an app (or deployment slot, if specified). + * + * Restarts an app (or deployment slot, if specified). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will restart the production slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {boolean} [options.softRestart] Specify true to apply the + * configuration settings and restarts the app only if necessary. By default, + * the API always restarts and reprovisions the app. + * + * @param {boolean} [options.synchronous] Specify true to block until the app + * is restarted. By default, it is set to false, and the API responds + * immediately (asynchronous). + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _restartSlot(resourceGroupName, name, slot, 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 softRestart = (options && options.softRestart !== undefined) ? options.softRestart : undefined; + let synchronous = (options && options.synchronous !== undefined) ? options.synchronous : undefined; + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (slot === null || slot === undefined || typeof slot.valueOf() !== 'string') { + throw new Error('slot cannot be null or undefined and it must be of type string.'); + } + if (softRestart !== null && softRestart !== undefined && typeof softRestart !== 'boolean') { + throw new Error('softRestart must be of type boolean.'); + } + if (synchronous !== null && synchronous !== undefined && typeof synchronous !== 'boolean') { + throw new Error('synchronous 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.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/restart'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + if (softRestart !== null && softRestart !== undefined) { + queryParameters.push('softRestart=' + encodeURIComponent(softRestart.toString())); + } + if (synchronous !== null && synchronous !== undefined) { + queryParameters.push('synchronous=' + encodeURIComponent(synchronous.toString())); + } + 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]; + } + } + } + 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; + + return callback(null, result, httpRequest, response); + }); +} + + +/** + * @summary Restores an app from a backup blob in Azure Storage. + * + * Restores an app from a backup blob in Azure Storage. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} request Information on restore request . + * + * @param {string} request.storageAccountUrl SAS URL to the container. + * + * @param {string} [request.blobName] Name of a blob which contains the backup. + * + * @param {boolean} request.overwrite true if the restore + * operation can overwrite target app; otherwise, false. + * true is needed if trying to restore over an existing app. + * + * @param {string} [request.siteName] Name of an app. + * + * @param {array} [request.databases] Collection of databases which should be + * restored. This list has to match the list of databases included in the + * backup. + * + * @param {boolean} [request.ignoreConflictingHostNames] Changes a logic when + * restoring an app with custom domains. true to remove custom + * domains automatically. If false, custom domains are added to + * the app's object when it is being restored, but that might fail due to + * conflicts during the operation. + * + * @param {boolean} [request.ignoreDatabases] Ignore the databases and only + * restore the site content + * + * @param {string} [request.appServicePlan] Specify app service plan that will + * own restored site. + * + * @param {string} [request.operationType] Operation type. Possible values + * include: 'Default', 'Clone', 'Relocation', 'Snapshot', 'CloudFS' + * + * @param {boolean} [request.adjustConnectionStrings] true if + * SiteConfig.ConnectionStrings should be set in new app; otherwise, + * false. + * + * @param {string} [request.hostingEnvironment] App Service Environment name, + * if needed (only when restoring an app to an App Service Environment). + * + * @param {string} [request.kind] Kind of resource. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will restore a backup of the production slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _restoreFromBackupBlobSlot(resourceGroupName, name, request, slot, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + + if (!callback) { + throw new Error('callback cannot be null.'); + } + + // Send request + this.beginRestoreFromBackupBlobSlot(resourceGroupName, name, request, slot, options, (err, parsedResult, httpRequest, response) => { + if (err) return callback(err); + + let initialResult = new msRest.HttpOperationResponse(); + initialResult.request = httpRequest; + initialResult.response = response; + initialResult.body = response.body; + client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { + if (err) return callback(err); + + // Create Result + let result = null; + + httpRequest = pollingResult.request; + response = pollingResult.response; + let responseBody = pollingResult.body; + if (responseBody === '') responseBody = null; + + // Deserialize Response + + return callback(null, result, httpRequest, response); + }); + }); +} + + +/** + * @summary Restores a deleted web app to this web app. + * + * Restores a deleted web app to this web app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {object} restoreRequest Deleted web app restore information. + * + * @param {string} [restoreRequest.deletedSiteId] ARM resource ID of the + * deleted app. Example: + * /subscriptions/{subId}/providers/Microsoft.Web/deletedSites/{deletedSiteId} + * + * @param {boolean} [restoreRequest.recoverConfiguration] If true, deleted site + * configuration, in addition to content, will be restored. + * + * @param {string} [restoreRequest.snapshotTime] Point in time to restore the + * deleted app from, formatted as a DateTime string. + * If unspecified, default value is the time that the app was deleted. + * + * @param {string} [restoreRequest.kind] Kind of resource. + * + * @param {string} slot Name of web app slot. If not specified then will + * default to production slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _restoreFromDeletedAppSlot(resourceGroupName, name, restoreRequest, slot, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + + if (!callback) { + throw new Error('callback cannot be null.'); + } + + // Send request + this.beginRestoreFromDeletedAppSlot(resourceGroupName, name, restoreRequest, slot, options, (err, parsedResult, httpRequest, response) => { + if (err) return callback(err); + + let initialResult = new msRest.HttpOperationResponse(); + initialResult.request = httpRequest; + initialResult.response = response; + initialResult.body = response.body; + client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { + if (err) return callback(err); + + // Create Result + let result = null; + + httpRequest = pollingResult.request; + response = pollingResult.response; + let responseBody = pollingResult.body; + if (responseBody === '') responseBody = null; + + // Deserialize Response + + return callback(null, result, httpRequest, response); + }); + }); +} + + +/** + * @summary Restores a web app from a snapshot. + * + * Restores a web app from a snapshot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {object} restoreRequest Snapshot restore settings. Snapshot + * information can be obtained by calling GetDeletedSites or GetSiteSnapshots + * API. + * + * @param {string} [restoreRequest.snapshotTime] Point in time in which the app + * restore should be done, formatted as a DateTime string. + * + * @param {object} [restoreRequest.recoverySource] Optional. Specifies the web + * app that snapshot contents will be retrieved from. + * If empty, the targeted web app will be used as the source. + * + * @param {string} [restoreRequest.recoverySource.location] Geographical + * location of the source web app, e.g. SouthEastAsia, SouthCentralUS + * + * @param {string} [restoreRequest.recoverySource.id] ARM resource ID of the + * source app. + * /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName} + * for production slots and + * /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/slots/{slotName} + * for other slots. + * + * @param {boolean} restoreRequest.overwrite If true the restore + * operation can overwrite source app; otherwise, false. + * + * @param {boolean} [restoreRequest.recoverConfiguration] If true, site + * configuration, in addition to content, will be reverted. + * + * @param {boolean} [restoreRequest.ignoreConflictingHostNames] If true, custom + * hostname conflicts will be ignored when recovering to a target web app. + * This setting is only necessary when RecoverConfiguration is enabled. + * + * @param {string} [restoreRequest.kind] Kind of resource. + * + * @param {string} slot Name of web app slot. If not specified then will + * default to production slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _restoreSnapshotSlot(resourceGroupName, name, restoreRequest, slot, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + + if (!callback) { + throw new Error('callback cannot be null.'); + } + + // Send request + this.beginRestoreSnapshotSlot(resourceGroupName, name, restoreRequest, slot, options, (err, parsedResult, httpRequest, response) => { + if (err) return callback(err); + + let initialResult = new msRest.HttpOperationResponse(); + initialResult.request = httpRequest; + initialResult.response = response; + initialResult.body = response.body; + client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { + if (err) return callback(err); + + // Create Result + let result = null; + + httpRequest = pollingResult.request; + response = pollingResult.response; + let responseBody = pollingResult.body; + if (responseBody === '') responseBody = null; + + // Deserialize Response + + return callback(null, result, httpRequest, response); + }); + }); +} + +/** + * @summary Get list of siteextensions for a web site, or a deployment slot. + * + * Get list of siteextensions for a web site, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API deletes a deployment for the production slot. + * + * @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 SiteExtensionInfoCollection} 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 _listSiteExtensionsSlot(resourceGroupName, name, slot, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (slot === null || slot === undefined || typeof slot.valueOf() !== 'string') { + throw new Error('slot cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/siteextensions'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 404) { + 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['SiteExtensionInfoCollection']().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 Get site extension information by its ID for a web site, or a + * deployment slot. + * + * Get site extension information by its ID for a web site, or a deployment + * slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} siteExtensionId Site extension name. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API deletes a deployment for the production slot. + * + * @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 SiteExtensionInfo} 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 _getSiteExtensionSlot(resourceGroupName, name, siteExtensionId, slot, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (siteExtensionId === null || siteExtensionId === undefined || typeof siteExtensionId.valueOf() !== 'string') { + throw new Error('siteExtensionId cannot be null or undefined and it must be of type string.'); + } + if (slot === null || slot === undefined || typeof slot.valueOf() !== 'string') { + throw new Error('slot cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/siteextensions/{siteExtensionId}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{siteExtensionId}', encodeURIComponent(siteExtensionId)); + requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 404) { + 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['SiteExtensionInfo']().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 Install site extension on a web site, or a deployment slot. + * + * Install site extension on a web site, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} siteExtensionId Site extension name. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API deletes a deployment for the production slot. + * + * @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 SiteExtensionInfo} 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 _installSiteExtensionSlot(resourceGroupName, name, siteExtensionId, slot, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + + if (!callback) { + throw new Error('callback cannot be null.'); + } + + // Send request + this.beginInstallSiteExtensionSlot(resourceGroupName, name, siteExtensionId, slot, options, (err, parsedResult, httpRequest, response) => { + if (err) return callback(err); + + let initialResult = new msRest.HttpOperationResponse(); + initialResult.request = httpRequest; + initialResult.response = response; + initialResult.body = response.body; + client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { + if (err) return callback(err); + + // Create Result + let result = null; + + httpRequest = pollingResult.request; + response = pollingResult.response; + let responseBody = pollingResult.body; + if (responseBody === '') responseBody = null; + + // Deserialize Response + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['SiteExtensionInfo']().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 Remove a site extension from a web site, or a deployment slot. + * + * Remove a site extension from a web site, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} siteExtensionId Site extension name. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API deletes a deployment for the production slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _deleteSiteExtensionSlot(resourceGroupName, name, siteExtensionId, slot, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (siteExtensionId === null || siteExtensionId === undefined || typeof siteExtensionId.valueOf() !== 'string') { + throw new Error('siteExtensionId cannot be null or undefined and it must be of type string.'); + } + if (slot === null || slot === undefined || typeof slot.valueOf() !== 'string') { + throw new Error('slot cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/siteextensions/{siteExtensionId}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{siteExtensionId}', encodeURIComponent(siteExtensionId)); + requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'DELETE'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 204 && statusCode !== 404) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + + return callback(null, result, httpRequest, response); + }); +} + +/** + * @summary Get the difference in configuration settings between two web app + * slots. + * + * Get the difference in configuration settings between two web app slots. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} slotSwapEntity JSON object that contains the target slot + * name. See example. + * + * @param {string} slotSwapEntity.targetSlot Destination deployment slot during + * swap operation. + * + * @param {boolean} slotSwapEntity.preserveVnet true to preserve + * Virtual Network to the slot during swap; otherwise, false. + * + * @param {string} slot Name of the source slot. If a slot is not specified, + * the production slot is used as the source slot. + * + * @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 SlotDifferenceCollection} 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 _listSlotDifferencesSlot(resourceGroupName, name, slotSwapEntity, slot, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (slotSwapEntity === null || slotSwapEntity === undefined) { + throw new Error('slotSwapEntity cannot be null or undefined.'); + } + if (slot === null || slot === undefined || typeof slot.valueOf() !== 'string') { + throw new Error('slot cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/slotsdiffs'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); + 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 (slotSwapEntity !== null && slotSwapEntity !== undefined) { + let requestModelMapper = new client.models['CsmSlotEntity']().mapper(); + requestModel = client.serialize(requestModelMapper, slotSwapEntity, 'slotSwapEntity'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(slotSwapEntity, 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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['SlotDifferenceCollection']().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 Swaps two deployment slots of an app. + * + * Swaps two deployment slots of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} slotSwapEntity JSON object that contains the target slot + * name. See example. + * + * @param {string} slotSwapEntity.targetSlot Destination deployment slot during + * swap operation. + * + * @param {boolean} slotSwapEntity.preserveVnet true to preserve + * Virtual Network to the slot during swap; otherwise, false. + * + * @param {string} slot Name of the source slot. If a slot is not specified, + * the production slot is used as the source slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _swapSlotSlot(resourceGroupName, name, slotSwapEntity, slot, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + + if (!callback) { + throw new Error('callback cannot be null.'); + } + + // Send request + this.beginSwapSlotSlot(resourceGroupName, name, slotSwapEntity, slot, options, (err, parsedResult, httpRequest, response) => { + if (err) return callback(err); + + let initialResult = new msRest.HttpOperationResponse(); + initialResult.request = httpRequest; + initialResult.response = response; + initialResult.body = response.body; + client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { + if (err) return callback(err); + + // Create Result + let result = null; + + httpRequest = pollingResult.request; + response = pollingResult.response; + let responseBody = pollingResult.body; + if (responseBody === '') responseBody = null; + + // Deserialize Response + + return callback(null, result, httpRequest, response); + }); + }); +} + +/** + * @summary Returns all Snapshots to the user. + * + * Returns all Snapshots to the user. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Website Name. + * + * @param {string} slot Website Slot. + * + * @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 SnapshotCollection} 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 _listSnapshotsSlot(resourceGroupName, name, slot, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (slot === null || slot === undefined || typeof slot.valueOf() !== 'string') { + throw new Error('slot cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/snapshots'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['SnapshotCollection']().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 the source control configuration of an app. + * + * Gets the source control configuration of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will get the source control configuration for the + * production slot. + * + * @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 SiteSourceControl} 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 _getSourceControlSlot(resourceGroupName, name, slot, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (slot === null || slot === undefined || typeof slot.valueOf() !== 'string') { + throw new Error('slot cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/sourcecontrols/web'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 201 && statusCode !== 202) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['SiteSourceControl']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + // Deserialize Response + if (statusCode === 201) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['SiteSourceControl']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError1 = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError1.request = msRest.stripRequest(httpRequest); + deserializationError1.response = msRest.stripResponse(response); + return callback(deserializationError1); + } + } + // Deserialize Response + if (statusCode === 202) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['SiteSourceControl']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError2 = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError2.request = msRest.stripRequest(httpRequest); + deserializationError2.response = msRest.stripResponse(response); + return callback(deserializationError2); + } + } + + return callback(null, result, httpRequest, response); + }); +} + + +/** + * @summary Updates the source control configuration of an app. + * + * Updates the source control configuration of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} siteSourceControl JSON representation of a SiteSourceControl + * object. See example. + * + * @param {string} [siteSourceControl.repoUrl] Repository or source control + * URL. + * + * @param {string} [siteSourceControl.branch] Name of branch to use for + * deployment. + * + * @param {boolean} [siteSourceControl.isManualIntegration] true + * to limit to manual integration; false to enable continuous + * integration (which configures webhooks into online repos like GitHub). + * + * @param {boolean} [siteSourceControl.deploymentRollbackEnabled] + * true to enable deployment rollback; otherwise, + * false. + * + * @param {boolean} [siteSourceControl.isMercurial] true for a + * Mercurial repository; false for a Git repository. + * + * @param {string} [siteSourceControl.kind] Kind of resource. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will update the source control configuration for the + * production slot. + * + * @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 SiteSourceControl} 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 _createOrUpdateSourceControlSlot(resourceGroupName, name, siteSourceControl, slot, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + + if (!callback) { + throw new Error('callback cannot be null.'); + } + + // Send request + this.beginCreateOrUpdateSourceControlSlot(resourceGroupName, name, siteSourceControl, slot, options, (err, parsedResult, httpRequest, response) => { + if (err) return callback(err); + + let initialResult = new msRest.HttpOperationResponse(); + initialResult.request = httpRequest; + initialResult.response = response; + initialResult.body = response.body; + client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { + if (err) return callback(err); + + // Create Result + let result = null; + + httpRequest = pollingResult.request; + response = pollingResult.response; + let responseBody = pollingResult.body; + if (responseBody === '') responseBody = null; + + // Deserialize Response + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['SiteSourceControl']().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 Deletes the source control configuration of an app. + * + * Deletes the source control configuration of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will delete the source control configuration for the + * production slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _deleteSourceControlSlot(resourceGroupName, name, slot, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (slot === null || slot === undefined || typeof slot.valueOf() !== 'string') { + throw new Error('slot cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/sourcecontrols/web'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'DELETE'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 202 && statusCode !== 404) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + + return callback(null, result, httpRequest, response); + }); +} + +/** + * @summary Updates the source control configuration of an app. + * + * Updates the source control configuration of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} siteSourceControl JSON representation of a SiteSourceControl + * object. See example. + * + * @param {string} [siteSourceControl.repoUrl] Repository or source control + * URL. + * + * @param {string} [siteSourceControl.branch] Name of branch to use for + * deployment. + * + * @param {boolean} [siteSourceControl.isManualIntegration] true + * to limit to manual integration; false to enable continuous + * integration (which configures webhooks into online repos like GitHub). + * + * @param {boolean} [siteSourceControl.deploymentRollbackEnabled] + * true to enable deployment rollback; otherwise, + * false. + * + * @param {boolean} [siteSourceControl.isMercurial] true for a + * Mercurial repository; false for a Git repository. + * + * @param {string} [siteSourceControl.kind] Kind of resource. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will update the source control configuration for the + * production slot. + * + * @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 SiteSourceControl} 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 _updateSourceControlSlot(resourceGroupName, name, siteSourceControl, slot, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (siteSourceControl === null || siteSourceControl === undefined) { + throw new Error('siteSourceControl cannot be null or undefined.'); + } + if (slot === null || slot === undefined || typeof slot.valueOf() !== 'string') { + throw new Error('slot cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/sourcecontrols/web'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'PATCH'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (siteSourceControl !== null && siteSourceControl !== undefined) { + let requestModelMapper = new client.models['SiteSourceControl']().mapper(); + requestModel = client.serialize(requestModelMapper, siteSourceControl, 'siteSourceControl'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(siteSourceControl, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 201 && statusCode !== 202) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['SiteSourceControl']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + // Deserialize Response + if (statusCode === 201) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['SiteSourceControl']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError1 = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError1.request = msRest.stripRequest(httpRequest); + deserializationError1.response = msRest.stripResponse(response); + return callback(deserializationError1); + } + } + // Deserialize Response + if (statusCode === 202) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['SiteSourceControl']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError2 = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError2.request = msRest.stripRequest(httpRequest); + deserializationError2.response = msRest.stripResponse(response); + return callback(deserializationError2); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * @summary Starts an app (or deployment slot, if specified). + * + * Starts an app (or deployment slot, if specified). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will start the production slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _startSlot(resourceGroupName, name, slot, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (slot === null || slot === undefined || typeof slot.valueOf() !== 'string') { + throw new Error('slot cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/start'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); + 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]; + } + } + } + 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; + + return callback(null, result, httpRequest, response); + }); +} + +/** + * @summary Stops an app (or deployment slot, if specified). + * + * Stops an app (or deployment slot, if specified). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will stop the production slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _stopSlot(resourceGroupName, name, slot, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (slot === null || slot === undefined || typeof slot.valueOf() !== 'string') { + throw new Error('slot cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/stop'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); + 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]; + } + } + } + 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; + + return callback(null, result, httpRequest, response); + }); +} + +/** + * @summary Sync web app repository. + * + * Sync web app repository. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {string} slot Name of web app slot. If not specified then will + * default to production slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _syncRepositorySlot(resourceGroupName, name, slot, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (slot === null || slot === undefined || typeof slot.valueOf() !== 'string') { + throw new Error('slot cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/sync'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); + 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]; + } + } + } + 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; + + return callback(null, result, httpRequest, response); + }); +} + +/** + * @summary Syncs function trigger metadata to the scale controller + * + * Syncs function trigger metadata to the scale controller + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will restore a backup of the production slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _syncFunctionTriggersSlot(resourceGroupName, name, slot, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (slot === null || slot === undefined || typeof slot.valueOf() !== 'string') { + throw new Error('slot cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/syncfunctiontriggers'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); + 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]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 204) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + + return callback(null, result, httpRequest, response); + }); +} + +/** + * @summary List triggered web jobs for an app, or a deployment slot. + * + * List triggered web jobs for an app, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API deletes a deployment for the production slot. + * + * @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 TriggeredWebJobCollection} 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 _listTriggeredWebJobsSlot(resourceGroupName, name, slot, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (slot === null || slot === undefined || typeof slot.valueOf() !== 'string') { + throw new Error('slot cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/triggeredwebjobs'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['TriggeredWebJobCollection']().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 triggered web job by its ID for an app, or a deployment + * slot. + * + * Gets a triggered web job by its ID for an app, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} webJobName Name of Web Job. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API deletes a deployment for the production slot. + * + * @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 TriggeredWebJob} 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 _getTriggeredWebJobSlot(resourceGroupName, name, webJobName, slot, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (webJobName === null || webJobName === undefined || typeof webJobName.valueOf() !== 'string') { + throw new Error('webJobName cannot be null or undefined and it must be of type string.'); + } + if (slot === null || slot === undefined || typeof slot.valueOf() !== 'string') { + throw new Error('slot cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/triggeredwebjobs/{webJobName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{webJobName}', encodeURIComponent(webJobName)); + requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 404) { + 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['TriggeredWebJob']().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 Delete a triggered web job by its ID for an app, or a deployment + * slot. + * + * Delete a triggered web job by its ID for an app, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} webJobName Name of Web Job. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API deletes a deployment for the production slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _deleteTriggeredWebJobSlot(resourceGroupName, name, webJobName, slot, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (webJobName === null || webJobName === undefined || typeof webJobName.valueOf() !== 'string') { + throw new Error('webJobName cannot be null or undefined and it must be of type string.'); + } + if (slot === null || slot === undefined || typeof slot.valueOf() !== 'string') { + throw new Error('slot cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/triggeredwebjobs/{webJobName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{webJobName}', encodeURIComponent(webJobName)); + requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'DELETE'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 204) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + + return callback(null, result, httpRequest, response); + }); +} + +/** + * @summary List a triggered web job's history for an app, or a deployment + * slot. + * + * List a triggered web job's history for an app, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} webJobName Name of Web Job. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API deletes a deployment for the production slot. + * + * @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 TriggeredJobHistoryCollection} 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 _listTriggeredWebJobHistorySlot(resourceGroupName, name, webJobName, slot, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (webJobName === null || webJobName === undefined || typeof webJobName.valueOf() !== 'string') { + throw new Error('webJobName cannot be null or undefined and it must be of type string.'); + } + if (slot === null || slot === undefined || typeof slot.valueOf() !== 'string') { + throw new Error('slot cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/triggeredwebjobs/{webJobName}/history'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{webJobName}', encodeURIComponent(webJobName)); + requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 404) { + 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['TriggeredJobHistoryCollection']().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 triggered web job's history by its ID for an app, , or a + * deployment slot. + * + * Gets a triggered web job's history by its ID for an app, , or a deployment + * slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} webJobName Name of Web Job. + * + * @param {string} id History ID. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API deletes a deployment for the production slot. + * + * @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 TriggeredJobHistory} 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 _getTriggeredWebJobHistorySlot(resourceGroupName, name, webJobName, id, slot, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (webJobName === null || webJobName === undefined || typeof webJobName.valueOf() !== 'string') { + throw new Error('webJobName cannot be null or undefined and it must be of type string.'); + } + if (id === null || id === undefined || typeof id.valueOf() !== 'string') { + throw new Error('id cannot be null or undefined and it must be of type string.'); + } + if (slot === null || slot === undefined || typeof slot.valueOf() !== 'string') { + throw new Error('slot cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/triggeredwebjobs/{webJobName}/history/{id}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{webJobName}', encodeURIComponent(webJobName)); + requestUrl = requestUrl.replace('{id}', encodeURIComponent(id)); + requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 404) { + 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['TriggeredJobHistory']().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 Run a triggered web job for an app, or a deployment slot. + * + * Run a triggered web job for an app, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} webJobName Name of Web Job. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API deletes a deployment for the production slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _runTriggeredWebJobSlot(resourceGroupName, name, webJobName, slot, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (webJobName === null || webJobName === undefined || typeof webJobName.valueOf() !== 'string') { + throw new Error('webJobName cannot be null or undefined and it must be of type string.'); + } + if (slot === null || slot === undefined || typeof slot.valueOf() !== 'string') { + throw new Error('slot cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/triggeredwebjobs/{webJobName}/run'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{webJobName}', encodeURIComponent(webJobName)); + requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); + 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]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 404) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + + return callback(null, result, httpRequest, response); + }); +} + +/** + * @summary Gets the quota usage information of an app (or deployment slot, if + * specified). + * + * Gets the quota usage information of an app (or deployment slot, if + * specified). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will get quota information of the production slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.filter] Return only information specified in the + * filter (using OData syntax). For example: $filter=(name.value eq 'Metric1' + * or name.value eq 'Metric2') and startTime eq 2014-01-01T00:00:00Z and + * endTime eq 2014-12-31T23:59:59Z and timeGrain eq + * duration'[Hour|Minute|Day]'. + * + * @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 CsmUsageQuotaCollection} 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 _listUsagesSlot(resourceGroupName, name, slot, 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 filter = (options && options.filter !== undefined) ? options.filter : undefined; + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (slot === null || slot === undefined || typeof slot.valueOf() !== 'string') { + throw new Error('slot cannot be null or undefined and it must be of type string.'); + } + if (filter !== null && filter !== undefined && typeof filter.valueOf() !== 'string') { + throw new Error('filter must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/usages'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + if (filter !== null && filter !== undefined) { + queryParameters.push('$filter=' + filter); + } + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['CsmUsageQuotaCollection']().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 the virtual networks the app (or deployment slot) is connected + * to. + * + * Gets the virtual networks the app (or deployment slot) is connected to. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will get virtual network connections for the production + * slot. + * + * @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. + * + * {array} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _listVnetConnectionsSlot(resourceGroupName, name, slot, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (slot === null || slot === undefined || typeof slot.valueOf() !== 'string') { + throw new Error('slot cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/virtualNetworkConnections'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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 = { + required: false, + serializedName: 'parsedResponse', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'VnetInfoElementType', + type: { + name: 'Composite', + className: 'VnetInfo' + } + } + } + }; + 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 virtual network the app (or deployment slot) is connected to + * by name. + * + * Gets a virtual network the app (or deployment slot) is connected to by name. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} vnetName Name of the virtual network. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will get the named virtual network for the production + * slot. + * + * @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 VnetInfo} 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 _getVnetConnectionSlot(resourceGroupName, name, vnetName, slot, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (vnetName === null || vnetName === undefined || typeof vnetName.valueOf() !== 'string') { + throw new Error('vnetName cannot be null or undefined and it must be of type string.'); + } + if (slot === null || slot === undefined || typeof slot.valueOf() !== 'string') { + throw new Error('slot cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/virtualNetworkConnections/{vnetName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{vnetName}', encodeURIComponent(vnetName)); + requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['VnetInfo']().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 Adds a Virtual Network connection to an app or slot (PUT) or + * updates the connection properties (PATCH). + * + * Adds a Virtual Network connection to an app or slot (PUT) or updates the + * connection properties (PATCH). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} vnetName Name of an existing Virtual Network. + * + * @param {object} connectionEnvelope Properties of the Virtual Network + * connection. See example. + * + * @param {string} [connectionEnvelope.vnetResourceId] The Virtual Network's + * resource ID. + * + * @param {buffer} [connectionEnvelope.certBlob] A certificate file (.cer) blob + * containing the public key of the private key used to authenticate a + * Point-To-Site VPN connection. + * + * @param {string} [connectionEnvelope.dnsServers] DNS servers to be used by + * this Virtual Network. This should be a comma-separated list of IP addresses. + * + * @param {string} [connectionEnvelope.kind] Kind of resource. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will add or update connections for the production slot. + * + * @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 VnetInfo} 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 _createOrUpdateVnetConnectionSlot(resourceGroupName, name, vnetName, connectionEnvelope, slot, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (vnetName === null || vnetName === undefined || typeof vnetName.valueOf() !== 'string') { + throw new Error('vnetName cannot be null or undefined and it must be of type string.'); + } + if (connectionEnvelope === null || connectionEnvelope === undefined) { + throw new Error('connectionEnvelope cannot be null or undefined.'); + } + if (slot === null || slot === undefined || typeof slot.valueOf() !== 'string') { + throw new Error('slot cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/virtualNetworkConnections/{vnetName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{vnetName}', encodeURIComponent(vnetName)); + requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'PUT'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (connectionEnvelope !== null && connectionEnvelope !== undefined) { + let requestModelMapper = new client.models['VnetInfo']().mapper(); + requestModel = client.serialize(requestModelMapper, connectionEnvelope, 'connectionEnvelope'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(connectionEnvelope, 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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['VnetInfo']().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 Deletes a connection from an app (or deployment slot to a named + * virtual network. + * + * Deletes a connection from an app (or deployment slot to a named virtual + * network. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} vnetName Name of the virtual network. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will delete the connection for the production slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _deleteVnetConnectionSlot(resourceGroupName, name, vnetName, slot, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (vnetName === null || vnetName === undefined || typeof vnetName.valueOf() !== 'string') { + throw new Error('vnetName cannot be null or undefined and it must be of type string.'); + } + if (slot === null || slot === undefined || typeof slot.valueOf() !== 'string') { + throw new Error('slot cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/virtualNetworkConnections/{vnetName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{vnetName}', encodeURIComponent(vnetName)); + requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'DELETE'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 404) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + + return callback(null, result, httpRequest, response); + }); +} + +/** + * @summary Adds a Virtual Network connection to an app or slot (PUT) or + * updates the connection properties (PATCH). + * + * Adds a Virtual Network connection to an app or slot (PUT) or updates the + * connection properties (PATCH). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} vnetName Name of an existing Virtual Network. + * + * @param {object} connectionEnvelope Properties of the Virtual Network + * connection. See example. + * + * @param {string} [connectionEnvelope.vnetResourceId] The Virtual Network's + * resource ID. + * + * @param {buffer} [connectionEnvelope.certBlob] A certificate file (.cer) blob + * containing the public key of the private key used to authenticate a + * Point-To-Site VPN connection. + * + * @param {string} [connectionEnvelope.dnsServers] DNS servers to be used by + * this Virtual Network. This should be a comma-separated list of IP addresses. + * + * @param {string} [connectionEnvelope.kind] Kind of resource. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will add or update connections for the production slot. + * + * @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 VnetInfo} 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 _updateVnetConnectionSlot(resourceGroupName, name, vnetName, connectionEnvelope, slot, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (vnetName === null || vnetName === undefined || typeof vnetName.valueOf() !== 'string') { + throw new Error('vnetName cannot be null or undefined and it must be of type string.'); + } + if (connectionEnvelope === null || connectionEnvelope === undefined) { + throw new Error('connectionEnvelope cannot be null or undefined.'); + } + if (slot === null || slot === undefined || typeof slot.valueOf() !== 'string') { + throw new Error('slot cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/virtualNetworkConnections/{vnetName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{vnetName}', encodeURIComponent(vnetName)); + requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'PATCH'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (connectionEnvelope !== null && connectionEnvelope !== undefined) { + let requestModelMapper = new client.models['VnetInfo']().mapper(); + requestModel = client.serialize(requestModelMapper, connectionEnvelope, 'connectionEnvelope'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(connectionEnvelope, 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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['VnetInfo']().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 an app's Virtual Network gateway. + * + * Gets an app's Virtual Network gateway. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} vnetName Name of the Virtual Network. + * + * @param {string} gatewayName Name of the gateway. Currently, the only + * supported string is "primary". + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will get a gateway for the production slot's Virtual + * Network. + * + * @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 VnetGateway} 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 _getVnetConnectionGatewaySlot(resourceGroupName, name, vnetName, gatewayName, slot, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (vnetName === null || vnetName === undefined || typeof vnetName.valueOf() !== 'string') { + throw new Error('vnetName cannot be null or undefined and it must be of type string.'); + } + if (gatewayName === null || gatewayName === undefined || typeof gatewayName.valueOf() !== 'string') { + throw new Error('gatewayName cannot be null or undefined and it must be of type string.'); + } + if (slot === null || slot === undefined || typeof slot.valueOf() !== 'string') { + throw new Error('slot cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/virtualNetworkConnections/{vnetName}/gateways/{gatewayName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{vnetName}', encodeURIComponent(vnetName)); + requestUrl = requestUrl.replace('{gatewayName}', encodeURIComponent(gatewayName)); + requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 404) { + 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['VnetGateway']().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 Adds a gateway to a connected Virtual Network (PUT) or updates it + * (PATCH). + * + * Adds a gateway to a connected Virtual Network (PUT) or updates it (PATCH). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} vnetName Name of the Virtual Network. + * + * @param {string} gatewayName Name of the gateway. Currently, the only + * supported string is "primary". + * + * @param {object} connectionEnvelope The properties to update this gateway + * with. + * + * @param {string} [connectionEnvelope.vnetName] The Virtual Network name. + * + * @param {string} connectionEnvelope.vpnPackageUri The URI where the VPN + * package can be downloaded. + * + * @param {string} [connectionEnvelope.kind] Kind of resource. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will add or update a gateway for the production slot's + * Virtual Network. + * + * @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 VnetGateway} 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 _createOrUpdateVnetConnectionGatewaySlot(resourceGroupName, name, vnetName, gatewayName, connectionEnvelope, slot, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (vnetName === null || vnetName === undefined || typeof vnetName.valueOf() !== 'string') { + throw new Error('vnetName cannot be null or undefined and it must be of type string.'); + } + if (gatewayName === null || gatewayName === undefined || typeof gatewayName.valueOf() !== 'string') { + throw new Error('gatewayName cannot be null or undefined and it must be of type string.'); + } + if (connectionEnvelope === null || connectionEnvelope === undefined) { + throw new Error('connectionEnvelope cannot be null or undefined.'); + } + if (slot === null || slot === undefined || typeof slot.valueOf() !== 'string') { + throw new Error('slot cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/virtualNetworkConnections/{vnetName}/gateways/{gatewayName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{vnetName}', encodeURIComponent(vnetName)); + requestUrl = requestUrl.replace('{gatewayName}', encodeURIComponent(gatewayName)); + requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'PUT'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (connectionEnvelope !== null && connectionEnvelope !== undefined) { + let requestModelMapper = new client.models['VnetGateway']().mapper(); + requestModel = client.serialize(requestModelMapper, connectionEnvelope, 'connectionEnvelope'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(connectionEnvelope, 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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['VnetGateway']().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 Adds a gateway to a connected Virtual Network (PUT) or updates it + * (PATCH). + * + * Adds a gateway to a connected Virtual Network (PUT) or updates it (PATCH). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} vnetName Name of the Virtual Network. + * + * @param {string} gatewayName Name of the gateway. Currently, the only + * supported string is "primary". + * + * @param {object} connectionEnvelope The properties to update this gateway + * with. + * + * @param {string} [connectionEnvelope.vnetName] The Virtual Network name. + * + * @param {string} connectionEnvelope.vpnPackageUri The URI where the VPN + * package can be downloaded. + * + * @param {string} [connectionEnvelope.kind] Kind of resource. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will add or update a gateway for the production slot's + * Virtual Network. + * + * @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 VnetGateway} 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 _updateVnetConnectionGatewaySlot(resourceGroupName, name, vnetName, gatewayName, connectionEnvelope, slot, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (vnetName === null || vnetName === undefined || typeof vnetName.valueOf() !== 'string') { + throw new Error('vnetName cannot be null or undefined and it must be of type string.'); + } + if (gatewayName === null || gatewayName === undefined || typeof gatewayName.valueOf() !== 'string') { + throw new Error('gatewayName cannot be null or undefined and it must be of type string.'); + } + if (connectionEnvelope === null || connectionEnvelope === undefined) { + throw new Error('connectionEnvelope cannot be null or undefined.'); + } + if (slot === null || slot === undefined || typeof slot.valueOf() !== 'string') { + throw new Error('slot cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/virtualNetworkConnections/{vnetName}/gateways/{gatewayName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{vnetName}', encodeURIComponent(vnetName)); + requestUrl = requestUrl.replace('{gatewayName}', encodeURIComponent(gatewayName)); + requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'PATCH'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (connectionEnvelope !== null && connectionEnvelope !== undefined) { + let requestModelMapper = new client.models['VnetGateway']().mapper(); + requestModel = client.serialize(requestModelMapper, connectionEnvelope, 'connectionEnvelope'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(connectionEnvelope, 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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['VnetGateway']().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 List webjobs for an app, or a deployment slot. + * + * List webjobs for an app, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API returns deployments for the production slot. + * + * @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 WebJobCollection} 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 _listWebJobsSlot(resourceGroupName, name, slot, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (slot === null || slot === undefined || typeof slot.valueOf() !== 'string') { + throw new Error('slot cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/webjobs'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['WebJobCollection']().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 Get webjob information for an app, or a deployment slot. + * + * Get webjob information for an app, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} webJobName Name of the web job. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API returns deployments for the production slot. + * + * @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 WebJob} 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 _getWebJobSlot(resourceGroupName, name, webJobName, slot, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (webJobName === null || webJobName === undefined || typeof webJobName.valueOf() !== 'string') { + throw new Error('webJobName cannot be null or undefined and it must be of type string.'); + } + if (slot === null || slot === undefined || typeof slot.valueOf() !== 'string') { + throw new Error('slot cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/webjobs/{webJobName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{webJobName}', encodeURIComponent(webJobName)); + requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['WebJob']().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 Get the difference in configuration settings between two web app + * slots. + * + * Get the difference in configuration settings between two web app slots. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} slotSwapEntity JSON object that contains the target slot + * name. See example. + * + * @param {string} slotSwapEntity.targetSlot Destination deployment slot during + * swap operation. + * + * @param {boolean} slotSwapEntity.preserveVnet true to preserve + * Virtual Network to the slot during swap; otherwise, false. + * + * @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 SlotDifferenceCollection} 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 _listSlotDifferencesFromProduction(resourceGroupName, name, slotSwapEntity, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (slotSwapEntity === null || slotSwapEntity === undefined) { + throw new Error('slotSwapEntity cannot be null or undefined.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slotsdiffs'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + 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 (slotSwapEntity !== null && slotSwapEntity !== undefined) { + let requestModelMapper = new client.models['CsmSlotEntity']().mapper(); + requestModel = client.serialize(requestModelMapper, slotSwapEntity, 'slotSwapEntity'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(slotSwapEntity, 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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['SlotDifferenceCollection']().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 Swaps two deployment slots of an app. + * + * Swaps two deployment slots of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} slotSwapEntity JSON object that contains the target slot + * name. See example. + * + * @param {string} slotSwapEntity.targetSlot Destination deployment slot during + * swap operation. + * + * @param {boolean} slotSwapEntity.preserveVnet true to preserve + * Virtual Network to the slot during swap; otherwise, false. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _swapSlotWithProduction(resourceGroupName, name, slotSwapEntity, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + + if (!callback) { + throw new Error('callback cannot be null.'); + } + + // Send request + this.beginSwapSlotWithProduction(resourceGroupName, name, slotSwapEntity, options, (err, parsedResult, httpRequest, response) => { + if (err) return callback(err); + + let initialResult = new msRest.HttpOperationResponse(); + initialResult.request = httpRequest; + initialResult.response = response; + initialResult.body = response.body; + client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { + if (err) return callback(err); + + // Create Result + let result = null; + + httpRequest = pollingResult.request; + response = pollingResult.response; + let responseBody = pollingResult.body; + if (responseBody === '') responseBody = null; + + // Deserialize Response + + return callback(null, result, httpRequest, response); + }); + }); +} + +/** + * @summary Returns all Snapshots to the user. + * + * Returns all Snapshots to the user. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Website Name. + * + * @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 SnapshotCollection} 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 _listSnapshots(resourceGroupName, name, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/snapshots'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['SnapshotCollection']().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 the source control configuration of an app. + * + * Gets the source control configuration of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @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 SiteSourceControl} 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 _getSourceControl(resourceGroupName, name, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/sourcecontrols/web'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 201 && statusCode !== 202) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['SiteSourceControl']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + // Deserialize Response + if (statusCode === 201) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['SiteSourceControl']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError1 = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError1.request = msRest.stripRequest(httpRequest); + deserializationError1.response = msRest.stripResponse(response); + return callback(deserializationError1); + } + } + // Deserialize Response + if (statusCode === 202) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['SiteSourceControl']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError2 = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError2.request = msRest.stripRequest(httpRequest); + deserializationError2.response = msRest.stripResponse(response); + return callback(deserializationError2); + } + } + + return callback(null, result, httpRequest, response); + }); +} + + +/** + * @summary Updates the source control configuration of an app. + * + * Updates the source control configuration of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} siteSourceControl JSON representation of a SiteSourceControl + * object. See example. + * + * @param {string} [siteSourceControl.repoUrl] Repository or source control + * URL. + * + * @param {string} [siteSourceControl.branch] Name of branch to use for + * deployment. + * + * @param {boolean} [siteSourceControl.isManualIntegration] true + * to limit to manual integration; false to enable continuous + * integration (which configures webhooks into online repos like GitHub). + * + * @param {boolean} [siteSourceControl.deploymentRollbackEnabled] + * true to enable deployment rollback; otherwise, + * false. + * + * @param {boolean} [siteSourceControl.isMercurial] true for a + * Mercurial repository; false for a Git repository. + * + * @param {string} [siteSourceControl.kind] Kind of resource. + * + * @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 SiteSourceControl} 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 _createOrUpdateSourceControl(resourceGroupName, name, siteSourceControl, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + + if (!callback) { + throw new Error('callback cannot be null.'); + } + + // Send request + this.beginCreateOrUpdateSourceControl(resourceGroupName, name, siteSourceControl, options, (err, parsedResult, httpRequest, response) => { + if (err) return callback(err); + + let initialResult = new msRest.HttpOperationResponse(); + initialResult.request = httpRequest; + initialResult.response = response; + initialResult.body = response.body; + client.getLongRunningOperationResult(initialResult, options, (err, pollingResult) => { + if (err) return callback(err); + + // Create Result + let result = null; + + httpRequest = pollingResult.request; + response = pollingResult.response; + let responseBody = pollingResult.body; + if (responseBody === '') responseBody = null; + + // Deserialize Response + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['SiteSourceControl']().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 Deletes the source control configuration of an app. + * + * Deletes the source control configuration of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _deleteSourceControl(resourceGroupName, name, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/sourcecontrols/web'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'DELETE'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 202 && statusCode !== 404) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + + return callback(null, result, httpRequest, response); + }); +} + +/** + * @summary Updates the source control configuration of an app. + * + * Updates the source control configuration of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} siteSourceControl JSON representation of a SiteSourceControl + * object. See example. + * + * @param {string} [siteSourceControl.repoUrl] Repository or source control + * URL. + * + * @param {string} [siteSourceControl.branch] Name of branch to use for + * deployment. + * + * @param {boolean} [siteSourceControl.isManualIntegration] true + * to limit to manual integration; false to enable continuous + * integration (which configures webhooks into online repos like GitHub). + * + * @param {boolean} [siteSourceControl.deploymentRollbackEnabled] + * true to enable deployment rollback; otherwise, + * false. + * + * @param {boolean} [siteSourceControl.isMercurial] true for a + * Mercurial repository; false for a Git repository. + * + * @param {string} [siteSourceControl.kind] Kind of resource. + * + * @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 SiteSourceControl} 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 _updateSourceControl(resourceGroupName, name, siteSourceControl, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (siteSourceControl === null || siteSourceControl === undefined) { + throw new Error('siteSourceControl cannot be null or undefined.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/sourcecontrols/web'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'PATCH'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (siteSourceControl !== null && siteSourceControl !== undefined) { + let requestModelMapper = new client.models['SiteSourceControl']().mapper(); + requestModel = client.serialize(requestModelMapper, siteSourceControl, 'siteSourceControl'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(siteSourceControl, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 201 && statusCode !== 202) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['SiteSourceControl']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + // Deserialize Response + if (statusCode === 201) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['SiteSourceControl']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError1 = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError1.request = msRest.stripRequest(httpRequest); + deserializationError1.response = msRest.stripResponse(response); + return callback(deserializationError1); + } + } + // Deserialize Response + if (statusCode === 202) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['SiteSourceControl']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError2 = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError2.request = msRest.stripRequest(httpRequest); + deserializationError2.response = msRest.stripResponse(response); + return callback(deserializationError2); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * @summary Starts an app (or deployment slot, if specified). + * + * Starts an app (or deployment slot, if specified). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _start(resourceGroupName, name, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/start'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + 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]; + } + } + } + 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; + + return callback(null, result, httpRequest, response); + }); +} + +/** + * @summary Stops an app (or deployment slot, if specified). + * + * Stops an app (or deployment slot, if specified). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _stop(resourceGroupName, name, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/stop'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + 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]; + } + } + } + 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; + + return callback(null, result, httpRequest, response); + }); +} + +/** + * @summary Sync web app repository. + * + * Sync web app repository. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _syncRepository(resourceGroupName, name, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/sync'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + 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]; + } + } + } + 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; + + return callback(null, result, httpRequest, response); + }); +} + +/** + * @summary Syncs function trigger metadata to the scale controller + * + * Syncs function trigger metadata to the scale controller + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _syncFunctionTriggers(resourceGroupName, name, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/syncfunctiontriggers'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + 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]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 204) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + + return callback(null, result, httpRequest, response); + }); +} + +/** + * @summary List triggered web jobs for an app, or a deployment slot. + * + * List triggered web jobs for an app, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @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 TriggeredWebJobCollection} 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 _listTriggeredWebJobs(resourceGroupName, name, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/triggeredwebjobs'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['TriggeredWebJobCollection']().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 triggered web job by its ID for an app, or a deployment + * slot. + * + * Gets a triggered web job by its ID for an app, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} webJobName Name of Web Job. + * + * @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 TriggeredWebJob} 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 _getTriggeredWebJob(resourceGroupName, name, webJobName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (webJobName === null || webJobName === undefined || typeof webJobName.valueOf() !== 'string') { + throw new Error('webJobName cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/triggeredwebjobs/{webJobName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{webJobName}', encodeURIComponent(webJobName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 404) { + 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['TriggeredWebJob']().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 Delete a triggered web job by its ID for an app, or a deployment + * slot. + * + * Delete a triggered web job by its ID for an app, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} webJobName Name of Web Job. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _deleteTriggeredWebJob(resourceGroupName, name, webJobName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (webJobName === null || webJobName === undefined || typeof webJobName.valueOf() !== 'string') { + throw new Error('webJobName cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/triggeredwebjobs/{webJobName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{webJobName}', encodeURIComponent(webJobName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'DELETE'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 204) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + + return callback(null, result, httpRequest, response); + }); +} + +/** + * @summary List a triggered web job's history for an app, or a deployment + * slot. + * + * List a triggered web job's history for an app, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} webJobName Name of Web Job. + * + * @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 TriggeredJobHistoryCollection} 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 _listTriggeredWebJobHistory(resourceGroupName, name, webJobName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (webJobName === null || webJobName === undefined || typeof webJobName.valueOf() !== 'string') { + throw new Error('webJobName cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/triggeredwebjobs/{webJobName}/history'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{webJobName}', encodeURIComponent(webJobName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 404) { + 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['TriggeredJobHistoryCollection']().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 triggered web job's history by its ID for an app, , or a + * deployment slot. + * + * Gets a triggered web job's history by its ID for an app, , or a deployment + * slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} webJobName Name of Web Job. + * + * @param {string} id History ID. + * + * @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 TriggeredJobHistory} 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 _getTriggeredWebJobHistory(resourceGroupName, name, webJobName, id, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (webJobName === null || webJobName === undefined || typeof webJobName.valueOf() !== 'string') { + throw new Error('webJobName cannot be null or undefined and it must be of type string.'); + } + if (id === null || id === undefined || typeof id.valueOf() !== 'string') { + throw new Error('id cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/triggeredwebjobs/{webJobName}/history/{id}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{webJobName}', encodeURIComponent(webJobName)); + requestUrl = requestUrl.replace('{id}', encodeURIComponent(id)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 404) { + 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['TriggeredJobHistory']().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 Run a triggered web job for an app, or a deployment slot. + * + * Run a triggered web job for an app, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} webJobName Name of Web Job. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _runTriggeredWebJob(resourceGroupName, name, webJobName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (webJobName === null || webJobName === undefined || typeof webJobName.valueOf() !== 'string') { + throw new Error('webJobName cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/triggeredwebjobs/{webJobName}/run'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{webJobName}', encodeURIComponent(webJobName)); + 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]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 404) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + + return callback(null, result, httpRequest, response); + }); +} + +/** + * @summary Gets the quota usage information of an app (or deployment slot, if + * specified). + * + * Gets the quota usage information of an app (or deployment slot, if + * specified). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.filter] Return only information specified in the + * filter (using OData syntax). For example: $filter=(name.value eq 'Metric1' + * or name.value eq 'Metric2') and startTime eq 2014-01-01T00:00:00Z and + * endTime eq 2014-12-31T23:59:59Z and timeGrain eq + * duration'[Hour|Minute|Day]'. + * + * @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 CsmUsageQuotaCollection} 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 _listUsages(resourceGroupName, name, 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 filter = (options && options.filter !== undefined) ? options.filter : undefined; + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (filter !== null && filter !== undefined && typeof filter.valueOf() !== 'string') { + throw new Error('filter must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/usages'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + if (filter !== null && filter !== undefined) { + queryParameters.push('$filter=' + filter); + } + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['CsmUsageQuotaCollection']().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 the virtual networks the app (or deployment slot) is connected + * to. + * + * Gets the virtual networks the app (or deployment slot) is connected to. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @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. + * + * {array} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _listVnetConnections(resourceGroupName, name, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/virtualNetworkConnections'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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 = { + required: false, + serializedName: 'parsedResponse', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'VnetInfoElementType', + type: { + name: 'Composite', + className: 'VnetInfo' + } + } + } + }; + 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 virtual network the app (or deployment slot) is connected to + * by name. + * + * Gets a virtual network the app (or deployment slot) is connected to by name. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} vnetName Name of the virtual network. + * + * @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 VnetInfo} 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 _getVnetConnection(resourceGroupName, name, vnetName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (vnetName === null || vnetName === undefined || typeof vnetName.valueOf() !== 'string') { + throw new Error('vnetName cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/virtualNetworkConnections/{vnetName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{vnetName}', encodeURIComponent(vnetName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['VnetInfo']().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 Adds a Virtual Network connection to an app or slot (PUT) or + * updates the connection properties (PATCH). + * + * Adds a Virtual Network connection to an app or slot (PUT) or updates the + * connection properties (PATCH). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} vnetName Name of an existing Virtual Network. + * + * @param {object} connectionEnvelope Properties of the Virtual Network + * connection. See example. + * + * @param {string} [connectionEnvelope.vnetResourceId] The Virtual Network's + * resource ID. + * + * @param {buffer} [connectionEnvelope.certBlob] A certificate file (.cer) blob + * containing the public key of the private key used to authenticate a + * Point-To-Site VPN connection. + * + * @param {string} [connectionEnvelope.dnsServers] DNS servers to be used by + * this Virtual Network. This should be a comma-separated list of IP addresses. + * + * @param {string} [connectionEnvelope.kind] Kind of resource. + * + * @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 VnetInfo} 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 _createOrUpdateVnetConnection(resourceGroupName, name, vnetName, connectionEnvelope, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (vnetName === null || vnetName === undefined || typeof vnetName.valueOf() !== 'string') { + throw new Error('vnetName cannot be null or undefined and it must be of type string.'); + } + if (connectionEnvelope === null || connectionEnvelope === undefined) { + throw new Error('connectionEnvelope cannot be null or undefined.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/virtualNetworkConnections/{vnetName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{vnetName}', encodeURIComponent(vnetName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'PUT'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (connectionEnvelope !== null && connectionEnvelope !== undefined) { + let requestModelMapper = new client.models['VnetInfo']().mapper(); + requestModel = client.serialize(requestModelMapper, connectionEnvelope, 'connectionEnvelope'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(connectionEnvelope, 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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['VnetInfo']().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 Deletes a connection from an app (or deployment slot to a named + * virtual network. + * + * Deletes a connection from an app (or deployment slot to a named virtual + * network. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} vnetName Name of the virtual network. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _deleteVnetConnection(resourceGroupName, name, vnetName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (vnetName === null || vnetName === undefined || typeof vnetName.valueOf() !== 'string') { + throw new Error('vnetName cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/virtualNetworkConnections/{vnetName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{vnetName}', encodeURIComponent(vnetName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'DELETE'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 404) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + + return callback(null, result, httpRequest, response); + }); +} + +/** + * @summary Adds a Virtual Network connection to an app or slot (PUT) or + * updates the connection properties (PATCH). + * + * Adds a Virtual Network connection to an app or slot (PUT) or updates the + * connection properties (PATCH). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} vnetName Name of an existing Virtual Network. + * + * @param {object} connectionEnvelope Properties of the Virtual Network + * connection. See example. + * + * @param {string} [connectionEnvelope.vnetResourceId] The Virtual Network's + * resource ID. + * + * @param {buffer} [connectionEnvelope.certBlob] A certificate file (.cer) blob + * containing the public key of the private key used to authenticate a + * Point-To-Site VPN connection. + * + * @param {string} [connectionEnvelope.dnsServers] DNS servers to be used by + * this Virtual Network. This should be a comma-separated list of IP addresses. + * + * @param {string} [connectionEnvelope.kind] Kind of resource. + * + * @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 VnetInfo} 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 _updateVnetConnection(resourceGroupName, name, vnetName, connectionEnvelope, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (vnetName === null || vnetName === undefined || typeof vnetName.valueOf() !== 'string') { + throw new Error('vnetName cannot be null or undefined and it must be of type string.'); + } + if (connectionEnvelope === null || connectionEnvelope === undefined) { + throw new Error('connectionEnvelope cannot be null or undefined.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/virtualNetworkConnections/{vnetName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{vnetName}', encodeURIComponent(vnetName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'PATCH'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (connectionEnvelope !== null && connectionEnvelope !== undefined) { + let requestModelMapper = new client.models['VnetInfo']().mapper(); + requestModel = client.serialize(requestModelMapper, connectionEnvelope, 'connectionEnvelope'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(connectionEnvelope, 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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['VnetInfo']().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 an app's Virtual Network gateway. + * + * Gets an app's Virtual Network gateway. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} vnetName Name of the Virtual Network. + * + * @param {string} gatewayName Name of the gateway. Currently, the only + * supported string is "primary". + * + * @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 VnetGateway} 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 _getVnetConnectionGateway(resourceGroupName, name, vnetName, gatewayName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (vnetName === null || vnetName === undefined || typeof vnetName.valueOf() !== 'string') { + throw new Error('vnetName cannot be null or undefined and it must be of type string.'); + } + if (gatewayName === null || gatewayName === undefined || typeof gatewayName.valueOf() !== 'string') { + throw new Error('gatewayName cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/virtualNetworkConnections/{vnetName}/gateways/{gatewayName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{vnetName}', encodeURIComponent(vnetName)); + requestUrl = requestUrl.replace('{gatewayName}', encodeURIComponent(gatewayName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 404) { + 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['VnetGateway']().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 Adds a gateway to a connected Virtual Network (PUT) or updates it + * (PATCH). + * + * Adds a gateway to a connected Virtual Network (PUT) or updates it (PATCH). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} vnetName Name of the Virtual Network. + * + * @param {string} gatewayName Name of the gateway. Currently, the only + * supported string is "primary". + * + * @param {object} connectionEnvelope The properties to update this gateway + * with. + * + * @param {string} [connectionEnvelope.vnetName] The Virtual Network name. + * + * @param {string} connectionEnvelope.vpnPackageUri The URI where the VPN + * package can be downloaded. + * + * @param {string} [connectionEnvelope.kind] Kind of resource. + * + * @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 VnetGateway} 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 _createOrUpdateVnetConnectionGateway(resourceGroupName, name, vnetName, gatewayName, connectionEnvelope, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (vnetName === null || vnetName === undefined || typeof vnetName.valueOf() !== 'string') { + throw new Error('vnetName cannot be null or undefined and it must be of type string.'); + } + if (gatewayName === null || gatewayName === undefined || typeof gatewayName.valueOf() !== 'string') { + throw new Error('gatewayName cannot be null or undefined and it must be of type string.'); + } + if (connectionEnvelope === null || connectionEnvelope === undefined) { + throw new Error('connectionEnvelope cannot be null or undefined.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/virtualNetworkConnections/{vnetName}/gateways/{gatewayName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{vnetName}', encodeURIComponent(vnetName)); + requestUrl = requestUrl.replace('{gatewayName}', encodeURIComponent(gatewayName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'PUT'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (connectionEnvelope !== null && connectionEnvelope !== undefined) { + let requestModelMapper = new client.models['VnetGateway']().mapper(); + requestModel = client.serialize(requestModelMapper, connectionEnvelope, 'connectionEnvelope'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(connectionEnvelope, 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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['VnetGateway']().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 Adds a gateway to a connected Virtual Network (PUT) or updates it + * (PATCH). + * + * Adds a gateway to a connected Virtual Network (PUT) or updates it (PATCH). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} vnetName Name of the Virtual Network. + * + * @param {string} gatewayName Name of the gateway. Currently, the only + * supported string is "primary". + * + * @param {object} connectionEnvelope The properties to update this gateway + * with. + * + * @param {string} [connectionEnvelope.vnetName] The Virtual Network name. + * + * @param {string} connectionEnvelope.vpnPackageUri The URI where the VPN + * package can be downloaded. + * + * @param {string} [connectionEnvelope.kind] Kind of resource. + * + * @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 VnetGateway} 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 _updateVnetConnectionGateway(resourceGroupName, name, vnetName, gatewayName, connectionEnvelope, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (vnetName === null || vnetName === undefined || typeof vnetName.valueOf() !== 'string') { + throw new Error('vnetName cannot be null or undefined and it must be of type string.'); + } + if (gatewayName === null || gatewayName === undefined || typeof gatewayName.valueOf() !== 'string') { + throw new Error('gatewayName cannot be null or undefined and it must be of type string.'); + } + if (connectionEnvelope === null || connectionEnvelope === undefined) { + throw new Error('connectionEnvelope cannot be null or undefined.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/virtualNetworkConnections/{vnetName}/gateways/{gatewayName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{vnetName}', encodeURIComponent(vnetName)); + requestUrl = requestUrl.replace('{gatewayName}', encodeURIComponent(gatewayName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'PATCH'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (connectionEnvelope !== null && connectionEnvelope !== undefined) { + let requestModelMapper = new client.models['VnetGateway']().mapper(); + requestModel = client.serialize(requestModelMapper, connectionEnvelope, 'connectionEnvelope'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(connectionEnvelope, 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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['VnetGateway']().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 List webjobs for an app, or a deployment slot. + * + * List webjobs for an app, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @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 WebJobCollection} 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 _listWebJobs(resourceGroupName, name, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/webjobs'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['WebJobCollection']().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 Get webjob information for an app, or a deployment slot. + * + * Get webjob information for an app, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} webJobName Name of the web job. + * + * @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 WebJob} 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 _getWebJob(resourceGroupName, name, webJobName, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (webJobName === null || webJobName === undefined || typeof webJobName.valueOf() !== 'string') { + throw new Error('webJobName cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/webjobs/{webJobName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{webJobName}', encodeURIComponent(webJobName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['WebJob']().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 Creates a new web, mobile, or API app in an existing resource + * group, or updates an existing app. + * + * Creates a new web, mobile, or API app in an existing resource group, or + * updates an existing app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Unique name of the app to create or update. To create + * or update a deployment slot, use the {slot} parameter. + * + * @param {object} siteEnvelope A JSON representation of the app properties. + * See example. + * + * @param {boolean} [siteEnvelope.enabled] true if the app is + * enabled; otherwise, false. Setting this value to false disables + * the app (takes the app offline). + * + * @param {array} [siteEnvelope.hostNameSslStates] Hostname SSL states are used + * to manage the SSL bindings for app's hostnames. + * + * @param {string} [siteEnvelope.serverFarmId] Resource ID of the associated + * App Service plan, formatted as: + * "/subscriptions/{subscriptionID}/resourceGroups/{groupName}/providers/Microsoft.Web/serverfarms/{appServicePlanName}". + * + * @param {boolean} [siteEnvelope.reserved] true if reserved; + * otherwise, false. + * + * @param {boolean} [siteEnvelope.isXenon] Obsolete: Hyper-V sandbox. + * + * @param {boolean} [siteEnvelope.hyperV] Hyper-V sandbox. + * + * @param {object} [siteEnvelope.siteConfig] Configuration of the app. + * + * @param {number} [siteEnvelope.siteConfig.numberOfWorkers] Number of workers. + * + * @param {array} [siteEnvelope.siteConfig.defaultDocuments] Default documents. + * + * @param {string} [siteEnvelope.siteConfig.netFrameworkVersion] .NET Framework + * version. + * + * @param {string} [siteEnvelope.siteConfig.phpVersion] Version of PHP. + * + * @param {string} [siteEnvelope.siteConfig.pythonVersion] Version of Python. + * + * @param {string} [siteEnvelope.siteConfig.nodeVersion] Version of Node.js. + * + * @param {string} [siteEnvelope.siteConfig.linuxFxVersion] Linux App Framework + * and version + * + * @param {string} [siteEnvelope.siteConfig.windowsFxVersion] Xenon App + * Framework and version + * + * @param {boolean} [siteEnvelope.siteConfig.requestTracingEnabled] + * true if request tracing is enabled; otherwise, + * false. + * + * @param {date} [siteEnvelope.siteConfig.requestTracingExpirationTime] Request + * tracing expiration time. + * + * @param {boolean} [siteEnvelope.siteConfig.remoteDebuggingEnabled] + * true if remote debugging is enabled; otherwise, + * false. + * + * @param {string} [siteEnvelope.siteConfig.remoteDebuggingVersion] Remote + * debugging version. + * + * @param {boolean} [siteEnvelope.siteConfig.httpLoggingEnabled] + * true if HTTP logging is enabled; otherwise, false. + * + * @param {number} [siteEnvelope.siteConfig.logsDirectorySizeLimit] HTTP logs + * directory size limit. + * + * @param {boolean} [siteEnvelope.siteConfig.detailedErrorLoggingEnabled] + * true if detailed error logging is enabled; otherwise, + * false. + * + * @param {string} [siteEnvelope.siteConfig.publishingUsername] Publishing user + * name. + * + * @param {array} [siteEnvelope.siteConfig.appSettings] Application settings. + * + * @param {object} [siteEnvelope.siteConfig.azureStorageAccounts] User-provided + * Azure storage accounts. + * + * @param {array} [siteEnvelope.siteConfig.connectionStrings] Connection + * strings. + * + * @param {array} [siteEnvelope.siteConfig.handlerMappings] Handler mappings. + * + * @param {string} [siteEnvelope.siteConfig.documentRoot] Document root. + * + * @param {string} [siteEnvelope.siteConfig.scmType] SCM type. Possible values + * include: 'None', 'Dropbox', 'Tfs', 'LocalGit', 'GitHub', 'CodePlexGit', + * 'CodePlexHg', 'BitbucketGit', 'BitbucketHg', 'ExternalGit', 'ExternalHg', + * 'OneDrive', 'VSO' + * + * @param {boolean} [siteEnvelope.siteConfig.use32BitWorkerProcess] + * true to use 32-bit worker process; otherwise, + * false. + * + * @param {boolean} [siteEnvelope.siteConfig.webSocketsEnabled] + * true if WebSocket is enabled; otherwise, false. + * + * @param {boolean} [siteEnvelope.siteConfig.alwaysOn] true if + * Always On is enabled; otherwise, false. + * + * @param {string} [siteEnvelope.siteConfig.javaVersion] Java version. + * + * @param {string} [siteEnvelope.siteConfig.javaContainer] Java container. + * + * @param {string} [siteEnvelope.siteConfig.javaContainerVersion] Java + * container version. + * + * @param {string} [siteEnvelope.siteConfig.appCommandLine] App command line to + * launch. + * + * @param {string} [siteEnvelope.siteConfig.managedPipelineMode] Managed + * pipeline mode. Possible values include: 'Integrated', 'Classic' + * + * @param {array} [siteEnvelope.siteConfig.virtualApplications] Virtual + * applications. + * + * @param {string} [siteEnvelope.siteConfig.loadBalancing] Site load balancing. + * Possible values include: 'WeightedRoundRobin', 'LeastRequests', + * 'LeastResponseTime', 'WeightedTotalTraffic', 'RequestHash' + * + * @param {object} [siteEnvelope.siteConfig.experiments] This is work around + * for polymophic types. + * + * @param {array} [siteEnvelope.siteConfig.experiments.rampUpRules] List of + * ramp-up rules. + * + * @param {object} [siteEnvelope.siteConfig.limits] Site limits. + * + * @param {number} [siteEnvelope.siteConfig.limits.maxPercentageCpu] Maximum + * allowed CPU usage percentage. + * + * @param {number} [siteEnvelope.siteConfig.limits.maxMemoryInMb] Maximum + * allowed memory usage in MB. + * + * @param {number} [siteEnvelope.siteConfig.limits.maxDiskSizeInMb] Maximum + * allowed disk size usage in MB. + * + * @param {boolean} [siteEnvelope.siteConfig.autoHealEnabled] true + * if Auto Heal is enabled; otherwise, false. + * + * @param {object} [siteEnvelope.siteConfig.autoHealRules] Auto Heal rules. + * + * @param {object} [siteEnvelope.siteConfig.autoHealRules.triggers] Conditions + * that describe when to execute the auto-heal actions. + * + * @param {object} [siteEnvelope.siteConfig.autoHealRules.triggers.requests] A + * rule based on total requests. + * + * @param {number} + * [siteEnvelope.siteConfig.autoHealRules.triggers.requests.count] Request + * Count. + * + * @param {string} + * [siteEnvelope.siteConfig.autoHealRules.triggers.requests.timeInterval] Time + * interval. + * + * @param {number} + * [siteEnvelope.siteConfig.autoHealRules.triggers.privateBytesInKB] A rule + * based on private bytes. + * + * @param {array} [siteEnvelope.siteConfig.autoHealRules.triggers.statusCodes] + * A rule based on status codes. + * + * @param {object} + * [siteEnvelope.siteConfig.autoHealRules.triggers.slowRequests] A rule based + * on request execution time. + * + * @param {string} + * [siteEnvelope.siteConfig.autoHealRules.triggers.slowRequests.timeTaken] Time + * taken. + * + * @param {number} + * [siteEnvelope.siteConfig.autoHealRules.triggers.slowRequests.count] Request + * Count. + * + * @param {string} + * [siteEnvelope.siteConfig.autoHealRules.triggers.slowRequests.timeInterval] + * Time interval. + * + * @param {object} [siteEnvelope.siteConfig.autoHealRules.actions] Actions to + * be executed when a rule is triggered. + * + * @param {string} [siteEnvelope.siteConfig.autoHealRules.actions.actionType] + * Predefined action to be taken. Possible values include: 'Recycle', + * 'LogEvent', 'CustomAction' + * + * @param {object} [siteEnvelope.siteConfig.autoHealRules.actions.customAction] + * Custom action to be taken. + * + * @param {string} + * [siteEnvelope.siteConfig.autoHealRules.actions.customAction.exe] Executable + * to be run. + * + * @param {string} + * [siteEnvelope.siteConfig.autoHealRules.actions.customAction.parameters] + * Parameters for the executable. + * + * @param {string} + * [siteEnvelope.siteConfig.autoHealRules.actions.minProcessExecutionTime] + * Minimum time the process must execute + * before taking the action + * + * @param {string} [siteEnvelope.siteConfig.tracingOptions] Tracing options. + * + * @param {string} [siteEnvelope.siteConfig.vnetName] Virtual Network name. + * + * @param {object} [siteEnvelope.siteConfig.cors] Cross-Origin Resource Sharing + * (CORS) settings. + * + * @param {array} [siteEnvelope.siteConfig.cors.allowedOrigins] Gets or sets + * the list of origins that should be allowed to make cross-origin + * calls (for example: http://example.com:12345). Use "*" to allow all. + * + * @param {object} [siteEnvelope.siteConfig.push] Push endpoint settings. + * + * @param {boolean} siteEnvelope.siteConfig.push.isPushEnabled Gets or sets a + * flag indicating whether the Push endpoint is enabled. + * + * @param {string} [siteEnvelope.siteConfig.push.tagWhitelistJson] Gets or sets + * a JSON string containing a list of tags that are whitelisted for use by the + * push registration endpoint. + * + * @param {string} [siteEnvelope.siteConfig.push.tagsRequiringAuth] Gets or + * sets a JSON string containing a list of tags that require user + * authentication to be used in the push registration endpoint. + * Tags can consist of alphanumeric characters and the following: + * '_', '@', '#', '.', ':', '-'. + * Validation should be performed at the PushRequestHandler. + * + * @param {string} [siteEnvelope.siteConfig.push.dynamicTagsJson] Gets or sets + * a JSON string containing a list of dynamic tags that will be evaluated from + * user claims in the push registration endpoint. + * + * @param {string} [siteEnvelope.siteConfig.push.kind] Kind of resource. + * + * @param {object} [siteEnvelope.siteConfig.apiDefinition] Information about + * the formal API definition for the app. + * + * @param {string} [siteEnvelope.siteConfig.apiDefinition.url] The URL of the + * API definition. + * + * @param {string} [siteEnvelope.siteConfig.autoSwapSlotName] Auto-swap slot + * name. + * + * @param {boolean} [siteEnvelope.siteConfig.localMySqlEnabled] + * true to enable local MySQL; otherwise, false. + * + * @param {number} [siteEnvelope.siteConfig.managedServiceIdentityId] Managed + * Service Identity Id + * + * @param {number} [siteEnvelope.siteConfig.xManagedServiceIdentityId] Explicit + * Managed Service Identity Id + * + * @param {array} [siteEnvelope.siteConfig.ipSecurityRestrictions] IP security + * restrictions. + * + * @param {boolean} [siteEnvelope.siteConfig.http20Enabled] Http20Enabled: + * configures a web site to allow clients to connect over http2.0 + * + * @param {string} [siteEnvelope.siteConfig.minTlsVersion] MinTlsVersion: + * configures the minimum version of TLS required for SSL requests. Possible + * values include: '1.0', '1.1', '1.2' + * + * @param {string} [siteEnvelope.siteConfig.ftpsState] State of FTP / FTPS + * service. Possible values include: 'AllAllowed', 'FtpsOnly', 'Disabled' + * + * @param {number} [siteEnvelope.siteConfig.reservedInstanceCount] Number of + * reserved instances. + * This setting only applies to the Consumption Plan + * + * @param {boolean} [siteEnvelope.scmSiteAlsoStopped] true to stop + * SCM (KUDU) site when the app is stopped; otherwise, false. The + * default is false. + * + * @param {object} [siteEnvelope.hostingEnvironmentProfile] App Service + * Environment to use for the app. + * + * @param {string} [siteEnvelope.hostingEnvironmentProfile.id] Resource ID of + * the App Service Environment. + * + * @param {boolean} [siteEnvelope.clientAffinityEnabled] true to + * enable client affinity; false to stop sending session affinity + * cookies, which route client requests in the same session to the same + * instance. Default is true. + * + * @param {boolean} [siteEnvelope.clientCertEnabled] true to + * enable client certificate authentication (TLS mutual authentication); + * otherwise, false. Default is false. + * + * @param {boolean} [siteEnvelope.hostNamesDisabled] true to + * disable the public hostnames of the app; otherwise, false. + * If true, the app is only accessible via API management process. + * + * @param {number} [siteEnvelope.containerSize] Size of the function container. + * + * @param {number} [siteEnvelope.dailyMemoryTimeQuota] Maximum allowed daily + * memory-time quota (applicable on dynamic apps only). + * + * @param {object} [siteEnvelope.cloningInfo] If specified during app creation, + * the app is cloned from a source app. + * + * @param {uuid} [siteEnvelope.cloningInfo.correlationId] Correlation ID of + * cloning operation. This ID ties multiple cloning operations + * together to use the same snapshot. + * + * @param {boolean} [siteEnvelope.cloningInfo.overwrite] true to + * overwrite destination app; otherwise, false. + * + * @param {boolean} [siteEnvelope.cloningInfo.cloneCustomHostNames] + * true to clone custom hostnames from source app; otherwise, + * false. + * + * @param {boolean} [siteEnvelope.cloningInfo.cloneSourceControl] + * true to clone source control from source app; otherwise, + * false. + * + * @param {string} siteEnvelope.cloningInfo.sourceWebAppId ARM resource ID of + * the source app. App resource ID is of the form + * /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName} + * for production slots and + * /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/slots/{slotName} + * for other slots. + * + * @param {string} [siteEnvelope.cloningInfo.hostingEnvironment] App Service + * Environment. + * + * @param {object} [siteEnvelope.cloningInfo.appSettingsOverrides] Application + * setting overrides for cloned app. If specified, these settings override the + * settings cloned + * from source app. Otherwise, application settings from source app are + * retained. + * + * @param {boolean} [siteEnvelope.cloningInfo.configureLoadBalancing] + * true to configure load balancing for source and destination + * app. + * + * @param {string} [siteEnvelope.cloningInfo.trafficManagerProfileId] ARM + * resource ID of the Traffic Manager profile to use, if it exists. Traffic + * Manager resource ID is of the form + * /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/trafficManagerProfiles/{profileName}. + * + * @param {string} [siteEnvelope.cloningInfo.trafficManagerProfileName] Name of + * Traffic Manager profile to create. This is only needed if Traffic Manager + * profile does not already exist. + * + * @param {boolean} [siteEnvelope.httpsOnly] HttpsOnly: configures a web site + * to accept only https requests. Issues redirect for + * http requests + * + * @param {object} [siteEnvelope.identity] + * + * @param {string} [siteEnvelope.identity.type] Type of managed service + * identity. Possible values include: 'SystemAssigned', 'UserAssigned' + * + * @param {array} [siteEnvelope.identity.identityIds] Array of UserAssigned + * managed service identities. + * + * @param {string} [siteEnvelope.kind] Kind of resource. + * + * @param {string} siteEnvelope.location Resource Location. + * + * @param {object} [siteEnvelope.tags] Resource tags. + * + * @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 Site} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _beginCreateOrUpdate(resourceGroupName, name, siteEnvelope, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (siteEnvelope === null || siteEnvelope === undefined) { + throw new Error('siteEnvelope cannot be null or undefined.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'PUT'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (siteEnvelope !== null && siteEnvelope !== undefined) { + let requestModelMapper = new client.models['Site']().mapper(); + requestModel = client.serialize(requestModelMapper, siteEnvelope, 'siteEnvelope'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(siteEnvelope, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 202) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['Site']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + // Deserialize Response + if (statusCode === 202) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['Site']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError1 = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError1.request = msRest.stripRequest(httpRequest); + deserializationError1.response = msRest.stripResponse(response); + return callback(deserializationError1); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * @summary Restores a specific backup to another app (or deployment slot, if + * specified). + * + * Restores a specific backup to another app (or deployment slot, if + * specified). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} backupId ID of the backup. + * + * @param {object} request Information on restore request . + * + * @param {string} request.storageAccountUrl SAS URL to the container. + * + * @param {string} [request.blobName] Name of a blob which contains the backup. + * + * @param {boolean} request.overwrite true if the restore + * operation can overwrite target app; otherwise, false. + * true is needed if trying to restore over an existing app. + * + * @param {string} [request.siteName] Name of an app. + * + * @param {array} [request.databases] Collection of databases which should be + * restored. This list has to match the list of databases included in the + * backup. + * + * @param {boolean} [request.ignoreConflictingHostNames] Changes a logic when + * restoring an app with custom domains. true to remove custom + * domains automatically. If false, custom domains are added to + * the app's object when it is being restored, but that might fail due to + * conflicts during the operation. + * + * @param {boolean} [request.ignoreDatabases] Ignore the databases and only + * restore the site content + * + * @param {string} [request.appServicePlan] Specify app service plan that will + * own restored site. + * + * @param {string} [request.operationType] Operation type. Possible values + * include: 'Default', 'Clone', 'Relocation', 'Snapshot', 'CloudFS' + * + * @param {boolean} [request.adjustConnectionStrings] true if + * SiteConfig.ConnectionStrings should be set in new app; otherwise, + * false. + * + * @param {string} [request.hostingEnvironment] App Service Environment name, + * if needed (only when restoring an app to an App Service Environment). + * + * @param {string} [request.kind] Kind of resource. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _beginRestore(resourceGroupName, name, backupId, request, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (backupId === null || backupId === undefined || typeof backupId.valueOf() !== 'string') { + throw new Error('backupId cannot be null or undefined and it must be of type string.'); + } + if (request === null || request === undefined) { + throw new Error('request cannot be null or undefined.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/backups/{backupId}/restore'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{backupId}', encodeURIComponent(backupId)); + 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 (request !== null && request !== undefined) { + let requestModelMapper = new client.models['RestoreRequest']().mapper(); + requestModel = client.serialize(requestModelMapper, request, 'request'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(request, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 202) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + + return callback(null, result, httpRequest, response); + }); +} + +/** + * @summary Gets the Git/FTP publishing credentials of an app. + * + * Gets the Git/FTP publishing credentials of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @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 User} 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 _beginListPublishingCredentials(resourceGroupName, name, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/publishingcredentials/list'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + 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]; + } + } + } + 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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['User']().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 Invoke the MSDeploy web app extension. + * + * Invoke the MSDeploy web app extension. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {object} mSDeploy Details of MSDeploy operation + * + * @param {string} [mSDeploy.packageUri] Package URI + * + * @param {string} [mSDeploy.connectionString] SQL Connection String + * + * @param {string} [mSDeploy.dbType] Database Type + * + * @param {string} [mSDeploy.setParametersXmlFileUri] URI of MSDeploy + * Parameters file. Must not be set if SetParameters is used. + * + * @param {object} [mSDeploy.setParameters] MSDeploy Parameters. Must not be + * set if SetParametersXmlFileUri is used. + * + * @param {boolean} [mSDeploy.skipAppData] Controls whether the MSDeploy + * operation skips the App_Data directory. + * If set to true, the existing App_Data directory on the + * destination + * will not be deleted, and any App_Data directory in the source will be + * ignored. + * Setting is false by default. + * + * @param {boolean} [mSDeploy.appOffline] Sets the AppOffline rule while the + * MSDeploy operation executes. + * Setting is false by default. + * + * @param {string} [mSDeploy.kind] Kind of resource. + * + * @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 MSDeployStatus} 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 _beginCreateMSDeployOperation(resourceGroupName, name, mSDeploy, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (mSDeploy === null || mSDeploy === undefined) { + throw new Error('mSDeploy cannot be null or undefined.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/extensions/MSDeploy'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'PUT'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (mSDeploy !== null && mSDeploy !== undefined) { + let requestModelMapper = new client.models['MSDeploy']().mapper(); + requestModel = client.serialize(requestModelMapper, mSDeploy, 'mSDeploy'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(mSDeploy, 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 !== 201 && statusCode !== 409) { + 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 === 201) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['MSDeployStatus']().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 Create function for web site, or a deployment slot. + * + * Create function for web site, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} functionName Function name. + * + * @param {object} functionEnvelope Function details. + * + * @param {string} [functionEnvelope.functionAppId] Function App ID. + * + * @param {string} [functionEnvelope.scriptRootPathHref] Script root path URI. + * + * @param {string} [functionEnvelope.scriptHref] Script URI. + * + * @param {string} [functionEnvelope.configHref] Config URI. + * + * @param {string} [functionEnvelope.secretsFileHref] Secrets file URI. + * + * @param {string} [functionEnvelope.href] Function URI. + * + * @param {object} [functionEnvelope.config] Config information. + * + * @param {object} [functionEnvelope.files] File list. + * + * @param {string} [functionEnvelope.testData] Test data used when testing via + * the Azure Portal. + * + * @param {string} [functionEnvelope.kind] Kind of resource. + * + * @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 FunctionEnvelope} 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 _beginCreateFunction(resourceGroupName, name, functionName, functionEnvelope, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (functionName === null || functionName === undefined || typeof functionName.valueOf() !== 'string') { + throw new Error('functionName cannot be null or undefined and it must be of type string.'); + } + if (functionEnvelope === null || functionEnvelope === undefined) { + throw new Error('functionEnvelope cannot be null or undefined.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/functions/{functionName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{functionName}', encodeURIComponent(functionName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'PUT'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (functionEnvelope !== null && functionEnvelope !== undefined) { + let requestModelMapper = new client.models['FunctionEnvelope']().mapper(); + requestModel = client.serialize(requestModelMapper, functionEnvelope, 'functionEnvelope'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(functionEnvelope, 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 !== 201) { + 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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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 === 201) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['FunctionEnvelope']().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 Invoke the MSDeploy web app extension. + * + * Invoke the MSDeploy web app extension. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {string} instanceId ID of web app instance. + * + * @param {object} mSDeploy Details of MSDeploy operation + * + * @param {string} [mSDeploy.packageUri] Package URI + * + * @param {string} [mSDeploy.connectionString] SQL Connection String + * + * @param {string} [mSDeploy.dbType] Database Type + * + * @param {string} [mSDeploy.setParametersXmlFileUri] URI of MSDeploy + * Parameters file. Must not be set if SetParameters is used. + * + * @param {object} [mSDeploy.setParameters] MSDeploy Parameters. Must not be + * set if SetParametersXmlFileUri is used. + * + * @param {boolean} [mSDeploy.skipAppData] Controls whether the MSDeploy + * operation skips the App_Data directory. + * If set to true, the existing App_Data directory on the + * destination + * will not be deleted, and any App_Data directory in the source will be + * ignored. + * Setting is false by default. + * + * @param {boolean} [mSDeploy.appOffline] Sets the AppOffline rule while the + * MSDeploy operation executes. + * Setting is false by default. + * + * @param {string} [mSDeploy.kind] Kind of resource. + * + * @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 MSDeployStatus} 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 _beginCreateInstanceMSDeployOperation(resourceGroupName, name, instanceId, mSDeploy, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (instanceId === null || instanceId === undefined || typeof instanceId.valueOf() !== 'string') { + throw new Error('instanceId cannot be null or undefined and it must be of type string.'); + } + if (mSDeploy === null || mSDeploy === undefined) { + throw new Error('mSDeploy cannot be null or undefined.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}/extensions/MSDeploy'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{instanceId}', encodeURIComponent(instanceId)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'PUT'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (mSDeploy !== null && mSDeploy !== undefined) { + let requestModelMapper = new client.models['MSDeploy']().mapper(); + requestModel = client.serialize(requestModelMapper, mSDeploy, 'mSDeploy'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(mSDeploy, 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 !== 201 && statusCode !== 409) { + 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 === 201) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['MSDeployStatus']().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 Restores a web app. + * + * Restores a web app. + * + * @param {string} subscriptionName Azure subscription. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {object} migrationOptions Migration migrationOptions. + * + * @param {string} migrationOptions.azurefilesConnectionString AzureFiles + * connection string. + * + * @param {string} migrationOptions.azurefilesShare AzureFiles share. + * + * @param {boolean} [migrationOptions.switchSiteAfterMigration] + * trueif the app should be switched over; otherwise, + * false. + * + * @param {boolean} [migrationOptions.blockWriteAccessToSite] true + * if the app should be read only during copy operation; otherwise, + * false. + * + * @param {string} [migrationOptions.kind] Kind of resource. + * + * @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 StorageMigrationResponse} 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 _beginMigrateStorage(subscriptionName, resourceGroupName, name, migrationOptions, 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 (subscriptionName === null || subscriptionName === undefined || typeof subscriptionName.valueOf() !== 'string') { + throw new Error('subscriptionName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (migrationOptions === null || migrationOptions === undefined) { + throw new Error('migrationOptions cannot be null or undefined.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/migrate'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('subscriptionName=' + encodeURIComponent(subscriptionName)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'PUT'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (migrationOptions !== null && migrationOptions !== undefined) { + let requestModelMapper = new client.models['StorageMigrationOptions']().mapper(); + requestModel = client.serialize(requestModelMapper, migrationOptions, 'migrationOptions'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(migrationOptions, 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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['StorageMigrationResponse']().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 Migrates a local (in-app) MySql database to a remote MySql + * database. + * + * Migrates a local (in-app) MySql database to a remote MySql database. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {object} migrationRequestEnvelope MySql migration options. + * + * @param {string} migrationRequestEnvelope.connectionString Connection string + * to the remote MySQL database. + * + * @param {string} migrationRequestEnvelope.migrationType The type of migration + * operation to be done. Possible values include: 'LocalToRemote', + * 'RemoteToLocal' + * + * @param {string} [migrationRequestEnvelope.kind] Kind of resource. + * + * @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 Operation} 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 _beginMigrateMySql(resourceGroupName, name, migrationRequestEnvelope, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (migrationRequestEnvelope === null || migrationRequestEnvelope === undefined) { + throw new Error('migrationRequestEnvelope cannot be null or undefined.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/migratemysql'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + 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 (migrationRequestEnvelope !== null && migrationRequestEnvelope !== undefined) { + let requestModelMapper = new client.models['MigrateMySqlRequest']().mapper(); + requestModel = client.serialize(requestModelMapper, migrationRequestEnvelope, 'migrationRequestEnvelope'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(migrationRequestEnvelope, 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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['Operation']().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 Restores an app from a backup blob in Azure Storage. + * + * Restores an app from a backup blob in Azure Storage. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} request Information on restore request . + * + * @param {string} request.storageAccountUrl SAS URL to the container. + * + * @param {string} [request.blobName] Name of a blob which contains the backup. + * + * @param {boolean} request.overwrite true if the restore + * operation can overwrite target app; otherwise, false. + * true is needed if trying to restore over an existing app. + * + * @param {string} [request.siteName] Name of an app. + * + * @param {array} [request.databases] Collection of databases which should be + * restored. This list has to match the list of databases included in the + * backup. + * + * @param {boolean} [request.ignoreConflictingHostNames] Changes a logic when + * restoring an app with custom domains. true to remove custom + * domains automatically. If false, custom domains are added to + * the app's object when it is being restored, but that might fail due to + * conflicts during the operation. + * + * @param {boolean} [request.ignoreDatabases] Ignore the databases and only + * restore the site content + * + * @param {string} [request.appServicePlan] Specify app service plan that will + * own restored site. + * + * @param {string} [request.operationType] Operation type. Possible values + * include: 'Default', 'Clone', 'Relocation', 'Snapshot', 'CloudFS' + * + * @param {boolean} [request.adjustConnectionStrings] true if + * SiteConfig.ConnectionStrings should be set in new app; otherwise, + * false. + * + * @param {string} [request.hostingEnvironment] App Service Environment name, + * if needed (only when restoring an app to an App Service Environment). + * + * @param {string} [request.kind] Kind of resource. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _beginRestoreFromBackupBlob(resourceGroupName, name, request, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (request === null || request === undefined) { + throw new Error('request cannot be null or undefined.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/restoreFromBackupBlob'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + 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 (request !== null && request !== undefined) { + let requestModelMapper = new client.models['RestoreRequest']().mapper(); + requestModel = client.serialize(requestModelMapper, request, 'request'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(request, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 202) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + + return callback(null, result, httpRequest, response); + }); +} + +/** + * @summary Restores a deleted web app to this web app. + * + * Restores a deleted web app to this web app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {object} restoreRequest Deleted web app restore information. + * + * @param {string} [restoreRequest.deletedSiteId] ARM resource ID of the + * deleted app. Example: + * /subscriptions/{subId}/providers/Microsoft.Web/deletedSites/{deletedSiteId} + * + * @param {boolean} [restoreRequest.recoverConfiguration] If true, deleted site + * configuration, in addition to content, will be restored. + * + * @param {string} [restoreRequest.snapshotTime] Point in time to restore the + * deleted app from, formatted as a DateTime string. + * If unspecified, default value is the time that the app was deleted. + * + * @param {string} [restoreRequest.kind] Kind of resource. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _beginRestoreFromDeletedApp(resourceGroupName, name, restoreRequest, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (restoreRequest === null || restoreRequest === undefined) { + throw new Error('restoreRequest cannot be null or undefined.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/restoreFromDeletedApp'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + 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 (restoreRequest !== null && restoreRequest !== undefined) { + let requestModelMapper = new client.models['DeletedAppRestoreRequest']().mapper(); + requestModel = client.serialize(requestModelMapper, restoreRequest, 'restoreRequest'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(restoreRequest, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 202) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + + return callback(null, result, httpRequest, response); + }); +} + +/** + * @summary Restores a web app from a snapshot. + * + * Restores a web app from a snapshot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {object} restoreRequest Snapshot restore settings. Snapshot + * information can be obtained by calling GetDeletedSites or GetSiteSnapshots + * API. + * + * @param {string} [restoreRequest.snapshotTime] Point in time in which the app + * restore should be done, formatted as a DateTime string. + * + * @param {object} [restoreRequest.recoverySource] Optional. Specifies the web + * app that snapshot contents will be retrieved from. + * If empty, the targeted web app will be used as the source. + * + * @param {string} [restoreRequest.recoverySource.location] Geographical + * location of the source web app, e.g. SouthEastAsia, SouthCentralUS + * + * @param {string} [restoreRequest.recoverySource.id] ARM resource ID of the + * source app. + * /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName} + * for production slots and + * /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/slots/{slotName} + * for other slots. + * + * @param {boolean} restoreRequest.overwrite If true the restore + * operation can overwrite source app; otherwise, false. + * + * @param {boolean} [restoreRequest.recoverConfiguration] If true, site + * configuration, in addition to content, will be reverted. + * + * @param {boolean} [restoreRequest.ignoreConflictingHostNames] If true, custom + * hostname conflicts will be ignored when recovering to a target web app. + * This setting is only necessary when RecoverConfiguration is enabled. + * + * @param {string} [restoreRequest.kind] Kind of resource. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _beginRestoreSnapshot(resourceGroupName, name, restoreRequest, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (restoreRequest === null || restoreRequest === undefined) { + throw new Error('restoreRequest cannot be null or undefined.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/restoreSnapshot'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + 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 (restoreRequest !== null && restoreRequest !== undefined) { + let requestModelMapper = new client.models['SnapshotRestoreRequest']().mapper(); + requestModel = client.serialize(requestModelMapper, restoreRequest, 'restoreRequest'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(restoreRequest, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 202) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + + return callback(null, result, httpRequest, response); + }); +} + +/** + * @summary Install site extension on a web site, or a deployment slot. + * + * Install site extension on a web site, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} siteExtensionId Site extension name. + * + * @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 SiteExtensionInfo} 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 _beginInstallSiteExtension(resourceGroupName, name, siteExtensionId, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (siteExtensionId === null || siteExtensionId === undefined || typeof siteExtensionId.valueOf() !== 'string') { + throw new Error('siteExtensionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/siteextensions/{siteExtensionId}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{siteExtensionId}', encodeURIComponent(siteExtensionId)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'PUT'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 201 && statusCode !== 429) { + 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['SiteExtensionInfo']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + // Deserialize Response + if (statusCode === 201) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['SiteExtensionInfo']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError1 = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError1.request = msRest.stripRequest(httpRequest); + deserializationError1.response = msRest.stripResponse(response); + return callback(deserializationError1); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * @summary Creates a new web, mobile, or API app in an existing resource + * group, or updates an existing app. + * + * Creates a new web, mobile, or API app in an existing resource group, or + * updates an existing app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Unique name of the app to create or update. To create + * or update a deployment slot, use the {slot} parameter. + * + * @param {object} siteEnvelope A JSON representation of the app properties. + * See example. + * + * @param {boolean} [siteEnvelope.enabled] true if the app is + * enabled; otherwise, false. Setting this value to false disables + * the app (takes the app offline). + * + * @param {array} [siteEnvelope.hostNameSslStates] Hostname SSL states are used + * to manage the SSL bindings for app's hostnames. + * + * @param {string} [siteEnvelope.serverFarmId] Resource ID of the associated + * App Service plan, formatted as: + * "/subscriptions/{subscriptionID}/resourceGroups/{groupName}/providers/Microsoft.Web/serverfarms/{appServicePlanName}". + * + * @param {boolean} [siteEnvelope.reserved] true if reserved; + * otherwise, false. + * + * @param {boolean} [siteEnvelope.isXenon] Obsolete: Hyper-V sandbox. + * + * @param {boolean} [siteEnvelope.hyperV] Hyper-V sandbox. + * + * @param {object} [siteEnvelope.siteConfig] Configuration of the app. + * + * @param {number} [siteEnvelope.siteConfig.numberOfWorkers] Number of workers. + * + * @param {array} [siteEnvelope.siteConfig.defaultDocuments] Default documents. + * + * @param {string} [siteEnvelope.siteConfig.netFrameworkVersion] .NET Framework + * version. + * + * @param {string} [siteEnvelope.siteConfig.phpVersion] Version of PHP. + * + * @param {string} [siteEnvelope.siteConfig.pythonVersion] Version of Python. + * + * @param {string} [siteEnvelope.siteConfig.nodeVersion] Version of Node.js. + * + * @param {string} [siteEnvelope.siteConfig.linuxFxVersion] Linux App Framework + * and version + * + * @param {string} [siteEnvelope.siteConfig.windowsFxVersion] Xenon App + * Framework and version + * + * @param {boolean} [siteEnvelope.siteConfig.requestTracingEnabled] + * true if request tracing is enabled; otherwise, + * false. + * + * @param {date} [siteEnvelope.siteConfig.requestTracingExpirationTime] Request + * tracing expiration time. + * + * @param {boolean} [siteEnvelope.siteConfig.remoteDebuggingEnabled] + * true if remote debugging is enabled; otherwise, + * false. + * + * @param {string} [siteEnvelope.siteConfig.remoteDebuggingVersion] Remote + * debugging version. + * + * @param {boolean} [siteEnvelope.siteConfig.httpLoggingEnabled] + * true if HTTP logging is enabled; otherwise, false. + * + * @param {number} [siteEnvelope.siteConfig.logsDirectorySizeLimit] HTTP logs + * directory size limit. + * + * @param {boolean} [siteEnvelope.siteConfig.detailedErrorLoggingEnabled] + * true if detailed error logging is enabled; otherwise, + * false. + * + * @param {string} [siteEnvelope.siteConfig.publishingUsername] Publishing user + * name. + * + * @param {array} [siteEnvelope.siteConfig.appSettings] Application settings. + * + * @param {object} [siteEnvelope.siteConfig.azureStorageAccounts] User-provided + * Azure storage accounts. + * + * @param {array} [siteEnvelope.siteConfig.connectionStrings] Connection + * strings. + * + * @param {array} [siteEnvelope.siteConfig.handlerMappings] Handler mappings. + * + * @param {string} [siteEnvelope.siteConfig.documentRoot] Document root. + * + * @param {string} [siteEnvelope.siteConfig.scmType] SCM type. Possible values + * include: 'None', 'Dropbox', 'Tfs', 'LocalGit', 'GitHub', 'CodePlexGit', + * 'CodePlexHg', 'BitbucketGit', 'BitbucketHg', 'ExternalGit', 'ExternalHg', + * 'OneDrive', 'VSO' + * + * @param {boolean} [siteEnvelope.siteConfig.use32BitWorkerProcess] + * true to use 32-bit worker process; otherwise, + * false. + * + * @param {boolean} [siteEnvelope.siteConfig.webSocketsEnabled] + * true if WebSocket is enabled; otherwise, false. + * + * @param {boolean} [siteEnvelope.siteConfig.alwaysOn] true if + * Always On is enabled; otherwise, false. + * + * @param {string} [siteEnvelope.siteConfig.javaVersion] Java version. + * + * @param {string} [siteEnvelope.siteConfig.javaContainer] Java container. + * + * @param {string} [siteEnvelope.siteConfig.javaContainerVersion] Java + * container version. + * + * @param {string} [siteEnvelope.siteConfig.appCommandLine] App command line to + * launch. + * + * @param {string} [siteEnvelope.siteConfig.managedPipelineMode] Managed + * pipeline mode. Possible values include: 'Integrated', 'Classic' + * + * @param {array} [siteEnvelope.siteConfig.virtualApplications] Virtual + * applications. + * + * @param {string} [siteEnvelope.siteConfig.loadBalancing] Site load balancing. + * Possible values include: 'WeightedRoundRobin', 'LeastRequests', + * 'LeastResponseTime', 'WeightedTotalTraffic', 'RequestHash' + * + * @param {object} [siteEnvelope.siteConfig.experiments] This is work around + * for polymophic types. + * + * @param {array} [siteEnvelope.siteConfig.experiments.rampUpRules] List of + * ramp-up rules. + * + * @param {object} [siteEnvelope.siteConfig.limits] Site limits. + * + * @param {number} [siteEnvelope.siteConfig.limits.maxPercentageCpu] Maximum + * allowed CPU usage percentage. + * + * @param {number} [siteEnvelope.siteConfig.limits.maxMemoryInMb] Maximum + * allowed memory usage in MB. + * + * @param {number} [siteEnvelope.siteConfig.limits.maxDiskSizeInMb] Maximum + * allowed disk size usage in MB. + * + * @param {boolean} [siteEnvelope.siteConfig.autoHealEnabled] true + * if Auto Heal is enabled; otherwise, false. + * + * @param {object} [siteEnvelope.siteConfig.autoHealRules] Auto Heal rules. + * + * @param {object} [siteEnvelope.siteConfig.autoHealRules.triggers] Conditions + * that describe when to execute the auto-heal actions. + * + * @param {object} [siteEnvelope.siteConfig.autoHealRules.triggers.requests] A + * rule based on total requests. + * + * @param {number} + * [siteEnvelope.siteConfig.autoHealRules.triggers.requests.count] Request + * Count. + * + * @param {string} + * [siteEnvelope.siteConfig.autoHealRules.triggers.requests.timeInterval] Time + * interval. + * + * @param {number} + * [siteEnvelope.siteConfig.autoHealRules.triggers.privateBytesInKB] A rule + * based on private bytes. + * + * @param {array} [siteEnvelope.siteConfig.autoHealRules.triggers.statusCodes] + * A rule based on status codes. + * + * @param {object} + * [siteEnvelope.siteConfig.autoHealRules.triggers.slowRequests] A rule based + * on request execution time. + * + * @param {string} + * [siteEnvelope.siteConfig.autoHealRules.triggers.slowRequests.timeTaken] Time + * taken. + * + * @param {number} + * [siteEnvelope.siteConfig.autoHealRules.triggers.slowRequests.count] Request + * Count. + * + * @param {string} + * [siteEnvelope.siteConfig.autoHealRules.triggers.slowRequests.timeInterval] + * Time interval. + * + * @param {object} [siteEnvelope.siteConfig.autoHealRules.actions] Actions to + * be executed when a rule is triggered. + * + * @param {string} [siteEnvelope.siteConfig.autoHealRules.actions.actionType] + * Predefined action to be taken. Possible values include: 'Recycle', + * 'LogEvent', 'CustomAction' + * + * @param {object} [siteEnvelope.siteConfig.autoHealRules.actions.customAction] + * Custom action to be taken. + * + * @param {string} + * [siteEnvelope.siteConfig.autoHealRules.actions.customAction.exe] Executable + * to be run. + * + * @param {string} + * [siteEnvelope.siteConfig.autoHealRules.actions.customAction.parameters] + * Parameters for the executable. + * + * @param {string} + * [siteEnvelope.siteConfig.autoHealRules.actions.minProcessExecutionTime] + * Minimum time the process must execute + * before taking the action + * + * @param {string} [siteEnvelope.siteConfig.tracingOptions] Tracing options. + * + * @param {string} [siteEnvelope.siteConfig.vnetName] Virtual Network name. + * + * @param {object} [siteEnvelope.siteConfig.cors] Cross-Origin Resource Sharing + * (CORS) settings. + * + * @param {array} [siteEnvelope.siteConfig.cors.allowedOrigins] Gets or sets + * the list of origins that should be allowed to make cross-origin + * calls (for example: http://example.com:12345). Use "*" to allow all. + * + * @param {object} [siteEnvelope.siteConfig.push] Push endpoint settings. + * + * @param {boolean} siteEnvelope.siteConfig.push.isPushEnabled Gets or sets a + * flag indicating whether the Push endpoint is enabled. + * + * @param {string} [siteEnvelope.siteConfig.push.tagWhitelistJson] Gets or sets + * a JSON string containing a list of tags that are whitelisted for use by the + * push registration endpoint. + * + * @param {string} [siteEnvelope.siteConfig.push.tagsRequiringAuth] Gets or + * sets a JSON string containing a list of tags that require user + * authentication to be used in the push registration endpoint. + * Tags can consist of alphanumeric characters and the following: + * '_', '@', '#', '.', ':', '-'. + * Validation should be performed at the PushRequestHandler. + * + * @param {string} [siteEnvelope.siteConfig.push.dynamicTagsJson] Gets or sets + * a JSON string containing a list of dynamic tags that will be evaluated from + * user claims in the push registration endpoint. + * + * @param {string} [siteEnvelope.siteConfig.push.kind] Kind of resource. + * + * @param {object} [siteEnvelope.siteConfig.apiDefinition] Information about + * the formal API definition for the app. + * + * @param {string} [siteEnvelope.siteConfig.apiDefinition.url] The URL of the + * API definition. + * + * @param {string} [siteEnvelope.siteConfig.autoSwapSlotName] Auto-swap slot + * name. + * + * @param {boolean} [siteEnvelope.siteConfig.localMySqlEnabled] + * true to enable local MySQL; otherwise, false. + * + * @param {number} [siteEnvelope.siteConfig.managedServiceIdentityId] Managed + * Service Identity Id + * + * @param {number} [siteEnvelope.siteConfig.xManagedServiceIdentityId] Explicit + * Managed Service Identity Id + * + * @param {array} [siteEnvelope.siteConfig.ipSecurityRestrictions] IP security + * restrictions. + * + * @param {boolean} [siteEnvelope.siteConfig.http20Enabled] Http20Enabled: + * configures a web site to allow clients to connect over http2.0 + * + * @param {string} [siteEnvelope.siteConfig.minTlsVersion] MinTlsVersion: + * configures the minimum version of TLS required for SSL requests. Possible + * values include: '1.0', '1.1', '1.2' + * + * @param {string} [siteEnvelope.siteConfig.ftpsState] State of FTP / FTPS + * service. Possible values include: 'AllAllowed', 'FtpsOnly', 'Disabled' + * + * @param {number} [siteEnvelope.siteConfig.reservedInstanceCount] Number of + * reserved instances. + * This setting only applies to the Consumption Plan + * + * @param {boolean} [siteEnvelope.scmSiteAlsoStopped] true to stop + * SCM (KUDU) site when the app is stopped; otherwise, false. The + * default is false. + * + * @param {object} [siteEnvelope.hostingEnvironmentProfile] App Service + * Environment to use for the app. + * + * @param {string} [siteEnvelope.hostingEnvironmentProfile.id] Resource ID of + * the App Service Environment. + * + * @param {boolean} [siteEnvelope.clientAffinityEnabled] true to + * enable client affinity; false to stop sending session affinity + * cookies, which route client requests in the same session to the same + * instance. Default is true. + * + * @param {boolean} [siteEnvelope.clientCertEnabled] true to + * enable client certificate authentication (TLS mutual authentication); + * otherwise, false. Default is false. + * + * @param {boolean} [siteEnvelope.hostNamesDisabled] true to + * disable the public hostnames of the app; otherwise, false. + * If true, the app is only accessible via API management process. + * + * @param {number} [siteEnvelope.containerSize] Size of the function container. + * + * @param {number} [siteEnvelope.dailyMemoryTimeQuota] Maximum allowed daily + * memory-time quota (applicable on dynamic apps only). + * + * @param {object} [siteEnvelope.cloningInfo] If specified during app creation, + * the app is cloned from a source app. + * + * @param {uuid} [siteEnvelope.cloningInfo.correlationId] Correlation ID of + * cloning operation. This ID ties multiple cloning operations + * together to use the same snapshot. + * + * @param {boolean} [siteEnvelope.cloningInfo.overwrite] true to + * overwrite destination app; otherwise, false. + * + * @param {boolean} [siteEnvelope.cloningInfo.cloneCustomHostNames] + * true to clone custom hostnames from source app; otherwise, + * false. + * + * @param {boolean} [siteEnvelope.cloningInfo.cloneSourceControl] + * true to clone source control from source app; otherwise, + * false. + * + * @param {string} siteEnvelope.cloningInfo.sourceWebAppId ARM resource ID of + * the source app. App resource ID is of the form + * /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName} + * for production slots and + * /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/slots/{slotName} + * for other slots. + * + * @param {string} [siteEnvelope.cloningInfo.hostingEnvironment] App Service + * Environment. + * + * @param {object} [siteEnvelope.cloningInfo.appSettingsOverrides] Application + * setting overrides for cloned app. If specified, these settings override the + * settings cloned + * from source app. Otherwise, application settings from source app are + * retained. + * + * @param {boolean} [siteEnvelope.cloningInfo.configureLoadBalancing] + * true to configure load balancing for source and destination + * app. + * + * @param {string} [siteEnvelope.cloningInfo.trafficManagerProfileId] ARM + * resource ID of the Traffic Manager profile to use, if it exists. Traffic + * Manager resource ID is of the form + * /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/trafficManagerProfiles/{profileName}. + * + * @param {string} [siteEnvelope.cloningInfo.trafficManagerProfileName] Name of + * Traffic Manager profile to create. This is only needed if Traffic Manager + * profile does not already exist. + * + * @param {boolean} [siteEnvelope.httpsOnly] HttpsOnly: configures a web site + * to accept only https requests. Issues redirect for + * http requests + * + * @param {object} [siteEnvelope.identity] + * + * @param {string} [siteEnvelope.identity.type] Type of managed service + * identity. Possible values include: 'SystemAssigned', 'UserAssigned' + * + * @param {array} [siteEnvelope.identity.identityIds] Array of UserAssigned + * managed service identities. + * + * @param {string} [siteEnvelope.kind] Kind of resource. + * + * @param {string} siteEnvelope.location Resource Location. + * + * @param {object} [siteEnvelope.tags] Resource tags. + * + * @param {string} slot Name of the deployment slot to create or update. By + * default, this API attempts to create or modify the production slot. + * + * @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 Site} 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 _beginCreateOrUpdateSlot(resourceGroupName, name, siteEnvelope, slot, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (siteEnvelope === null || siteEnvelope === undefined) { + throw new Error('siteEnvelope cannot be null or undefined.'); + } + if (slot === null || slot === undefined || typeof slot.valueOf() !== 'string') { + throw new Error('slot cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'PUT'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (siteEnvelope !== null && siteEnvelope !== undefined) { + let requestModelMapper = new client.models['Site']().mapper(); + requestModel = client.serialize(requestModelMapper, siteEnvelope, 'siteEnvelope'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(siteEnvelope, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 202) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['Site']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + // Deserialize Response + if (statusCode === 202) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['Site']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError1 = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError1.request = msRest.stripRequest(httpRequest); + deserializationError1.response = msRest.stripResponse(response); + return callback(deserializationError1); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * @summary Restores a specific backup to another app (or deployment slot, if + * specified). + * + * Restores a specific backup to another app (or deployment slot, if + * specified). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} backupId ID of the backup. + * + * @param {object} request Information on restore request . + * + * @param {string} request.storageAccountUrl SAS URL to the container. + * + * @param {string} [request.blobName] Name of a blob which contains the backup. + * + * @param {boolean} request.overwrite true if the restore + * operation can overwrite target app; otherwise, false. + * true is needed if trying to restore over an existing app. + * + * @param {string} [request.siteName] Name of an app. + * + * @param {array} [request.databases] Collection of databases which should be + * restored. This list has to match the list of databases included in the + * backup. + * + * @param {boolean} [request.ignoreConflictingHostNames] Changes a logic when + * restoring an app with custom domains. true to remove custom + * domains automatically. If false, custom domains are added to + * the app's object when it is being restored, but that might fail due to + * conflicts during the operation. + * + * @param {boolean} [request.ignoreDatabases] Ignore the databases and only + * restore the site content + * + * @param {string} [request.appServicePlan] Specify app service plan that will + * own restored site. + * + * @param {string} [request.operationType] Operation type. Possible values + * include: 'Default', 'Clone', 'Relocation', 'Snapshot', 'CloudFS' + * + * @param {boolean} [request.adjustConnectionStrings] true if + * SiteConfig.ConnectionStrings should be set in new app; otherwise, + * false. + * + * @param {string} [request.hostingEnvironment] App Service Environment name, + * if needed (only when restoring an app to an App Service Environment). + * + * @param {string} [request.kind] Kind of resource. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will restore a backup of the production slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _beginRestoreSlot(resourceGroupName, name, backupId, request, slot, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (backupId === null || backupId === undefined || typeof backupId.valueOf() !== 'string') { + throw new Error('backupId cannot be null or undefined and it must be of type string.'); + } + if (request === null || request === undefined) { + throw new Error('request cannot be null or undefined.'); + } + if (slot === null || slot === undefined || typeof slot.valueOf() !== 'string') { + throw new Error('slot cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/backups/{backupId}/restore'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{backupId}', encodeURIComponent(backupId)); + requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); + 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 (request !== null && request !== undefined) { + let requestModelMapper = new client.models['RestoreRequest']().mapper(); + requestModel = client.serialize(requestModelMapper, request, 'request'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(request, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 202) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + + return callback(null, result, httpRequest, response); + }); +} + +/** + * @summary Gets the Git/FTP publishing credentials of an app. + * + * Gets the Git/FTP publishing credentials of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will get the publishing credentials for the production + * slot. + * + * @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 User} 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 _beginListPublishingCredentialsSlot(resourceGroupName, name, slot, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (slot === null || slot === undefined || typeof slot.valueOf() !== 'string') { + throw new Error('slot cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/publishingcredentials/list'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); + 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]; + } + } + } + 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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['User']().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 Invoke the MSDeploy web app extension. + * + * Invoke the MSDeploy web app extension. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {string} slot Name of web app slot. If not specified then will + * default to production slot. + * + * @param {object} mSDeploy Details of MSDeploy operation + * + * @param {string} [mSDeploy.packageUri] Package URI + * + * @param {string} [mSDeploy.connectionString] SQL Connection String + * + * @param {string} [mSDeploy.dbType] Database Type + * + * @param {string} [mSDeploy.setParametersXmlFileUri] URI of MSDeploy + * Parameters file. Must not be set if SetParameters is used. + * + * @param {object} [mSDeploy.setParameters] MSDeploy Parameters. Must not be + * set if SetParametersXmlFileUri is used. + * + * @param {boolean} [mSDeploy.skipAppData] Controls whether the MSDeploy + * operation skips the App_Data directory. + * If set to true, the existing App_Data directory on the + * destination + * will not be deleted, and any App_Data directory in the source will be + * ignored. + * Setting is false by default. + * + * @param {boolean} [mSDeploy.appOffline] Sets the AppOffline rule while the + * MSDeploy operation executes. + * Setting is false by default. + * + * @param {string} [mSDeploy.kind] Kind of resource. + * + * @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 MSDeployStatus} 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 _beginCreateMSDeployOperationSlot(resourceGroupName, name, slot, mSDeploy, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (slot === null || slot === undefined || typeof slot.valueOf() !== 'string') { + throw new Error('slot cannot be null or undefined and it must be of type string.'); + } + if (mSDeploy === null || mSDeploy === undefined) { + throw new Error('mSDeploy cannot be null or undefined.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/extensions/MSDeploy'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'PUT'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (mSDeploy !== null && mSDeploy !== undefined) { + let requestModelMapper = new client.models['MSDeploy']().mapper(); + requestModel = client.serialize(requestModelMapper, mSDeploy, 'mSDeploy'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(mSDeploy, 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 !== 201 && statusCode !== 409) { + 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 === 201) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['MSDeployStatus']().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 Create function for web site, or a deployment slot. + * + * Create function for web site, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} functionName Function name. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API deletes a deployment for the production slot. + * + * @param {object} functionEnvelope Function details. + * + * @param {string} [functionEnvelope.functionAppId] Function App ID. + * + * @param {string} [functionEnvelope.scriptRootPathHref] Script root path URI. + * + * @param {string} [functionEnvelope.scriptHref] Script URI. + * + * @param {string} [functionEnvelope.configHref] Config URI. + * + * @param {string} [functionEnvelope.secretsFileHref] Secrets file URI. + * + * @param {string} [functionEnvelope.href] Function URI. + * + * @param {object} [functionEnvelope.config] Config information. + * + * @param {object} [functionEnvelope.files] File list. + * + * @param {string} [functionEnvelope.testData] Test data used when testing via + * the Azure Portal. + * + * @param {string} [functionEnvelope.kind] Kind of resource. + * + * @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 FunctionEnvelope} 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 _beginCreateInstanceFunctionSlot(resourceGroupName, name, functionName, slot, functionEnvelope, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (functionName === null || functionName === undefined || typeof functionName.valueOf() !== 'string') { + throw new Error('functionName cannot be null or undefined and it must be of type string.'); + } + if (slot === null || slot === undefined || typeof slot.valueOf() !== 'string') { + throw new Error('slot cannot be null or undefined and it must be of type string.'); + } + if (functionEnvelope === null || functionEnvelope === undefined) { + throw new Error('functionEnvelope cannot be null or undefined.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/functions/{functionName}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{functionName}', encodeURIComponent(functionName)); + requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'PUT'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (functionEnvelope !== null && functionEnvelope !== undefined) { + let requestModelMapper = new client.models['FunctionEnvelope']().mapper(); + requestModel = client.serialize(requestModelMapper, functionEnvelope, 'functionEnvelope'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(functionEnvelope, 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 !== 201) { + 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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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 === 201) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['FunctionEnvelope']().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 Invoke the MSDeploy web app extension. + * + * Invoke the MSDeploy web app extension. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {string} slot Name of web app slot. If not specified then will + * default to production slot. + * + * @param {string} instanceId ID of web app instance. + * + * @param {object} mSDeploy Details of MSDeploy operation + * + * @param {string} [mSDeploy.packageUri] Package URI + * + * @param {string} [mSDeploy.connectionString] SQL Connection String + * + * @param {string} [mSDeploy.dbType] Database Type + * + * @param {string} [mSDeploy.setParametersXmlFileUri] URI of MSDeploy + * Parameters file. Must not be set if SetParameters is used. + * + * @param {object} [mSDeploy.setParameters] MSDeploy Parameters. Must not be + * set if SetParametersXmlFileUri is used. + * + * @param {boolean} [mSDeploy.skipAppData] Controls whether the MSDeploy + * operation skips the App_Data directory. + * If set to true, the existing App_Data directory on the + * destination + * will not be deleted, and any App_Data directory in the source will be + * ignored. + * Setting is false by default. + * + * @param {boolean} [mSDeploy.appOffline] Sets the AppOffline rule while the + * MSDeploy operation executes. + * Setting is false by default. + * + * @param {string} [mSDeploy.kind] Kind of resource. + * + * @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 MSDeployStatus} 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 _beginCreateInstanceMSDeployOperationSlot(resourceGroupName, name, slot, instanceId, mSDeploy, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (slot === null || slot === undefined || typeof slot.valueOf() !== 'string') { + throw new Error('slot cannot be null or undefined and it must be of type string.'); + } + if (instanceId === null || instanceId === undefined || typeof instanceId.valueOf() !== 'string') { + throw new Error('instanceId cannot be null or undefined and it must be of type string.'); + } + if (mSDeploy === null || mSDeploy === undefined) { + throw new Error('mSDeploy cannot be null or undefined.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances/{instanceId}/extensions/MSDeploy'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); + requestUrl = requestUrl.replace('{instanceId}', encodeURIComponent(instanceId)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'PUT'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (mSDeploy !== null && mSDeploy !== undefined) { + let requestModelMapper = new client.models['MSDeploy']().mapper(); + requestModel = client.serialize(requestModelMapper, mSDeploy, 'mSDeploy'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(mSDeploy, 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 !== 201 && statusCode !== 409) { + 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 === 201) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['MSDeployStatus']().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 Restores an app from a backup blob in Azure Storage. + * + * Restores an app from a backup blob in Azure Storage. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} request Information on restore request . + * + * @param {string} request.storageAccountUrl SAS URL to the container. + * + * @param {string} [request.blobName] Name of a blob which contains the backup. + * + * @param {boolean} request.overwrite true if the restore + * operation can overwrite target app; otherwise, false. + * true is needed if trying to restore over an existing app. + * + * @param {string} [request.siteName] Name of an app. + * + * @param {array} [request.databases] Collection of databases which should be + * restored. This list has to match the list of databases included in the + * backup. + * + * @param {boolean} [request.ignoreConflictingHostNames] Changes a logic when + * restoring an app with custom domains. true to remove custom + * domains automatically. If false, custom domains are added to + * the app's object when it is being restored, but that might fail due to + * conflicts during the operation. + * + * @param {boolean} [request.ignoreDatabases] Ignore the databases and only + * restore the site content + * + * @param {string} [request.appServicePlan] Specify app service plan that will + * own restored site. + * + * @param {string} [request.operationType] Operation type. Possible values + * include: 'Default', 'Clone', 'Relocation', 'Snapshot', 'CloudFS' + * + * @param {boolean} [request.adjustConnectionStrings] true if + * SiteConfig.ConnectionStrings should be set in new app; otherwise, + * false. + * + * @param {string} [request.hostingEnvironment] App Service Environment name, + * if needed (only when restoring an app to an App Service Environment). + * + * @param {string} [request.kind] Kind of resource. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will restore a backup of the production slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _beginRestoreFromBackupBlobSlot(resourceGroupName, name, request, slot, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (request === null || request === undefined) { + throw new Error('request cannot be null or undefined.'); + } + if (slot === null || slot === undefined || typeof slot.valueOf() !== 'string') { + throw new Error('slot cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/restoreFromBackupBlob'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); + 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 (request !== null && request !== undefined) { + let requestModelMapper = new client.models['RestoreRequest']().mapper(); + requestModel = client.serialize(requestModelMapper, request, 'request'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(request, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 202) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + + return callback(null, result, httpRequest, response); + }); +} + +/** + * @summary Restores a deleted web app to this web app. + * + * Restores a deleted web app to this web app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {object} restoreRequest Deleted web app restore information. + * + * @param {string} [restoreRequest.deletedSiteId] ARM resource ID of the + * deleted app. Example: + * /subscriptions/{subId}/providers/Microsoft.Web/deletedSites/{deletedSiteId} + * + * @param {boolean} [restoreRequest.recoverConfiguration] If true, deleted site + * configuration, in addition to content, will be restored. + * + * @param {string} [restoreRequest.snapshotTime] Point in time to restore the + * deleted app from, formatted as a DateTime string. + * If unspecified, default value is the time that the app was deleted. + * + * @param {string} [restoreRequest.kind] Kind of resource. + * + * @param {string} slot Name of web app slot. If not specified then will + * default to production slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _beginRestoreFromDeletedAppSlot(resourceGroupName, name, restoreRequest, slot, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (restoreRequest === null || restoreRequest === undefined) { + throw new Error('restoreRequest cannot be null or undefined.'); + } + if (slot === null || slot === undefined || typeof slot.valueOf() !== 'string') { + throw new Error('slot cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/restoreFromDeletedApp'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); + 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 (restoreRequest !== null && restoreRequest !== undefined) { + let requestModelMapper = new client.models['DeletedAppRestoreRequest']().mapper(); + requestModel = client.serialize(requestModelMapper, restoreRequest, 'restoreRequest'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(restoreRequest, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 202) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + + return callback(null, result, httpRequest, response); + }); +} + +/** + * @summary Restores a web app from a snapshot. + * + * Restores a web app from a snapshot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {object} restoreRequest Snapshot restore settings. Snapshot + * information can be obtained by calling GetDeletedSites or GetSiteSnapshots + * API. + * + * @param {string} [restoreRequest.snapshotTime] Point in time in which the app + * restore should be done, formatted as a DateTime string. + * + * @param {object} [restoreRequest.recoverySource] Optional. Specifies the web + * app that snapshot contents will be retrieved from. + * If empty, the targeted web app will be used as the source. + * + * @param {string} [restoreRequest.recoverySource.location] Geographical + * location of the source web app, e.g. SouthEastAsia, SouthCentralUS + * + * @param {string} [restoreRequest.recoverySource.id] ARM resource ID of the + * source app. + * /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName} + * for production slots and + * /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/slots/{slotName} + * for other slots. + * + * @param {boolean} restoreRequest.overwrite If true the restore + * operation can overwrite source app; otherwise, false. + * + * @param {boolean} [restoreRequest.recoverConfiguration] If true, site + * configuration, in addition to content, will be reverted. + * + * @param {boolean} [restoreRequest.ignoreConflictingHostNames] If true, custom + * hostname conflicts will be ignored when recovering to a target web app. + * This setting is only necessary when RecoverConfiguration is enabled. + * + * @param {string} [restoreRequest.kind] Kind of resource. + * + * @param {string} slot Name of web app slot. If not specified then will + * default to production slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _beginRestoreSnapshotSlot(resourceGroupName, name, restoreRequest, slot, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (restoreRequest === null || restoreRequest === undefined) { + throw new Error('restoreRequest cannot be null or undefined.'); + } + if (slot === null || slot === undefined || typeof slot.valueOf() !== 'string') { + throw new Error('slot cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/restoreSnapshot'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); + 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 (restoreRequest !== null && restoreRequest !== undefined) { + let requestModelMapper = new client.models['SnapshotRestoreRequest']().mapper(); + requestModel = client.serialize(requestModelMapper, restoreRequest, 'restoreRequest'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(restoreRequest, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 202) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + + return callback(null, result, httpRequest, response); + }); +} + +/** + * @summary Install site extension on a web site, or a deployment slot. + * + * Install site extension on a web site, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} siteExtensionId Site extension name. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API deletes a deployment for the production slot. + * + * @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 SiteExtensionInfo} 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 _beginInstallSiteExtensionSlot(resourceGroupName, name, siteExtensionId, slot, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (siteExtensionId === null || siteExtensionId === undefined || typeof siteExtensionId.valueOf() !== 'string') { + throw new Error('siteExtensionId cannot be null or undefined and it must be of type string.'); + } + if (slot === null || slot === undefined || typeof slot.valueOf() !== 'string') { + throw new Error('slot cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/siteextensions/{siteExtensionId}'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{siteExtensionId}', encodeURIComponent(siteExtensionId)); + requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'PUT'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 201 && statusCode !== 429) { + 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['SiteExtensionInfo']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + // Deserialize Response + if (statusCode === 201) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['SiteExtensionInfo']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError1 = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError1.request = msRest.stripRequest(httpRequest); + deserializationError1.response = msRest.stripResponse(response); + return callback(deserializationError1); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * @summary Swaps two deployment slots of an app. + * + * Swaps two deployment slots of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} slotSwapEntity JSON object that contains the target slot + * name. See example. + * + * @param {string} slotSwapEntity.targetSlot Destination deployment slot during + * swap operation. + * + * @param {boolean} slotSwapEntity.preserveVnet true to preserve + * Virtual Network to the slot during swap; otherwise, false. + * + * @param {string} slot Name of the source slot. If a slot is not specified, + * the production slot is used as the source slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _beginSwapSlotSlot(resourceGroupName, name, slotSwapEntity, slot, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (slotSwapEntity === null || slotSwapEntity === undefined) { + throw new Error('slotSwapEntity cannot be null or undefined.'); + } + if (slot === null || slot === undefined || typeof slot.valueOf() !== 'string') { + throw new Error('slot cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/slotsswap'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); + 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 (slotSwapEntity !== null && slotSwapEntity !== undefined) { + let requestModelMapper = new client.models['CsmSlotEntity']().mapper(); + requestModel = client.serialize(requestModelMapper, slotSwapEntity, 'slotSwapEntity'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(slotSwapEntity, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 202) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + + return callback(null, result, httpRequest, response); + }); +} + +/** + * @summary Updates the source control configuration of an app. + * + * Updates the source control configuration of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} siteSourceControl JSON representation of a SiteSourceControl + * object. See example. + * + * @param {string} [siteSourceControl.repoUrl] Repository or source control + * URL. + * + * @param {string} [siteSourceControl.branch] Name of branch to use for + * deployment. + * + * @param {boolean} [siteSourceControl.isManualIntegration] true + * to limit to manual integration; false to enable continuous + * integration (which configures webhooks into online repos like GitHub). + * + * @param {boolean} [siteSourceControl.deploymentRollbackEnabled] + * true to enable deployment rollback; otherwise, + * false. + * + * @param {boolean} [siteSourceControl.isMercurial] true for a + * Mercurial repository; false for a Git repository. + * + * @param {string} [siteSourceControl.kind] Kind of resource. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will update the source control configuration for the + * production slot. + * + * @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 SiteSourceControl} 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 _beginCreateOrUpdateSourceControlSlot(resourceGroupName, name, siteSourceControl, slot, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (siteSourceControl === null || siteSourceControl === undefined) { + throw new Error('siteSourceControl cannot be null or undefined.'); + } + if (slot === null || slot === undefined || typeof slot.valueOf() !== 'string') { + throw new Error('slot cannot be null or undefined and it must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/sourcecontrols/web'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'PUT'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (siteSourceControl !== null && siteSourceControl !== undefined) { + let requestModelMapper = new client.models['SiteSourceControl']().mapper(); + requestModel = client.serialize(requestModelMapper, siteSourceControl, 'siteSourceControl'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(siteSourceControl, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 201 && statusCode !== 202) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['SiteSourceControl']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + // Deserialize Response + if (statusCode === 201) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['SiteSourceControl']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError1 = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError1.request = msRest.stripRequest(httpRequest); + deserializationError1.response = msRest.stripResponse(response); + return callback(deserializationError1); + } + } + // Deserialize Response + if (statusCode === 202) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['SiteSourceControl']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError2 = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError2.request = msRest.stripRequest(httpRequest); + deserializationError2.response = msRest.stripResponse(response); + return callback(deserializationError2); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * @summary Swaps two deployment slots of an app. + * + * Swaps two deployment slots of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} slotSwapEntity JSON object that contains the target slot + * name. See example. + * + * @param {string} slotSwapEntity.targetSlot Destination deployment slot during + * swap operation. + * + * @param {boolean} slotSwapEntity.preserveVnet true to preserve + * Virtual Network to the slot during swap; otherwise, false. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _beginSwapSlotWithProduction(resourceGroupName, name, slotSwapEntity, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (slotSwapEntity === null || slotSwapEntity === undefined) { + throw new Error('slotSwapEntity cannot be null or undefined.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slotsswap'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + 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 (slotSwapEntity !== null && slotSwapEntity !== undefined) { + let requestModelMapper = new client.models['CsmSlotEntity']().mapper(); + requestModel = client.serialize(requestModelMapper, slotSwapEntity, 'slotSwapEntity'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(slotSwapEntity, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 202) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + + return callback(null, result, httpRequest, response); + }); +} + +/** + * @summary Updates the source control configuration of an app. + * + * Updates the source control configuration of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} siteSourceControl JSON representation of a SiteSourceControl + * object. See example. + * + * @param {string} [siteSourceControl.repoUrl] Repository or source control + * URL. + * + * @param {string} [siteSourceControl.branch] Name of branch to use for + * deployment. + * + * @param {boolean} [siteSourceControl.isManualIntegration] true + * to limit to manual integration; false to enable continuous + * integration (which configures webhooks into online repos like GitHub). + * + * @param {boolean} [siteSourceControl.deploymentRollbackEnabled] + * true to enable deployment rollback; otherwise, + * false. + * + * @param {boolean} [siteSourceControl.isMercurial] true for a + * Mercurial repository; false for a Git repository. + * + * @param {string} [siteSourceControl.kind] Kind of resource. + * + * @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 SiteSourceControl} 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 _beginCreateOrUpdateSourceControl(resourceGroupName, name, siteSourceControl, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (siteSourceControl === null || siteSourceControl === undefined) { + throw new Error('siteSourceControl cannot be null or undefined.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/sourcecontrols/web'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'PUT'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (siteSourceControl !== null && siteSourceControl !== undefined) { + let requestModelMapper = new client.models['SiteSourceControl']().mapper(); + requestModel = client.serialize(requestModelMapper, siteSourceControl, 'siteSourceControl'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(siteSourceControl, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 201 && statusCode !== 202) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['SiteSourceControl']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + // Deserialize Response + if (statusCode === 201) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['SiteSourceControl']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError1 = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError1.request = msRest.stripRequest(httpRequest); + deserializationError1.response = msRest.stripResponse(response); + return callback(deserializationError1); + } + } + // Deserialize Response + if (statusCode === 202) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['SiteSourceControl']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError2 = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError2.request = msRest.stripRequest(httpRequest); + deserializationError2.response = msRest.stripResponse(response); + return callback(deserializationError2); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * @summary Get all apps for a subscription. + * + * Get all apps for a subscription. + * + * @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 WebAppCollection} 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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['WebAppCollection']().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 all web, mobile, and API apps in the specified resource group. + * + * Gets all web, mobile, and API apps in the specified resource group. + * + * @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 WebAppCollection} 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 _listByResourceGroupNext(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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['WebAppCollection']().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 existing backups of an app. + * + * Gets existing backups of an app. + * + * @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 BackupItemCollection} 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 _listBackupsNext(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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['BackupItemCollection']().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 List the configurations of an app + * + * List the configurations of an app + * + * @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 SiteConfigResourceCollection} 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 _listConfigurationsNext(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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['SiteConfigResourceCollection']().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 web app configuration snapshots identifiers. Each + * element of the list contains a timestamp and the ID of the snapshot. + * + * Gets a list of web app configuration snapshots identifiers. Each element of + * the list contains a timestamp and the ID of the snapshot. + * + * @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 SiteConfigurationSnapshotInfoCollection} 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 _listConfigurationSnapshotInfoNext(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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['SiteConfigurationSnapshotInfoCollection']().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 List continuous web jobs for an app, or a deployment slot. + * + * List continuous web jobs for an app, or a deployment slot. + * + * @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 ContinuousWebJobCollection} 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 _listContinuousWebJobsNext(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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['ContinuousWebJobCollection']().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 List deployments for an app, or a deployment slot. + * + * List deployments for an app, or a deployment slot. + * + * @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 DeploymentCollection} 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 _listDeploymentsNext(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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['DeploymentCollection']().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 Lists ownership identifiers for domain associated with web app. + * + * Lists ownership identifiers for domain associated with web app. + * + * @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 IdentifierCollection} 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 _listDomainOwnershipIdentifiersNext(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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['IdentifierCollection']().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 List the functions for a web site, or a deployment slot. + * + * List the functions for a web site, or a deployment slot. + * + * @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 FunctionEnvelopeCollection} 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 _listFunctionsNext(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 && statusCode !== 404) { + 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['FunctionEnvelopeCollection']().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 Get hostname bindings for an app or a deployment slot. + * + * Get hostname bindings for an app or a deployment slot. + * + * @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 HostNameBindingCollection} 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 _listHostNameBindingsNext(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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['HostNameBindingCollection']().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 all scale-out instances of an app. + * + * Gets all scale-out instances of an app. + * + * @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 WebAppInstanceCollection} 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 _listInstanceIdentifiersNext(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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['WebAppInstanceCollection']().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 Get list of processes for a web site, or a deployment slot, or for + * a specific scaled-out instance in a web site. + * + * Get list of processes for a web site, or a deployment slot, or for a + * specific scaled-out instance in a web site. + * + * @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 ProcessInfoCollection} 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 _listInstanceProcessesNext(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 && statusCode !== 404) { + 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['ProcessInfoCollection']().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 List module information for a process by its ID for a specific + * scaled-out instance in a web site. + * + * List module information for a process by its ID for a specific scaled-out + * instance in a web site. + * + * @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 ProcessModuleInfoCollection} 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 _listInstanceProcessModulesNext(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 && statusCode !== 404) { + 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['ProcessModuleInfoCollection']().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 List the threads in a process by its ID for a specific scaled-out + * instance in a web site. + * + * List the threads in a process by its ID for a specific scaled-out instance + * in a web site. + * + * @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 ProcessThreadInfoCollection} 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 _listInstanceProcessThreadsNext(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 && statusCode !== 404) { + 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['ProcessThreadInfoCollection']().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 all metric definitions of an app (or deployment slot, if + * specified). + * + * Gets all metric definitions of an app (or deployment slot, if specified). + * + * @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 ResourceMetricDefinitionCollection} 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 _listMetricDefinitionsNext(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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['ResourceMetricDefinitionCollection']().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 performance metrics of an app (or deployment slot, if + * specified). + * + * Gets performance metrics of an app (or deployment slot, if specified). + * + * @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 ResourceMetricCollection} 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 _listMetricsNext(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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['ResourceMetricCollection']().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 perfmon counters for web app. + * + * Gets perfmon counters for web app. + * + * @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 PerfMonCounterCollection} 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 _listPerfMonCountersNext(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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['PerfMonCounterCollection']().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 Get list of processes for a web site, or a deployment slot, or for + * a specific scaled-out instance in a web site. + * + * Get list of processes for a web site, or a deployment slot, or for a + * specific scaled-out instance in a web site. + * + * @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 ProcessInfoCollection} 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 _listProcessesNext(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 && statusCode !== 404) { + 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['ProcessInfoCollection']().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 List module information for a process by its ID for a specific + * scaled-out instance in a web site. + * + * List module information for a process by its ID for a specific scaled-out + * instance in a web site. + * + * @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 ProcessModuleInfoCollection} 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 _listProcessModulesNext(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 && statusCode !== 404) { + 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['ProcessModuleInfoCollection']().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 List the threads in a process by its ID for a specific scaled-out + * instance in a web site. + * + * List the threads in a process by its ID for a specific scaled-out instance + * in a web site. + * + * @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 ProcessThreadInfoCollection} 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 _listProcessThreadsNext(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 && statusCode !== 404) { + 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['ProcessThreadInfoCollection']().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 Get public certificates for an app or a deployment slot. + * + * Get public certificates for an app or a deployment slot. + * + * @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 PublicCertificateCollection} 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 _listPublicCertificatesNext(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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['PublicCertificateCollection']().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 Get list of siteextensions for a web site, or a deployment slot. + * + * Get list of siteextensions for a web site, or a deployment slot. + * + * @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 SiteExtensionInfoCollection} 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 _listSiteExtensionsNext(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 && statusCode !== 404) { + 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['SiteExtensionInfoCollection']().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 an app's deployment slots. + * + * Gets an app's deployment slots. + * + * @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 WebAppCollection} 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 _listSlotsNext(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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['WebAppCollection']().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 existing backups of an app. + * + * Gets existing backups of an app. + * + * @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 BackupItemCollection} 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 _listBackupsSlotNext(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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['BackupItemCollection']().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 List the configurations of an app + * + * List the configurations of an app + * + * @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 SiteConfigResourceCollection} 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 _listConfigurationsSlotNext(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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['SiteConfigResourceCollection']().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 web app configuration snapshots identifiers. Each + * element of the list contains a timestamp and the ID of the snapshot. + * + * Gets a list of web app configuration snapshots identifiers. Each element of + * the list contains a timestamp and the ID of the snapshot. + * + * @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 SiteConfigurationSnapshotInfoCollection} 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 _listConfigurationSnapshotInfoSlotNext(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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['SiteConfigurationSnapshotInfoCollection']().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 List continuous web jobs for an app, or a deployment slot. + * + * List continuous web jobs for an app, or a deployment slot. + * + * @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 ContinuousWebJobCollection} 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 _listContinuousWebJobsSlotNext(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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['ContinuousWebJobCollection']().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 List deployments for an app, or a deployment slot. + * + * List deployments for an app, or a deployment slot. + * + * @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 DeploymentCollection} 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 _listDeploymentsSlotNext(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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['DeploymentCollection']().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 Lists ownership identifiers for domain associated with web app. + * + * Lists ownership identifiers for domain associated with web app. + * + * @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 IdentifierCollection} 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 _listDomainOwnershipIdentifiersSlotNext(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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['IdentifierCollection']().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 List the functions for a web site, or a deployment slot. + * + * List the functions for a web site, or a deployment slot. + * + * @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 FunctionEnvelopeCollection} 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 _listInstanceFunctionsSlotNext(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 && statusCode !== 404) { + 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['FunctionEnvelopeCollection']().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 Get hostname bindings for an app or a deployment slot. + * + * Get hostname bindings for an app or a deployment slot. + * + * @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 HostNameBindingCollection} 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 _listHostNameBindingsSlotNext(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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['HostNameBindingCollection']().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 all scale-out instances of an app. + * + * Gets all scale-out instances of an app. + * + * @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 WebAppInstanceCollection} 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 _listInstanceIdentifiersSlotNext(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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['WebAppInstanceCollection']().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 Get list of processes for a web site, or a deployment slot, or for + * a specific scaled-out instance in a web site. + * + * Get list of processes for a web site, or a deployment slot, or for a + * specific scaled-out instance in a web site. + * + * @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 ProcessInfoCollection} 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 _listInstanceProcessesSlotNext(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 && statusCode !== 404) { + 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['ProcessInfoCollection']().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 List module information for a process by its ID for a specific + * scaled-out instance in a web site. + * + * List module information for a process by its ID for a specific scaled-out + * instance in a web site. + * + * @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 ProcessModuleInfoCollection} 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 _listInstanceProcessModulesSlotNext(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 && statusCode !== 404) { + 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['ProcessModuleInfoCollection']().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 List the threads in a process by its ID for a specific scaled-out + * instance in a web site. + * + * List the threads in a process by its ID for a specific scaled-out instance + * in a web site. + * + * @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 ProcessThreadInfoCollection} 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 _listInstanceProcessThreadsSlotNext(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 && statusCode !== 404) { + 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['ProcessThreadInfoCollection']().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 all metric definitions of an app (or deployment slot, if + * specified). + * + * Gets all metric definitions of an app (or deployment slot, if specified). + * + * @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 ResourceMetricDefinitionCollection} 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 _listMetricDefinitionsSlotNext(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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['ResourceMetricDefinitionCollection']().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 performance metrics of an app (or deployment slot, if + * specified). + * + * Gets performance metrics of an app (or deployment slot, if specified). + * + * @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 ResourceMetricCollection} 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 _listMetricsSlotNext(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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['ResourceMetricCollection']().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 perfmon counters for web app. + * + * Gets perfmon counters for web app. + * + * @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 PerfMonCounterCollection} 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 _listPerfMonCountersSlotNext(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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['PerfMonCounterCollection']().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 Get list of processes for a web site, or a deployment slot, or for + * a specific scaled-out instance in a web site. + * + * Get list of processes for a web site, or a deployment slot, or for a + * specific scaled-out instance in a web site. + * + * @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 ProcessInfoCollection} 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 _listProcessesSlotNext(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 && statusCode !== 404) { + 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['ProcessInfoCollection']().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 List module information for a process by its ID for a specific + * scaled-out instance in a web site. + * + * List module information for a process by its ID for a specific scaled-out + * instance in a web site. + * + * @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 ProcessModuleInfoCollection} 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 _listProcessModulesSlotNext(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 && statusCode !== 404) { + 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['ProcessModuleInfoCollection']().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 List the threads in a process by its ID for a specific scaled-out + * instance in a web site. + * + * List the threads in a process by its ID for a specific scaled-out instance + * in a web site. + * + * @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 ProcessThreadInfoCollection} 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 _listProcessThreadsSlotNext(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 && statusCode !== 404) { + 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['ProcessThreadInfoCollection']().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 Get public certificates for an app or a deployment slot. + * + * Get public certificates for an app or a deployment slot. + * + * @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 PublicCertificateCollection} 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 _listPublicCertificatesSlotNext(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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['PublicCertificateCollection']().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 Get list of siteextensions for a web site, or a deployment slot. + * + * Get list of siteextensions for a web site, or a deployment slot. + * + * @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 SiteExtensionInfoCollection} 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 _listSiteExtensionsSlotNext(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 && statusCode !== 404) { + 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['SiteExtensionInfoCollection']().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 Get the difference in configuration settings between two web app + * slots. + * + * Get the difference in configuration settings between two web app slots. + * + * @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 SlotDifferenceCollection} 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 _listSlotDifferencesSlotNext(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 = '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]; + } + } + } + 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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['SlotDifferenceCollection']().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 Returns all Snapshots to the user. + * + * Returns all Snapshots to the user. + * + * @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 SnapshotCollection} 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 _listSnapshotsSlotNext(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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['SnapshotCollection']().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 List triggered web jobs for an app, or a deployment slot. + * + * List triggered web jobs for an app, or a deployment slot. + * + * @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 TriggeredWebJobCollection} 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 _listTriggeredWebJobsSlotNext(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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['TriggeredWebJobCollection']().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 List a triggered web job's history for an app, or a deployment + * slot. + * + * List a triggered web job's history for an app, or a deployment slot. + * + * @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 TriggeredJobHistoryCollection} 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 _listTriggeredWebJobHistorySlotNext(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 && statusCode !== 404) { + 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['TriggeredJobHistoryCollection']().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 the quota usage information of an app (or deployment slot, if + * specified). + * + * Gets the quota usage information of an app (or deployment slot, if + * specified). + * + * @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 CsmUsageQuotaCollection} 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 _listUsagesSlotNext(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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['CsmUsageQuotaCollection']().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 List webjobs for an app, or a deployment slot. + * + * List webjobs for an app, or a deployment slot. + * + * @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 WebJobCollection} 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 _listWebJobsSlotNext(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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['WebJobCollection']().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 Get the difference in configuration settings between two web app + * slots. + * + * Get the difference in configuration settings between two web app slots. + * + * @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 SlotDifferenceCollection} 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 _listSlotDifferencesFromProductionNext(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 = '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]; + } + } + } + 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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['SlotDifferenceCollection']().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 Returns all Snapshots to the user. + * + * Returns all Snapshots to the user. + * + * @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 SnapshotCollection} 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 _listSnapshotsNext(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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['SnapshotCollection']().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 List triggered web jobs for an app, or a deployment slot. + * + * List triggered web jobs for an app, or a deployment slot. + * + * @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 TriggeredWebJobCollection} 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 _listTriggeredWebJobsNext(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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['TriggeredWebJobCollection']().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 List a triggered web job's history for an app, or a deployment + * slot. + * + * List a triggered web job's history for an app, or a deployment slot. + * + * @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 TriggeredJobHistoryCollection} 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 _listTriggeredWebJobHistoryNext(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 && statusCode !== 404) { + 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['TriggeredJobHistoryCollection']().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 the quota usage information of an app (or deployment slot, if + * specified). + * + * Gets the quota usage information of an app (or deployment slot, if + * specified). + * + * @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 CsmUsageQuotaCollection} 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 _listUsagesNext(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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['CsmUsageQuotaCollection']().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 List webjobs for an app, or a deployment slot. + * + * List webjobs for an app, or a deployment slot. + * + * @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 WebJobCollection} 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 _listWebJobsNext(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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['WebJobCollection']().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 WebApps. */ +class WebApps { + /** + * Create a WebApps. + * @param {WebSiteManagementClient} client Reference to the service client. + */ + constructor(client) { + this.client = client; + this._list = _list; + this._listByResourceGroup = _listByResourceGroup; + this._get = _get; + this._createOrUpdate = _createOrUpdate; + this._deleteMethod = _deleteMethod; + this._update = _update; + this._analyzeCustomHostname = _analyzeCustomHostname; + this._applySlotConfigToProduction = _applySlotConfigToProduction; + this._backup = _backup; + this._listBackups = _listBackups; + this._getBackupStatus = _getBackupStatus; + this._deleteBackup = _deleteBackup; + this._listBackupStatusSecrets = _listBackupStatusSecrets; + this._restore = _restore; + this._listConfigurations = _listConfigurations; + this._updateApplicationSettings = _updateApplicationSettings; + this._listApplicationSettings = _listApplicationSettings; + this._updateAuthSettings = _updateAuthSettings; + this._getAuthSettings = _getAuthSettings; + this._updateAzureStorageAccounts = _updateAzureStorageAccounts; + this._listAzureStorageAccounts = _listAzureStorageAccounts; + this._updateBackupConfiguration = _updateBackupConfiguration; + this._deleteBackupConfiguration = _deleteBackupConfiguration; + this._getBackupConfiguration = _getBackupConfiguration; + this._updateConnectionStrings = _updateConnectionStrings; + this._listConnectionStrings = _listConnectionStrings; + this._getDiagnosticLogsConfiguration = _getDiagnosticLogsConfiguration; + this._updateDiagnosticLogsConfig = _updateDiagnosticLogsConfig; + this._updateMetadata = _updateMetadata; + this._listMetadata = _listMetadata; + this._listPublishingCredentials = _listPublishingCredentials; + this._updateSitePushSettings = _updateSitePushSettings; + this._listSitePushSettings = _listSitePushSettings; + this._listSlotConfigurationNames = _listSlotConfigurationNames; + this._updateSlotConfigurationNames = _updateSlotConfigurationNames; + this._getSwiftVirtualNetworkConnection = _getSwiftVirtualNetworkConnection; + this._createOrUpdateSwiftVirtualNetworkConnection = _createOrUpdateSwiftVirtualNetworkConnection; + this._deleteSwiftVirtualNetwork = _deleteSwiftVirtualNetwork; + this._updateSwiftVirtualNetworkConnection = _updateSwiftVirtualNetworkConnection; + this._getConfiguration = _getConfiguration; + this._createOrUpdateConfiguration = _createOrUpdateConfiguration; + this._updateConfiguration = _updateConfiguration; + this._listConfigurationSnapshotInfo = _listConfigurationSnapshotInfo; + this._getConfigurationSnapshot = _getConfigurationSnapshot; + this._recoverSiteConfigurationSnapshot = _recoverSiteConfigurationSnapshot; + this._getWebSiteContainerLogs = _getWebSiteContainerLogs; + this._getContainerLogsZip = _getContainerLogsZip; + this._listContinuousWebJobs = _listContinuousWebJobs; + this._getContinuousWebJob = _getContinuousWebJob; + this._deleteContinuousWebJob = _deleteContinuousWebJob; + this._startContinuousWebJob = _startContinuousWebJob; + this._stopContinuousWebJob = _stopContinuousWebJob; + this._listDeployments = _listDeployments; + this._getDeployment = _getDeployment; + this._createDeployment = _createDeployment; + this._deleteDeployment = _deleteDeployment; + this._listDeploymentLog = _listDeploymentLog; + this._discoverBackup = _discoverBackup; + this._listDomainOwnershipIdentifiers = _listDomainOwnershipIdentifiers; + this._getDomainOwnershipIdentifier = _getDomainOwnershipIdentifier; + this._createOrUpdateDomainOwnershipIdentifier = _createOrUpdateDomainOwnershipIdentifier; + this._deleteDomainOwnershipIdentifier = _deleteDomainOwnershipIdentifier; + this._updateDomainOwnershipIdentifier = _updateDomainOwnershipIdentifier; + this._getMSDeployStatus = _getMSDeployStatus; + this._createMSDeployOperation = _createMSDeployOperation; + this._getMSDeployLog = _getMSDeployLog; + this._listFunctions = _listFunctions; + this._getFunctionsAdminToken = _getFunctionsAdminToken; + this._getFunction = _getFunction; + this._createFunction = _createFunction; + this._deleteFunction = _deleteFunction; + this._listFunctionSecrets = _listFunctionSecrets; + this._listHostNameBindings = _listHostNameBindings; + this._getHostNameBinding = _getHostNameBinding; + this._createOrUpdateHostNameBinding = _createOrUpdateHostNameBinding; + this._deleteHostNameBinding = _deleteHostNameBinding; + this._getHybridConnection = _getHybridConnection; + this._createOrUpdateHybridConnection = _createOrUpdateHybridConnection; + this._deleteHybridConnection = _deleteHybridConnection; + this._updateHybridConnection = _updateHybridConnection; + this._listHybridConnectionKeys = _listHybridConnectionKeys; + this._listHybridConnections = _listHybridConnections; + this._listRelayServiceConnections = _listRelayServiceConnections; + this._getRelayServiceConnection = _getRelayServiceConnection; + this._createOrUpdateRelayServiceConnection = _createOrUpdateRelayServiceConnection; + this._deleteRelayServiceConnection = _deleteRelayServiceConnection; + this._updateRelayServiceConnection = _updateRelayServiceConnection; + this._listInstanceIdentifiers = _listInstanceIdentifiers; + this._getInstanceMsDeployStatus = _getInstanceMsDeployStatus; + this._createInstanceMSDeployOperation = _createInstanceMSDeployOperation; + this._getInstanceMSDeployLog = _getInstanceMSDeployLog; + this._listInstanceProcesses = _listInstanceProcesses; + this._getInstanceProcess = _getInstanceProcess; + this._deleteInstanceProcess = _deleteInstanceProcess; + this._getInstanceProcessDump = _getInstanceProcessDump; + this._listInstanceProcessModules = _listInstanceProcessModules; + this._getInstanceProcessModule = _getInstanceProcessModule; + this._listInstanceProcessThreads = _listInstanceProcessThreads; + this._getInstanceProcessThread = _getInstanceProcessThread; + this._isCloneable = _isCloneable; + this._listSyncFunctionTriggers = _listSyncFunctionTriggers; + this._listMetricDefinitions = _listMetricDefinitions; + this._listMetrics = _listMetrics; + this._migrateStorage = _migrateStorage; + this._migrateMySql = _migrateMySql; + this._getMigrateMySqlStatus = _getMigrateMySqlStatus; + this._listNetworkFeatures = _listNetworkFeatures; + this._startWebSiteNetworkTrace = _startWebSiteNetworkTrace; + this._stopWebSiteNetworkTrace = _stopWebSiteNetworkTrace; + this._generateNewSitePublishingPassword = _generateNewSitePublishingPassword; + this._listPerfMonCounters = _listPerfMonCounters; + this._getSitePhpErrorLogFlag = _getSitePhpErrorLogFlag; + this._listPremierAddOns = _listPremierAddOns; + this._getPremierAddOn = _getPremierAddOn; + this._addPremierAddOn = _addPremierAddOn; + this._deletePremierAddOn = _deletePremierAddOn; + this._updatePremierAddOn = _updatePremierAddOn; + this._getPrivateAccess = _getPrivateAccess; + this._putPrivateAccessVnet = _putPrivateAccessVnet; + this._listProcesses = _listProcesses; + this._getProcess = _getProcess; + this._deleteProcess = _deleteProcess; + this._getProcessDump = _getProcessDump; + this._listProcessModules = _listProcessModules; + this._getProcessModule = _getProcessModule; + this._listProcessThreads = _listProcessThreads; + this._getProcessThread = _getProcessThread; + this._listPublicCertificates = _listPublicCertificates; + this._getPublicCertificate = _getPublicCertificate; + this._createOrUpdatePublicCertificate = _createOrUpdatePublicCertificate; + this._deletePublicCertificate = _deletePublicCertificate; + this._listPublishingProfileXmlWithSecrets = _listPublishingProfileXmlWithSecrets; + this._resetProductionSlotConfig = _resetProductionSlotConfig; + this._restart = _restart; + this._restoreFromBackupBlob = _restoreFromBackupBlob; + this._restoreFromDeletedApp = _restoreFromDeletedApp; + this._restoreSnapshot = _restoreSnapshot; + this._listSiteExtensions = _listSiteExtensions; + this._getSiteExtension = _getSiteExtension; + this._installSiteExtension = _installSiteExtension; + this._deleteSiteExtension = _deleteSiteExtension; + this._listSlots = _listSlots; + this._getSlot = _getSlot; + this._createOrUpdateSlot = _createOrUpdateSlot; + this._deleteSlot = _deleteSlot; + this._updateSlot = _updateSlot; + this._analyzeCustomHostnameSlot = _analyzeCustomHostnameSlot; + this._applySlotConfigurationSlot = _applySlotConfigurationSlot; + this._backupSlot = _backupSlot; + this._listBackupsSlot = _listBackupsSlot; + this._getBackupStatusSlot = _getBackupStatusSlot; + this._deleteBackupSlot = _deleteBackupSlot; + this._listBackupStatusSecretsSlot = _listBackupStatusSecretsSlot; + this._restoreSlot = _restoreSlot; + this._listConfigurationsSlot = _listConfigurationsSlot; + this._updateApplicationSettingsSlot = _updateApplicationSettingsSlot; + this._listApplicationSettingsSlot = _listApplicationSettingsSlot; + this._updateAuthSettingsSlot = _updateAuthSettingsSlot; + this._getAuthSettingsSlot = _getAuthSettingsSlot; + this._updateAzureStorageAccountsSlot = _updateAzureStorageAccountsSlot; + this._listAzureStorageAccountsSlot = _listAzureStorageAccountsSlot; + this._updateBackupConfigurationSlot = _updateBackupConfigurationSlot; + this._deleteBackupConfigurationSlot = _deleteBackupConfigurationSlot; + this._getBackupConfigurationSlot = _getBackupConfigurationSlot; + this._updateConnectionStringsSlot = _updateConnectionStringsSlot; + this._listConnectionStringsSlot = _listConnectionStringsSlot; + this._getDiagnosticLogsConfigurationSlot = _getDiagnosticLogsConfigurationSlot; + this._updateDiagnosticLogsConfigSlot = _updateDiagnosticLogsConfigSlot; + this._updateMetadataSlot = _updateMetadataSlot; + this._listMetadataSlot = _listMetadataSlot; + this._listPublishingCredentialsSlot = _listPublishingCredentialsSlot; + this._updateSitePushSettingsSlot = _updateSitePushSettingsSlot; + this._listSitePushSettingsSlot = _listSitePushSettingsSlot; + this._getSwiftVirtualNetworkConnectionSlot = _getSwiftVirtualNetworkConnectionSlot; + this._createOrUpdateSwiftVirtualNetworkConnectionSlot = _createOrUpdateSwiftVirtualNetworkConnectionSlot; + this._deleteSwiftVirtualNetworkSlot = _deleteSwiftVirtualNetworkSlot; + this._updateSwiftVirtualNetworkConnectionSlot = _updateSwiftVirtualNetworkConnectionSlot; + this._getConfigurationSlot = _getConfigurationSlot; + this._createOrUpdateConfigurationSlot = _createOrUpdateConfigurationSlot; + this._updateConfigurationSlot = _updateConfigurationSlot; + this._listConfigurationSnapshotInfoSlot = _listConfigurationSnapshotInfoSlot; + this._getConfigurationSnapshotSlot = _getConfigurationSnapshotSlot; + this._recoverSiteConfigurationSnapshotSlot = _recoverSiteConfigurationSnapshotSlot; + this._getWebSiteContainerLogsSlot = _getWebSiteContainerLogsSlot; + this._getContainerLogsZipSlot = _getContainerLogsZipSlot; + this._listContinuousWebJobsSlot = _listContinuousWebJobsSlot; + this._getContinuousWebJobSlot = _getContinuousWebJobSlot; + this._deleteContinuousWebJobSlot = _deleteContinuousWebJobSlot; + this._startContinuousWebJobSlot = _startContinuousWebJobSlot; + this._stopContinuousWebJobSlot = _stopContinuousWebJobSlot; + this._listDeploymentsSlot = _listDeploymentsSlot; + this._getDeploymentSlot = _getDeploymentSlot; + this._createDeploymentSlot = _createDeploymentSlot; + this._deleteDeploymentSlot = _deleteDeploymentSlot; + this._listDeploymentLogSlot = _listDeploymentLogSlot; + this._discoverBackupSlot = _discoverBackupSlot; + this._listDomainOwnershipIdentifiersSlot = _listDomainOwnershipIdentifiersSlot; + this._getDomainOwnershipIdentifierSlot = _getDomainOwnershipIdentifierSlot; + this._createOrUpdateDomainOwnershipIdentifierSlot = _createOrUpdateDomainOwnershipIdentifierSlot; + this._deleteDomainOwnershipIdentifierSlot = _deleteDomainOwnershipIdentifierSlot; + this._updateDomainOwnershipIdentifierSlot = _updateDomainOwnershipIdentifierSlot; + this._getMSDeployStatusSlot = _getMSDeployStatusSlot; + this._createMSDeployOperationSlot = _createMSDeployOperationSlot; + this._getMSDeployLogSlot = _getMSDeployLogSlot; + this._listInstanceFunctionsSlot = _listInstanceFunctionsSlot; + this._getFunctionsAdminTokenSlot = _getFunctionsAdminTokenSlot; + this._getInstanceFunctionSlot = _getInstanceFunctionSlot; + this._createInstanceFunctionSlot = _createInstanceFunctionSlot; + this._deleteInstanceFunctionSlot = _deleteInstanceFunctionSlot; + this._listFunctionSecretsSlot = _listFunctionSecretsSlot; + this._listHostNameBindingsSlot = _listHostNameBindingsSlot; + this._getHostNameBindingSlot = _getHostNameBindingSlot; + this._createOrUpdateHostNameBindingSlot = _createOrUpdateHostNameBindingSlot; + this._deleteHostNameBindingSlot = _deleteHostNameBindingSlot; + this._getHybridConnectionSlot = _getHybridConnectionSlot; + this._createOrUpdateHybridConnectionSlot = _createOrUpdateHybridConnectionSlot; + this._deleteHybridConnectionSlot = _deleteHybridConnectionSlot; + this._updateHybridConnectionSlot = _updateHybridConnectionSlot; + this._listHybridConnectionKeysSlot = _listHybridConnectionKeysSlot; + this._listHybridConnectionsSlot = _listHybridConnectionsSlot; + this._listRelayServiceConnectionsSlot = _listRelayServiceConnectionsSlot; + this._getRelayServiceConnectionSlot = _getRelayServiceConnectionSlot; + this._createOrUpdateRelayServiceConnectionSlot = _createOrUpdateRelayServiceConnectionSlot; + this._deleteRelayServiceConnectionSlot = _deleteRelayServiceConnectionSlot; + this._updateRelayServiceConnectionSlot = _updateRelayServiceConnectionSlot; + this._listInstanceIdentifiersSlot = _listInstanceIdentifiersSlot; + this._getInstanceMsDeployStatusSlot = _getInstanceMsDeployStatusSlot; + this._createInstanceMSDeployOperationSlot = _createInstanceMSDeployOperationSlot; + this._getInstanceMSDeployLogSlot = _getInstanceMSDeployLogSlot; + this._listInstanceProcessesSlot = _listInstanceProcessesSlot; + this._getInstanceProcessSlot = _getInstanceProcessSlot; + this._deleteInstanceProcessSlot = _deleteInstanceProcessSlot; + this._getInstanceProcessDumpSlot = _getInstanceProcessDumpSlot; + this._listInstanceProcessModulesSlot = _listInstanceProcessModulesSlot; + this._getInstanceProcessModuleSlot = _getInstanceProcessModuleSlot; + this._listInstanceProcessThreadsSlot = _listInstanceProcessThreadsSlot; + this._getInstanceProcessThreadSlot = _getInstanceProcessThreadSlot; + this._isCloneableSlot = _isCloneableSlot; + this._listSyncFunctionTriggersSlot = _listSyncFunctionTriggersSlot; + this._listMetricDefinitionsSlot = _listMetricDefinitionsSlot; + this._listMetricsSlot = _listMetricsSlot; + this._getMigrateMySqlStatusSlot = _getMigrateMySqlStatusSlot; + this._listNetworkFeaturesSlot = _listNetworkFeaturesSlot; + this._startWebSiteNetworkTraceSlot = _startWebSiteNetworkTraceSlot; + this._stopWebSiteNetworkTraceSlot = _stopWebSiteNetworkTraceSlot; + this._generateNewSitePublishingPasswordSlot = _generateNewSitePublishingPasswordSlot; + this._listPerfMonCountersSlot = _listPerfMonCountersSlot; + this._getSitePhpErrorLogFlagSlot = _getSitePhpErrorLogFlagSlot; + this._listPremierAddOnsSlot = _listPremierAddOnsSlot; + this._getPremierAddOnSlot = _getPremierAddOnSlot; + this._addPremierAddOnSlot = _addPremierAddOnSlot; + this._deletePremierAddOnSlot = _deletePremierAddOnSlot; + this._updatePremierAddOnSlot = _updatePremierAddOnSlot; + this._getPrivateAccessSlot = _getPrivateAccessSlot; + this._putPrivateAccessVnetSlot = _putPrivateAccessVnetSlot; + this._listProcessesSlot = _listProcessesSlot; + this._getProcessSlot = _getProcessSlot; + this._deleteProcessSlot = _deleteProcessSlot; + this._getProcessDumpSlot = _getProcessDumpSlot; + this._listProcessModulesSlot = _listProcessModulesSlot; + this._getProcessModuleSlot = _getProcessModuleSlot; + this._listProcessThreadsSlot = _listProcessThreadsSlot; + this._getProcessThreadSlot = _getProcessThreadSlot; + this._listPublicCertificatesSlot = _listPublicCertificatesSlot; + this._getPublicCertificateSlot = _getPublicCertificateSlot; + this._createOrUpdatePublicCertificateSlot = _createOrUpdatePublicCertificateSlot; + this._deletePublicCertificateSlot = _deletePublicCertificateSlot; + this._listPublishingProfileXmlWithSecretsSlot = _listPublishingProfileXmlWithSecretsSlot; + this._resetSlotConfigurationSlot = _resetSlotConfigurationSlot; + this._restartSlot = _restartSlot; + this._restoreFromBackupBlobSlot = _restoreFromBackupBlobSlot; + this._restoreFromDeletedAppSlot = _restoreFromDeletedAppSlot; + this._restoreSnapshotSlot = _restoreSnapshotSlot; + this._listSiteExtensionsSlot = _listSiteExtensionsSlot; + this._getSiteExtensionSlot = _getSiteExtensionSlot; + this._installSiteExtensionSlot = _installSiteExtensionSlot; + this._deleteSiteExtensionSlot = _deleteSiteExtensionSlot; + this._listSlotDifferencesSlot = _listSlotDifferencesSlot; + this._swapSlotSlot = _swapSlotSlot; + this._listSnapshotsSlot = _listSnapshotsSlot; + this._getSourceControlSlot = _getSourceControlSlot; + this._createOrUpdateSourceControlSlot = _createOrUpdateSourceControlSlot; + this._deleteSourceControlSlot = _deleteSourceControlSlot; + this._updateSourceControlSlot = _updateSourceControlSlot; + this._startSlot = _startSlot; + this._stopSlot = _stopSlot; + this._syncRepositorySlot = _syncRepositorySlot; + this._syncFunctionTriggersSlot = _syncFunctionTriggersSlot; + this._listTriggeredWebJobsSlot = _listTriggeredWebJobsSlot; + this._getTriggeredWebJobSlot = _getTriggeredWebJobSlot; + this._deleteTriggeredWebJobSlot = _deleteTriggeredWebJobSlot; + this._listTriggeredWebJobHistorySlot = _listTriggeredWebJobHistorySlot; + this._getTriggeredWebJobHistorySlot = _getTriggeredWebJobHistorySlot; + this._runTriggeredWebJobSlot = _runTriggeredWebJobSlot; + this._listUsagesSlot = _listUsagesSlot; + this._listVnetConnectionsSlot = _listVnetConnectionsSlot; + this._getVnetConnectionSlot = _getVnetConnectionSlot; + this._createOrUpdateVnetConnectionSlot = _createOrUpdateVnetConnectionSlot; + this._deleteVnetConnectionSlot = _deleteVnetConnectionSlot; + this._updateVnetConnectionSlot = _updateVnetConnectionSlot; + this._getVnetConnectionGatewaySlot = _getVnetConnectionGatewaySlot; + this._createOrUpdateVnetConnectionGatewaySlot = _createOrUpdateVnetConnectionGatewaySlot; + this._updateVnetConnectionGatewaySlot = _updateVnetConnectionGatewaySlot; + this._listWebJobsSlot = _listWebJobsSlot; + this._getWebJobSlot = _getWebJobSlot; + this._listSlotDifferencesFromProduction = _listSlotDifferencesFromProduction; + this._swapSlotWithProduction = _swapSlotWithProduction; + this._listSnapshots = _listSnapshots; + this._getSourceControl = _getSourceControl; + this._createOrUpdateSourceControl = _createOrUpdateSourceControl; + this._deleteSourceControl = _deleteSourceControl; + this._updateSourceControl = _updateSourceControl; + this._start = _start; + this._stop = _stop; + this._syncRepository = _syncRepository; + this._syncFunctionTriggers = _syncFunctionTriggers; + this._listTriggeredWebJobs = _listTriggeredWebJobs; + this._getTriggeredWebJob = _getTriggeredWebJob; + this._deleteTriggeredWebJob = _deleteTriggeredWebJob; + this._listTriggeredWebJobHistory = _listTriggeredWebJobHistory; + this._getTriggeredWebJobHistory = _getTriggeredWebJobHistory; + this._runTriggeredWebJob = _runTriggeredWebJob; + this._listUsages = _listUsages; + this._listVnetConnections = _listVnetConnections; + this._getVnetConnection = _getVnetConnection; + this._createOrUpdateVnetConnection = _createOrUpdateVnetConnection; + this._deleteVnetConnection = _deleteVnetConnection; + this._updateVnetConnection = _updateVnetConnection; + this._getVnetConnectionGateway = _getVnetConnectionGateway; + this._createOrUpdateVnetConnectionGateway = _createOrUpdateVnetConnectionGateway; + this._updateVnetConnectionGateway = _updateVnetConnectionGateway; + this._listWebJobs = _listWebJobs; + this._getWebJob = _getWebJob; + this._beginCreateOrUpdate = _beginCreateOrUpdate; + this._beginRestore = _beginRestore; + this._beginListPublishingCredentials = _beginListPublishingCredentials; + this._beginCreateMSDeployOperation = _beginCreateMSDeployOperation; + this._beginCreateFunction = _beginCreateFunction; + this._beginCreateInstanceMSDeployOperation = _beginCreateInstanceMSDeployOperation; + this._beginMigrateStorage = _beginMigrateStorage; + this._beginMigrateMySql = _beginMigrateMySql; + this._beginRestoreFromBackupBlob = _beginRestoreFromBackupBlob; + this._beginRestoreFromDeletedApp = _beginRestoreFromDeletedApp; + this._beginRestoreSnapshot = _beginRestoreSnapshot; + this._beginInstallSiteExtension = _beginInstallSiteExtension; + this._beginCreateOrUpdateSlot = _beginCreateOrUpdateSlot; + this._beginRestoreSlot = _beginRestoreSlot; + this._beginListPublishingCredentialsSlot = _beginListPublishingCredentialsSlot; + this._beginCreateMSDeployOperationSlot = _beginCreateMSDeployOperationSlot; + this._beginCreateInstanceFunctionSlot = _beginCreateInstanceFunctionSlot; + this._beginCreateInstanceMSDeployOperationSlot = _beginCreateInstanceMSDeployOperationSlot; + this._beginRestoreFromBackupBlobSlot = _beginRestoreFromBackupBlobSlot; + this._beginRestoreFromDeletedAppSlot = _beginRestoreFromDeletedAppSlot; + this._beginRestoreSnapshotSlot = _beginRestoreSnapshotSlot; + this._beginInstallSiteExtensionSlot = _beginInstallSiteExtensionSlot; + this._beginSwapSlotSlot = _beginSwapSlotSlot; + this._beginCreateOrUpdateSourceControlSlot = _beginCreateOrUpdateSourceControlSlot; + this._beginSwapSlotWithProduction = _beginSwapSlotWithProduction; + this._beginCreateOrUpdateSourceControl = _beginCreateOrUpdateSourceControl; + this._listNext = _listNext; + this._listByResourceGroupNext = _listByResourceGroupNext; + this._listBackupsNext = _listBackupsNext; + this._listConfigurationsNext = _listConfigurationsNext; + this._listConfigurationSnapshotInfoNext = _listConfigurationSnapshotInfoNext; + this._listContinuousWebJobsNext = _listContinuousWebJobsNext; + this._listDeploymentsNext = _listDeploymentsNext; + this._listDomainOwnershipIdentifiersNext = _listDomainOwnershipIdentifiersNext; + this._listFunctionsNext = _listFunctionsNext; + this._listHostNameBindingsNext = _listHostNameBindingsNext; + this._listInstanceIdentifiersNext = _listInstanceIdentifiersNext; + this._listInstanceProcessesNext = _listInstanceProcessesNext; + this._listInstanceProcessModulesNext = _listInstanceProcessModulesNext; + this._listInstanceProcessThreadsNext = _listInstanceProcessThreadsNext; + this._listMetricDefinitionsNext = _listMetricDefinitionsNext; + this._listMetricsNext = _listMetricsNext; + this._listPerfMonCountersNext = _listPerfMonCountersNext; + this._listProcessesNext = _listProcessesNext; + this._listProcessModulesNext = _listProcessModulesNext; + this._listProcessThreadsNext = _listProcessThreadsNext; + this._listPublicCertificatesNext = _listPublicCertificatesNext; + this._listSiteExtensionsNext = _listSiteExtensionsNext; + this._listSlotsNext = _listSlotsNext; + this._listBackupsSlotNext = _listBackupsSlotNext; + this._listConfigurationsSlotNext = _listConfigurationsSlotNext; + this._listConfigurationSnapshotInfoSlotNext = _listConfigurationSnapshotInfoSlotNext; + this._listContinuousWebJobsSlotNext = _listContinuousWebJobsSlotNext; + this._listDeploymentsSlotNext = _listDeploymentsSlotNext; + this._listDomainOwnershipIdentifiersSlotNext = _listDomainOwnershipIdentifiersSlotNext; + this._listInstanceFunctionsSlotNext = _listInstanceFunctionsSlotNext; + this._listHostNameBindingsSlotNext = _listHostNameBindingsSlotNext; + this._listInstanceIdentifiersSlotNext = _listInstanceIdentifiersSlotNext; + this._listInstanceProcessesSlotNext = _listInstanceProcessesSlotNext; + this._listInstanceProcessModulesSlotNext = _listInstanceProcessModulesSlotNext; + this._listInstanceProcessThreadsSlotNext = _listInstanceProcessThreadsSlotNext; + this._listMetricDefinitionsSlotNext = _listMetricDefinitionsSlotNext; + this._listMetricsSlotNext = _listMetricsSlotNext; + this._listPerfMonCountersSlotNext = _listPerfMonCountersSlotNext; + this._listProcessesSlotNext = _listProcessesSlotNext; + this._listProcessModulesSlotNext = _listProcessModulesSlotNext; + this._listProcessThreadsSlotNext = _listProcessThreadsSlotNext; + this._listPublicCertificatesSlotNext = _listPublicCertificatesSlotNext; + this._listSiteExtensionsSlotNext = _listSiteExtensionsSlotNext; + this._listSlotDifferencesSlotNext = _listSlotDifferencesSlotNext; + this._listSnapshotsSlotNext = _listSnapshotsSlotNext; + this._listTriggeredWebJobsSlotNext = _listTriggeredWebJobsSlotNext; + this._listTriggeredWebJobHistorySlotNext = _listTriggeredWebJobHistorySlotNext; + this._listUsagesSlotNext = _listUsagesSlotNext; + this._listWebJobsSlotNext = _listWebJobsSlotNext; + this._listSlotDifferencesFromProductionNext = _listSlotDifferencesFromProductionNext; + this._listSnapshotsNext = _listSnapshotsNext; + this._listTriggeredWebJobsNext = _listTriggeredWebJobsNext; + this._listTriggeredWebJobHistoryNext = _listTriggeredWebJobHistoryNext; + this._listUsagesNext = _listUsagesNext; + this._listWebJobsNext = _listWebJobsNext; + } + + /** + * @summary Get all apps for a subscription. + * + * Get all apps for a subscription. + * + * @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. + */ + 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 Get all apps for a subscription. + * + * Get all apps for a subscription. + * + * @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 {WebAppCollection} - 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 WebAppCollection} 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 all web, mobile, and API apps in the specified resource group. + * + * Gets all web, mobile, and API apps in the specified resource group. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {object} [options] Optional Parameters. + * + * @param {boolean} [options.includeSlots] Specify true to + * include deployment slots in results. The default is false, which only gives + * you the production slot of all apps. + * + * @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. + */ + listByResourceGroupWithHttpOperationResponse(resourceGroupName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listByResourceGroup(resourceGroupName, 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 all web, mobile, and API apps in the specified resource group. + * + * Gets all web, mobile, and API apps in the specified resource group. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {object} [options] Optional Parameters. + * + * @param {boolean} [options.includeSlots] Specify true to + * include deployment slots in results. The default is false, which only gives + * you the production slot of all apps. + * + * @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 {WebAppCollection} - 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 WebAppCollection} 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. + */ + listByResourceGroup(resourceGroupName, 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._listByResourceGroup(resourceGroupName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listByResourceGroup(resourceGroupName, options, optionalCallback); + } + } + + /** + * @summary Gets the details of a web, mobile, or API app. + * + * Gets the details of a web, mobile, or API app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + getWithHttpOperationResponse(resourceGroupName, name, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._get(resourceGroupName, name, 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 the details of a web, mobile, or API app. + * + * Gets the details of a web, mobile, or API app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @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 {Site} - 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 Site} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + get(resourceGroupName, name, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._get(resourceGroupName, name, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._get(resourceGroupName, name, options, optionalCallback); + } + } + + /** + * @summary Creates a new web, mobile, or API app in an existing resource + * group, or updates an existing app. + * + * Creates a new web, mobile, or API app in an existing resource group, or + * updates an existing app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Unique name of the app to create or update. To create + * or update a deployment slot, use the {slot} parameter. + * + * @param {object} siteEnvelope A JSON representation of the app properties. + * See example. + * + * @param {boolean} [siteEnvelope.enabled] true if the app is + * enabled; otherwise, false. Setting this value to false disables + * the app (takes the app offline). + * + * @param {array} [siteEnvelope.hostNameSslStates] Hostname SSL states are used + * to manage the SSL bindings for app's hostnames. + * + * @param {string} [siteEnvelope.serverFarmId] Resource ID of the associated + * App Service plan, formatted as: + * "/subscriptions/{subscriptionID}/resourceGroups/{groupName}/providers/Microsoft.Web/serverfarms/{appServicePlanName}". + * + * @param {boolean} [siteEnvelope.reserved] true if reserved; + * otherwise, false. + * + * @param {boolean} [siteEnvelope.isXenon] Obsolete: Hyper-V sandbox. + * + * @param {boolean} [siteEnvelope.hyperV] Hyper-V sandbox. + * + * @param {object} [siteEnvelope.siteConfig] Configuration of the app. + * + * @param {number} [siteEnvelope.siteConfig.numberOfWorkers] Number of workers. + * + * @param {array} [siteEnvelope.siteConfig.defaultDocuments] Default documents. + * + * @param {string} [siteEnvelope.siteConfig.netFrameworkVersion] .NET Framework + * version. + * + * @param {string} [siteEnvelope.siteConfig.phpVersion] Version of PHP. + * + * @param {string} [siteEnvelope.siteConfig.pythonVersion] Version of Python. + * + * @param {string} [siteEnvelope.siteConfig.nodeVersion] Version of Node.js. + * + * @param {string} [siteEnvelope.siteConfig.linuxFxVersion] Linux App Framework + * and version + * + * @param {string} [siteEnvelope.siteConfig.windowsFxVersion] Xenon App + * Framework and version + * + * @param {boolean} [siteEnvelope.siteConfig.requestTracingEnabled] + * true if request tracing is enabled; otherwise, + * false. + * + * @param {date} [siteEnvelope.siteConfig.requestTracingExpirationTime] Request + * tracing expiration time. + * + * @param {boolean} [siteEnvelope.siteConfig.remoteDebuggingEnabled] + * true if remote debugging is enabled; otherwise, + * false. + * + * @param {string} [siteEnvelope.siteConfig.remoteDebuggingVersion] Remote + * debugging version. + * + * @param {boolean} [siteEnvelope.siteConfig.httpLoggingEnabled] + * true if HTTP logging is enabled; otherwise, false. + * + * @param {number} [siteEnvelope.siteConfig.logsDirectorySizeLimit] HTTP logs + * directory size limit. + * + * @param {boolean} [siteEnvelope.siteConfig.detailedErrorLoggingEnabled] + * true if detailed error logging is enabled; otherwise, + * false. + * + * @param {string} [siteEnvelope.siteConfig.publishingUsername] Publishing user + * name. + * + * @param {array} [siteEnvelope.siteConfig.appSettings] Application settings. + * + * @param {object} [siteEnvelope.siteConfig.azureStorageAccounts] User-provided + * Azure storage accounts. + * + * @param {array} [siteEnvelope.siteConfig.connectionStrings] Connection + * strings. + * + * @param {array} [siteEnvelope.siteConfig.handlerMappings] Handler mappings. + * + * @param {string} [siteEnvelope.siteConfig.documentRoot] Document root. + * + * @param {string} [siteEnvelope.siteConfig.scmType] SCM type. Possible values + * include: 'None', 'Dropbox', 'Tfs', 'LocalGit', 'GitHub', 'CodePlexGit', + * 'CodePlexHg', 'BitbucketGit', 'BitbucketHg', 'ExternalGit', 'ExternalHg', + * 'OneDrive', 'VSO' + * + * @param {boolean} [siteEnvelope.siteConfig.use32BitWorkerProcess] + * true to use 32-bit worker process; otherwise, + * false. + * + * @param {boolean} [siteEnvelope.siteConfig.webSocketsEnabled] + * true if WebSocket is enabled; otherwise, false. + * + * @param {boolean} [siteEnvelope.siteConfig.alwaysOn] true if + * Always On is enabled; otherwise, false. + * + * @param {string} [siteEnvelope.siteConfig.javaVersion] Java version. + * + * @param {string} [siteEnvelope.siteConfig.javaContainer] Java container. + * + * @param {string} [siteEnvelope.siteConfig.javaContainerVersion] Java + * container version. + * + * @param {string} [siteEnvelope.siteConfig.appCommandLine] App command line to + * launch. + * + * @param {string} [siteEnvelope.siteConfig.managedPipelineMode] Managed + * pipeline mode. Possible values include: 'Integrated', 'Classic' + * + * @param {array} [siteEnvelope.siteConfig.virtualApplications] Virtual + * applications. + * + * @param {string} [siteEnvelope.siteConfig.loadBalancing] Site load balancing. + * Possible values include: 'WeightedRoundRobin', 'LeastRequests', + * 'LeastResponseTime', 'WeightedTotalTraffic', 'RequestHash' + * + * @param {object} [siteEnvelope.siteConfig.experiments] This is work around + * for polymophic types. + * + * @param {array} [siteEnvelope.siteConfig.experiments.rampUpRules] List of + * ramp-up rules. + * + * @param {object} [siteEnvelope.siteConfig.limits] Site limits. + * + * @param {number} [siteEnvelope.siteConfig.limits.maxPercentageCpu] Maximum + * allowed CPU usage percentage. + * + * @param {number} [siteEnvelope.siteConfig.limits.maxMemoryInMb] Maximum + * allowed memory usage in MB. + * + * @param {number} [siteEnvelope.siteConfig.limits.maxDiskSizeInMb] Maximum + * allowed disk size usage in MB. + * + * @param {boolean} [siteEnvelope.siteConfig.autoHealEnabled] true + * if Auto Heal is enabled; otherwise, false. + * + * @param {object} [siteEnvelope.siteConfig.autoHealRules] Auto Heal rules. + * + * @param {object} [siteEnvelope.siteConfig.autoHealRules.triggers] Conditions + * that describe when to execute the auto-heal actions. + * + * @param {object} [siteEnvelope.siteConfig.autoHealRules.triggers.requests] A + * rule based on total requests. + * + * @param {number} + * [siteEnvelope.siteConfig.autoHealRules.triggers.requests.count] Request + * Count. + * + * @param {string} + * [siteEnvelope.siteConfig.autoHealRules.triggers.requests.timeInterval] Time + * interval. + * + * @param {number} + * [siteEnvelope.siteConfig.autoHealRules.triggers.privateBytesInKB] A rule + * based on private bytes. + * + * @param {array} [siteEnvelope.siteConfig.autoHealRules.triggers.statusCodes] + * A rule based on status codes. + * + * @param {object} + * [siteEnvelope.siteConfig.autoHealRules.triggers.slowRequests] A rule based + * on request execution time. + * + * @param {string} + * [siteEnvelope.siteConfig.autoHealRules.triggers.slowRequests.timeTaken] Time + * taken. + * + * @param {number} + * [siteEnvelope.siteConfig.autoHealRules.triggers.slowRequests.count] Request + * Count. + * + * @param {string} + * [siteEnvelope.siteConfig.autoHealRules.triggers.slowRequests.timeInterval] + * Time interval. + * + * @param {object} [siteEnvelope.siteConfig.autoHealRules.actions] Actions to + * be executed when a rule is triggered. + * + * @param {string} [siteEnvelope.siteConfig.autoHealRules.actions.actionType] + * Predefined action to be taken. Possible values include: 'Recycle', + * 'LogEvent', 'CustomAction' + * + * @param {object} [siteEnvelope.siteConfig.autoHealRules.actions.customAction] + * Custom action to be taken. + * + * @param {string} + * [siteEnvelope.siteConfig.autoHealRules.actions.customAction.exe] Executable + * to be run. + * + * @param {string} + * [siteEnvelope.siteConfig.autoHealRules.actions.customAction.parameters] + * Parameters for the executable. + * + * @param {string} + * [siteEnvelope.siteConfig.autoHealRules.actions.minProcessExecutionTime] + * Minimum time the process must execute + * before taking the action + * + * @param {string} [siteEnvelope.siteConfig.tracingOptions] Tracing options. + * + * @param {string} [siteEnvelope.siteConfig.vnetName] Virtual Network name. + * + * @param {object} [siteEnvelope.siteConfig.cors] Cross-Origin Resource Sharing + * (CORS) settings. + * + * @param {array} [siteEnvelope.siteConfig.cors.allowedOrigins] Gets or sets + * the list of origins that should be allowed to make cross-origin + * calls (for example: http://example.com:12345). Use "*" to allow all. + * + * @param {object} [siteEnvelope.siteConfig.push] Push endpoint settings. + * + * @param {boolean} siteEnvelope.siteConfig.push.isPushEnabled Gets or sets a + * flag indicating whether the Push endpoint is enabled. + * + * @param {string} [siteEnvelope.siteConfig.push.tagWhitelistJson] Gets or sets + * a JSON string containing a list of tags that are whitelisted for use by the + * push registration endpoint. + * + * @param {string} [siteEnvelope.siteConfig.push.tagsRequiringAuth] Gets or + * sets a JSON string containing a list of tags that require user + * authentication to be used in the push registration endpoint. + * Tags can consist of alphanumeric characters and the following: + * '_', '@', '#', '.', ':', '-'. + * Validation should be performed at the PushRequestHandler. + * + * @param {string} [siteEnvelope.siteConfig.push.dynamicTagsJson] Gets or sets + * a JSON string containing a list of dynamic tags that will be evaluated from + * user claims in the push registration endpoint. + * + * @param {string} [siteEnvelope.siteConfig.push.kind] Kind of resource. + * + * @param {object} [siteEnvelope.siteConfig.apiDefinition] Information about + * the formal API definition for the app. + * + * @param {string} [siteEnvelope.siteConfig.apiDefinition.url] The URL of the + * API definition. + * + * @param {string} [siteEnvelope.siteConfig.autoSwapSlotName] Auto-swap slot + * name. + * + * @param {boolean} [siteEnvelope.siteConfig.localMySqlEnabled] + * true to enable local MySQL; otherwise, false. + * + * @param {number} [siteEnvelope.siteConfig.managedServiceIdentityId] Managed + * Service Identity Id + * + * @param {number} [siteEnvelope.siteConfig.xManagedServiceIdentityId] Explicit + * Managed Service Identity Id + * + * @param {array} [siteEnvelope.siteConfig.ipSecurityRestrictions] IP security + * restrictions. + * + * @param {boolean} [siteEnvelope.siteConfig.http20Enabled] Http20Enabled: + * configures a web site to allow clients to connect over http2.0 + * + * @param {string} [siteEnvelope.siteConfig.minTlsVersion] MinTlsVersion: + * configures the minimum version of TLS required for SSL requests. Possible + * values include: '1.0', '1.1', '1.2' + * + * @param {string} [siteEnvelope.siteConfig.ftpsState] State of FTP / FTPS + * service. Possible values include: 'AllAllowed', 'FtpsOnly', 'Disabled' + * + * @param {number} [siteEnvelope.siteConfig.reservedInstanceCount] Number of + * reserved instances. + * This setting only applies to the Consumption Plan + * + * @param {boolean} [siteEnvelope.scmSiteAlsoStopped] true to stop + * SCM (KUDU) site when the app is stopped; otherwise, false. The + * default is false. + * + * @param {object} [siteEnvelope.hostingEnvironmentProfile] App Service + * Environment to use for the app. + * + * @param {string} [siteEnvelope.hostingEnvironmentProfile.id] Resource ID of + * the App Service Environment. + * + * @param {boolean} [siteEnvelope.clientAffinityEnabled] true to + * enable client affinity; false to stop sending session affinity + * cookies, which route client requests in the same session to the same + * instance. Default is true. + * + * @param {boolean} [siteEnvelope.clientCertEnabled] true to + * enable client certificate authentication (TLS mutual authentication); + * otherwise, false. Default is false. + * + * @param {boolean} [siteEnvelope.hostNamesDisabled] true to + * disable the public hostnames of the app; otherwise, false. + * If true, the app is only accessible via API management process. + * + * @param {number} [siteEnvelope.containerSize] Size of the function container. + * + * @param {number} [siteEnvelope.dailyMemoryTimeQuota] Maximum allowed daily + * memory-time quota (applicable on dynamic apps only). + * + * @param {object} [siteEnvelope.cloningInfo] If specified during app creation, + * the app is cloned from a source app. + * + * @param {uuid} [siteEnvelope.cloningInfo.correlationId] Correlation ID of + * cloning operation. This ID ties multiple cloning operations + * together to use the same snapshot. + * + * @param {boolean} [siteEnvelope.cloningInfo.overwrite] true to + * overwrite destination app; otherwise, false. + * + * @param {boolean} [siteEnvelope.cloningInfo.cloneCustomHostNames] + * true to clone custom hostnames from source app; otherwise, + * false. + * + * @param {boolean} [siteEnvelope.cloningInfo.cloneSourceControl] + * true to clone source control from source app; otherwise, + * false. + * + * @param {string} siteEnvelope.cloningInfo.sourceWebAppId ARM resource ID of + * the source app. App resource ID is of the form + * /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName} + * for production slots and + * /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/slots/{slotName} + * for other slots. + * + * @param {string} [siteEnvelope.cloningInfo.hostingEnvironment] App Service + * Environment. + * + * @param {object} [siteEnvelope.cloningInfo.appSettingsOverrides] Application + * setting overrides for cloned app. If specified, these settings override the + * settings cloned + * from source app. Otherwise, application settings from source app are + * retained. + * + * @param {boolean} [siteEnvelope.cloningInfo.configureLoadBalancing] + * true to configure load balancing for source and destination + * app. + * + * @param {string} [siteEnvelope.cloningInfo.trafficManagerProfileId] ARM + * resource ID of the Traffic Manager profile to use, if it exists. Traffic + * Manager resource ID is of the form + * /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/trafficManagerProfiles/{profileName}. + * + * @param {string} [siteEnvelope.cloningInfo.trafficManagerProfileName] Name of + * Traffic Manager profile to create. This is only needed if Traffic Manager + * profile does not already exist. + * + * @param {boolean} [siteEnvelope.httpsOnly] HttpsOnly: configures a web site + * to accept only https requests. Issues redirect for + * http requests + * + * @param {object} [siteEnvelope.identity] + * + * @param {string} [siteEnvelope.identity.type] Type of managed service + * identity. Possible values include: 'SystemAssigned', 'UserAssigned' + * + * @param {array} [siteEnvelope.identity.identityIds] Array of UserAssigned + * managed service identities. + * + * @param {string} [siteEnvelope.kind] Kind of resource. + * + * @param {string} siteEnvelope.location Resource Location. + * + * @param {object} [siteEnvelope.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + createOrUpdateWithHttpOperationResponse(resourceGroupName, name, siteEnvelope, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._createOrUpdate(resourceGroupName, name, siteEnvelope, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Creates a new web, mobile, or API app in an existing resource + * group, or updates an existing app. + * + * Creates a new web, mobile, or API app in an existing resource group, or + * updates an existing app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Unique name of the app to create or update. To create + * or update a deployment slot, use the {slot} parameter. + * + * @param {object} siteEnvelope A JSON representation of the app properties. + * See example. + * + * @param {boolean} [siteEnvelope.enabled] true if the app is + * enabled; otherwise, false. Setting this value to false disables + * the app (takes the app offline). + * + * @param {array} [siteEnvelope.hostNameSslStates] Hostname SSL states are used + * to manage the SSL bindings for app's hostnames. + * + * @param {string} [siteEnvelope.serverFarmId] Resource ID of the associated + * App Service plan, formatted as: + * "/subscriptions/{subscriptionID}/resourceGroups/{groupName}/providers/Microsoft.Web/serverfarms/{appServicePlanName}". + * + * @param {boolean} [siteEnvelope.reserved] true if reserved; + * otherwise, false. + * + * @param {boolean} [siteEnvelope.isXenon] Obsolete: Hyper-V sandbox. + * + * @param {boolean} [siteEnvelope.hyperV] Hyper-V sandbox. + * + * @param {object} [siteEnvelope.siteConfig] Configuration of the app. + * + * @param {number} [siteEnvelope.siteConfig.numberOfWorkers] Number of workers. + * + * @param {array} [siteEnvelope.siteConfig.defaultDocuments] Default documents. + * + * @param {string} [siteEnvelope.siteConfig.netFrameworkVersion] .NET Framework + * version. + * + * @param {string} [siteEnvelope.siteConfig.phpVersion] Version of PHP. + * + * @param {string} [siteEnvelope.siteConfig.pythonVersion] Version of Python. + * + * @param {string} [siteEnvelope.siteConfig.nodeVersion] Version of Node.js. + * + * @param {string} [siteEnvelope.siteConfig.linuxFxVersion] Linux App Framework + * and version + * + * @param {string} [siteEnvelope.siteConfig.windowsFxVersion] Xenon App + * Framework and version + * + * @param {boolean} [siteEnvelope.siteConfig.requestTracingEnabled] + * true if request tracing is enabled; otherwise, + * false. + * + * @param {date} [siteEnvelope.siteConfig.requestTracingExpirationTime] Request + * tracing expiration time. + * + * @param {boolean} [siteEnvelope.siteConfig.remoteDebuggingEnabled] + * true if remote debugging is enabled; otherwise, + * false. + * + * @param {string} [siteEnvelope.siteConfig.remoteDebuggingVersion] Remote + * debugging version. + * + * @param {boolean} [siteEnvelope.siteConfig.httpLoggingEnabled] + * true if HTTP logging is enabled; otherwise, false. + * + * @param {number} [siteEnvelope.siteConfig.logsDirectorySizeLimit] HTTP logs + * directory size limit. + * + * @param {boolean} [siteEnvelope.siteConfig.detailedErrorLoggingEnabled] + * true if detailed error logging is enabled; otherwise, + * false. + * + * @param {string} [siteEnvelope.siteConfig.publishingUsername] Publishing user + * name. + * + * @param {array} [siteEnvelope.siteConfig.appSettings] Application settings. + * + * @param {object} [siteEnvelope.siteConfig.azureStorageAccounts] User-provided + * Azure storage accounts. + * + * @param {array} [siteEnvelope.siteConfig.connectionStrings] Connection + * strings. + * + * @param {array} [siteEnvelope.siteConfig.handlerMappings] Handler mappings. + * + * @param {string} [siteEnvelope.siteConfig.documentRoot] Document root. + * + * @param {string} [siteEnvelope.siteConfig.scmType] SCM type. Possible values + * include: 'None', 'Dropbox', 'Tfs', 'LocalGit', 'GitHub', 'CodePlexGit', + * 'CodePlexHg', 'BitbucketGit', 'BitbucketHg', 'ExternalGit', 'ExternalHg', + * 'OneDrive', 'VSO' + * + * @param {boolean} [siteEnvelope.siteConfig.use32BitWorkerProcess] + * true to use 32-bit worker process; otherwise, + * false. + * + * @param {boolean} [siteEnvelope.siteConfig.webSocketsEnabled] + * true if WebSocket is enabled; otherwise, false. + * + * @param {boolean} [siteEnvelope.siteConfig.alwaysOn] true if + * Always On is enabled; otherwise, false. + * + * @param {string} [siteEnvelope.siteConfig.javaVersion] Java version. + * + * @param {string} [siteEnvelope.siteConfig.javaContainer] Java container. + * + * @param {string} [siteEnvelope.siteConfig.javaContainerVersion] Java + * container version. + * + * @param {string} [siteEnvelope.siteConfig.appCommandLine] App command line to + * launch. + * + * @param {string} [siteEnvelope.siteConfig.managedPipelineMode] Managed + * pipeline mode. Possible values include: 'Integrated', 'Classic' + * + * @param {array} [siteEnvelope.siteConfig.virtualApplications] Virtual + * applications. + * + * @param {string} [siteEnvelope.siteConfig.loadBalancing] Site load balancing. + * Possible values include: 'WeightedRoundRobin', 'LeastRequests', + * 'LeastResponseTime', 'WeightedTotalTraffic', 'RequestHash' + * + * @param {object} [siteEnvelope.siteConfig.experiments] This is work around + * for polymophic types. + * + * @param {array} [siteEnvelope.siteConfig.experiments.rampUpRules] List of + * ramp-up rules. + * + * @param {object} [siteEnvelope.siteConfig.limits] Site limits. + * + * @param {number} [siteEnvelope.siteConfig.limits.maxPercentageCpu] Maximum + * allowed CPU usage percentage. + * + * @param {number} [siteEnvelope.siteConfig.limits.maxMemoryInMb] Maximum + * allowed memory usage in MB. + * + * @param {number} [siteEnvelope.siteConfig.limits.maxDiskSizeInMb] Maximum + * allowed disk size usage in MB. + * + * @param {boolean} [siteEnvelope.siteConfig.autoHealEnabled] true + * if Auto Heal is enabled; otherwise, false. + * + * @param {object} [siteEnvelope.siteConfig.autoHealRules] Auto Heal rules. + * + * @param {object} [siteEnvelope.siteConfig.autoHealRules.triggers] Conditions + * that describe when to execute the auto-heal actions. + * + * @param {object} [siteEnvelope.siteConfig.autoHealRules.triggers.requests] A + * rule based on total requests. + * + * @param {number} + * [siteEnvelope.siteConfig.autoHealRules.triggers.requests.count] Request + * Count. + * + * @param {string} + * [siteEnvelope.siteConfig.autoHealRules.triggers.requests.timeInterval] Time + * interval. + * + * @param {number} + * [siteEnvelope.siteConfig.autoHealRules.triggers.privateBytesInKB] A rule + * based on private bytes. + * + * @param {array} [siteEnvelope.siteConfig.autoHealRules.triggers.statusCodes] + * A rule based on status codes. + * + * @param {object} + * [siteEnvelope.siteConfig.autoHealRules.triggers.slowRequests] A rule based + * on request execution time. + * + * @param {string} + * [siteEnvelope.siteConfig.autoHealRules.triggers.slowRequests.timeTaken] Time + * taken. + * + * @param {number} + * [siteEnvelope.siteConfig.autoHealRules.triggers.slowRequests.count] Request + * Count. + * + * @param {string} + * [siteEnvelope.siteConfig.autoHealRules.triggers.slowRequests.timeInterval] + * Time interval. + * + * @param {object} [siteEnvelope.siteConfig.autoHealRules.actions] Actions to + * be executed when a rule is triggered. + * + * @param {string} [siteEnvelope.siteConfig.autoHealRules.actions.actionType] + * Predefined action to be taken. Possible values include: 'Recycle', + * 'LogEvent', 'CustomAction' + * + * @param {object} [siteEnvelope.siteConfig.autoHealRules.actions.customAction] + * Custom action to be taken. + * + * @param {string} + * [siteEnvelope.siteConfig.autoHealRules.actions.customAction.exe] Executable + * to be run. + * + * @param {string} + * [siteEnvelope.siteConfig.autoHealRules.actions.customAction.parameters] + * Parameters for the executable. + * + * @param {string} + * [siteEnvelope.siteConfig.autoHealRules.actions.minProcessExecutionTime] + * Minimum time the process must execute + * before taking the action + * + * @param {string} [siteEnvelope.siteConfig.tracingOptions] Tracing options. + * + * @param {string} [siteEnvelope.siteConfig.vnetName] Virtual Network name. + * + * @param {object} [siteEnvelope.siteConfig.cors] Cross-Origin Resource Sharing + * (CORS) settings. + * + * @param {array} [siteEnvelope.siteConfig.cors.allowedOrigins] Gets or sets + * the list of origins that should be allowed to make cross-origin + * calls (for example: http://example.com:12345). Use "*" to allow all. + * + * @param {object} [siteEnvelope.siteConfig.push] Push endpoint settings. + * + * @param {boolean} siteEnvelope.siteConfig.push.isPushEnabled Gets or sets a + * flag indicating whether the Push endpoint is enabled. + * + * @param {string} [siteEnvelope.siteConfig.push.tagWhitelistJson] Gets or sets + * a JSON string containing a list of tags that are whitelisted for use by the + * push registration endpoint. + * + * @param {string} [siteEnvelope.siteConfig.push.tagsRequiringAuth] Gets or + * sets a JSON string containing a list of tags that require user + * authentication to be used in the push registration endpoint. + * Tags can consist of alphanumeric characters and the following: + * '_', '@', '#', '.', ':', '-'. + * Validation should be performed at the PushRequestHandler. + * + * @param {string} [siteEnvelope.siteConfig.push.dynamicTagsJson] Gets or sets + * a JSON string containing a list of dynamic tags that will be evaluated from + * user claims in the push registration endpoint. + * + * @param {string} [siteEnvelope.siteConfig.push.kind] Kind of resource. + * + * @param {object} [siteEnvelope.siteConfig.apiDefinition] Information about + * the formal API definition for the app. + * + * @param {string} [siteEnvelope.siteConfig.apiDefinition.url] The URL of the + * API definition. + * + * @param {string} [siteEnvelope.siteConfig.autoSwapSlotName] Auto-swap slot + * name. + * + * @param {boolean} [siteEnvelope.siteConfig.localMySqlEnabled] + * true to enable local MySQL; otherwise, false. + * + * @param {number} [siteEnvelope.siteConfig.managedServiceIdentityId] Managed + * Service Identity Id + * + * @param {number} [siteEnvelope.siteConfig.xManagedServiceIdentityId] Explicit + * Managed Service Identity Id + * + * @param {array} [siteEnvelope.siteConfig.ipSecurityRestrictions] IP security + * restrictions. + * + * @param {boolean} [siteEnvelope.siteConfig.http20Enabled] Http20Enabled: + * configures a web site to allow clients to connect over http2.0 + * + * @param {string} [siteEnvelope.siteConfig.minTlsVersion] MinTlsVersion: + * configures the minimum version of TLS required for SSL requests. Possible + * values include: '1.0', '1.1', '1.2' + * + * @param {string} [siteEnvelope.siteConfig.ftpsState] State of FTP / FTPS + * service. Possible values include: 'AllAllowed', 'FtpsOnly', 'Disabled' + * + * @param {number} [siteEnvelope.siteConfig.reservedInstanceCount] Number of + * reserved instances. + * This setting only applies to the Consumption Plan + * + * @param {boolean} [siteEnvelope.scmSiteAlsoStopped] true to stop + * SCM (KUDU) site when the app is stopped; otherwise, false. The + * default is false. + * + * @param {object} [siteEnvelope.hostingEnvironmentProfile] App Service + * Environment to use for the app. + * + * @param {string} [siteEnvelope.hostingEnvironmentProfile.id] Resource ID of + * the App Service Environment. + * + * @param {boolean} [siteEnvelope.clientAffinityEnabled] true to + * enable client affinity; false to stop sending session affinity + * cookies, which route client requests in the same session to the same + * instance. Default is true. + * + * @param {boolean} [siteEnvelope.clientCertEnabled] true to + * enable client certificate authentication (TLS mutual authentication); + * otherwise, false. Default is false. + * + * @param {boolean} [siteEnvelope.hostNamesDisabled] true to + * disable the public hostnames of the app; otherwise, false. + * If true, the app is only accessible via API management process. + * + * @param {number} [siteEnvelope.containerSize] Size of the function container. + * + * @param {number} [siteEnvelope.dailyMemoryTimeQuota] Maximum allowed daily + * memory-time quota (applicable on dynamic apps only). + * + * @param {object} [siteEnvelope.cloningInfo] If specified during app creation, + * the app is cloned from a source app. + * + * @param {uuid} [siteEnvelope.cloningInfo.correlationId] Correlation ID of + * cloning operation. This ID ties multiple cloning operations + * together to use the same snapshot. + * + * @param {boolean} [siteEnvelope.cloningInfo.overwrite] true to + * overwrite destination app; otherwise, false. + * + * @param {boolean} [siteEnvelope.cloningInfo.cloneCustomHostNames] + * true to clone custom hostnames from source app; otherwise, + * false. + * + * @param {boolean} [siteEnvelope.cloningInfo.cloneSourceControl] + * true to clone source control from source app; otherwise, + * false. + * + * @param {string} siteEnvelope.cloningInfo.sourceWebAppId ARM resource ID of + * the source app. App resource ID is of the form + * /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName} + * for production slots and + * /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/slots/{slotName} + * for other slots. + * + * @param {string} [siteEnvelope.cloningInfo.hostingEnvironment] App Service + * Environment. + * + * @param {object} [siteEnvelope.cloningInfo.appSettingsOverrides] Application + * setting overrides for cloned app. If specified, these settings override the + * settings cloned + * from source app. Otherwise, application settings from source app are + * retained. + * + * @param {boolean} [siteEnvelope.cloningInfo.configureLoadBalancing] + * true to configure load balancing for source and destination + * app. + * + * @param {string} [siteEnvelope.cloningInfo.trafficManagerProfileId] ARM + * resource ID of the Traffic Manager profile to use, if it exists. Traffic + * Manager resource ID is of the form + * /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/trafficManagerProfiles/{profileName}. + * + * @param {string} [siteEnvelope.cloningInfo.trafficManagerProfileName] Name of + * Traffic Manager profile to create. This is only needed if Traffic Manager + * profile does not already exist. + * + * @param {boolean} [siteEnvelope.httpsOnly] HttpsOnly: configures a web site + * to accept only https requests. Issues redirect for + * http requests + * + * @param {object} [siteEnvelope.identity] + * + * @param {string} [siteEnvelope.identity.type] Type of managed service + * identity. Possible values include: 'SystemAssigned', 'UserAssigned' + * + * @param {array} [siteEnvelope.identity.identityIds] Array of UserAssigned + * managed service identities. + * + * @param {string} [siteEnvelope.kind] Kind of resource. + * + * @param {string} siteEnvelope.location Resource Location. + * + * @param {object} [siteEnvelope.tags] Resource tags. + * + * @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 {Site} - 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 Site} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + createOrUpdate(resourceGroupName, name, siteEnvelope, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._createOrUpdate(resourceGroupName, name, siteEnvelope, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._createOrUpdate(resourceGroupName, name, siteEnvelope, options, optionalCallback); + } + } + + /** + * @summary Deletes a web, mobile, or API app, or one of the deployment slots. + * + * Deletes a web, mobile, or API app, or one of the deployment slots. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app to delete. + * + * @param {object} [options] Optional Parameters. + * + * @param {boolean} [options.deleteMetrics] If true, web app metrics are also + * deleted. + * + * @param {boolean} [options.deleteEmptyServerFarm] Specify true if the App + * Service plan will be empty after app deletion and you want to delete the + * empty App Service plan. By default, the empty App Service plan is not + * deleted. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + deleteMethodWithHttpOperationResponse(resourceGroupName, name, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._deleteMethod(resourceGroupName, name, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Deletes a web, mobile, or API app, or one of the deployment slots. + * + * Deletes a web, mobile, or API app, or one of the deployment slots. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app to delete. + * + * @param {object} [options] Optional Parameters. + * + * @param {boolean} [options.deleteMetrics] If true, web app metrics are also + * deleted. + * + * @param {boolean} [options.deleteEmptyServerFarm] Specify true if the App + * Service plan will be empty after app deletion and you want to delete the + * empty App Service plan. By default, the empty App Service plan is not + * deleted. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + deleteMethod(resourceGroupName, name, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._deleteMethod(resourceGroupName, name, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._deleteMethod(resourceGroupName, name, options, optionalCallback); + } + } + + /** + * @summary Creates a new web, mobile, or API app in an existing resource + * group, or updates an existing app. + * + * Creates a new web, mobile, or API app in an existing resource group, or + * updates an existing app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Unique name of the app to create or update. To create + * or update a deployment slot, use the {slot} parameter. + * + * @param {object} siteEnvelope A JSON representation of the app properties. + * See example. + * + * @param {boolean} [siteEnvelope.enabled] true if the app is + * enabled; otherwise, false. Setting this value to false disables + * the app (takes the app offline). + * + * @param {array} [siteEnvelope.hostNameSslStates] Hostname SSL states are used + * to manage the SSL bindings for app's hostnames. + * + * @param {string} [siteEnvelope.serverFarmId] Resource ID of the associated + * App Service plan, formatted as: + * "/subscriptions/{subscriptionID}/resourceGroups/{groupName}/providers/Microsoft.Web/serverfarms/{appServicePlanName}". + * + * @param {boolean} [siteEnvelope.reserved] true if reserved; + * otherwise, false. + * + * @param {boolean} [siteEnvelope.isXenon] Obsolete: Hyper-V sandbox. + * + * @param {boolean} [siteEnvelope.hyperV] Hyper-V sandbox. + * + * @param {object} [siteEnvelope.siteConfig] Configuration of the app. + * + * @param {number} [siteEnvelope.siteConfig.numberOfWorkers] Number of workers. + * + * @param {array} [siteEnvelope.siteConfig.defaultDocuments] Default documents. + * + * @param {string} [siteEnvelope.siteConfig.netFrameworkVersion] .NET Framework + * version. + * + * @param {string} [siteEnvelope.siteConfig.phpVersion] Version of PHP. + * + * @param {string} [siteEnvelope.siteConfig.pythonVersion] Version of Python. + * + * @param {string} [siteEnvelope.siteConfig.nodeVersion] Version of Node.js. + * + * @param {string} [siteEnvelope.siteConfig.linuxFxVersion] Linux App Framework + * and version + * + * @param {string} [siteEnvelope.siteConfig.windowsFxVersion] Xenon App + * Framework and version + * + * @param {boolean} [siteEnvelope.siteConfig.requestTracingEnabled] + * true if request tracing is enabled; otherwise, + * false. + * + * @param {date} [siteEnvelope.siteConfig.requestTracingExpirationTime] Request + * tracing expiration time. + * + * @param {boolean} [siteEnvelope.siteConfig.remoteDebuggingEnabled] + * true if remote debugging is enabled; otherwise, + * false. + * + * @param {string} [siteEnvelope.siteConfig.remoteDebuggingVersion] Remote + * debugging version. + * + * @param {boolean} [siteEnvelope.siteConfig.httpLoggingEnabled] + * true if HTTP logging is enabled; otherwise, false. + * + * @param {number} [siteEnvelope.siteConfig.logsDirectorySizeLimit] HTTP logs + * directory size limit. + * + * @param {boolean} [siteEnvelope.siteConfig.detailedErrorLoggingEnabled] + * true if detailed error logging is enabled; otherwise, + * false. + * + * @param {string} [siteEnvelope.siteConfig.publishingUsername] Publishing user + * name. + * + * @param {array} [siteEnvelope.siteConfig.appSettings] Application settings. + * + * @param {object} [siteEnvelope.siteConfig.azureStorageAccounts] User-provided + * Azure storage accounts. + * + * @param {array} [siteEnvelope.siteConfig.connectionStrings] Connection + * strings. + * + * @param {array} [siteEnvelope.siteConfig.handlerMappings] Handler mappings. + * + * @param {string} [siteEnvelope.siteConfig.documentRoot] Document root. + * + * @param {string} [siteEnvelope.siteConfig.scmType] SCM type. Possible values + * include: 'None', 'Dropbox', 'Tfs', 'LocalGit', 'GitHub', 'CodePlexGit', + * 'CodePlexHg', 'BitbucketGit', 'BitbucketHg', 'ExternalGit', 'ExternalHg', + * 'OneDrive', 'VSO' + * + * @param {boolean} [siteEnvelope.siteConfig.use32BitWorkerProcess] + * true to use 32-bit worker process; otherwise, + * false. + * + * @param {boolean} [siteEnvelope.siteConfig.webSocketsEnabled] + * true if WebSocket is enabled; otherwise, false. + * + * @param {boolean} [siteEnvelope.siteConfig.alwaysOn] true if + * Always On is enabled; otherwise, false. + * + * @param {string} [siteEnvelope.siteConfig.javaVersion] Java version. + * + * @param {string} [siteEnvelope.siteConfig.javaContainer] Java container. + * + * @param {string} [siteEnvelope.siteConfig.javaContainerVersion] Java + * container version. + * + * @param {string} [siteEnvelope.siteConfig.appCommandLine] App command line to + * launch. + * + * @param {string} [siteEnvelope.siteConfig.managedPipelineMode] Managed + * pipeline mode. Possible values include: 'Integrated', 'Classic' + * + * @param {array} [siteEnvelope.siteConfig.virtualApplications] Virtual + * applications. + * + * @param {string} [siteEnvelope.siteConfig.loadBalancing] Site load balancing. + * Possible values include: 'WeightedRoundRobin', 'LeastRequests', + * 'LeastResponseTime', 'WeightedTotalTraffic', 'RequestHash' + * + * @param {object} [siteEnvelope.siteConfig.experiments] This is work around + * for polymophic types. + * + * @param {array} [siteEnvelope.siteConfig.experiments.rampUpRules] List of + * ramp-up rules. + * + * @param {object} [siteEnvelope.siteConfig.limits] Site limits. + * + * @param {number} [siteEnvelope.siteConfig.limits.maxPercentageCpu] Maximum + * allowed CPU usage percentage. + * + * @param {number} [siteEnvelope.siteConfig.limits.maxMemoryInMb] Maximum + * allowed memory usage in MB. + * + * @param {number} [siteEnvelope.siteConfig.limits.maxDiskSizeInMb] Maximum + * allowed disk size usage in MB. + * + * @param {boolean} [siteEnvelope.siteConfig.autoHealEnabled] true + * if Auto Heal is enabled; otherwise, false. + * + * @param {object} [siteEnvelope.siteConfig.autoHealRules] Auto Heal rules. + * + * @param {object} [siteEnvelope.siteConfig.autoHealRules.triggers] Conditions + * that describe when to execute the auto-heal actions. + * + * @param {object} [siteEnvelope.siteConfig.autoHealRules.triggers.requests] A + * rule based on total requests. + * + * @param {number} + * [siteEnvelope.siteConfig.autoHealRules.triggers.requests.count] Request + * Count. + * + * @param {string} + * [siteEnvelope.siteConfig.autoHealRules.triggers.requests.timeInterval] Time + * interval. + * + * @param {number} + * [siteEnvelope.siteConfig.autoHealRules.triggers.privateBytesInKB] A rule + * based on private bytes. + * + * @param {array} [siteEnvelope.siteConfig.autoHealRules.triggers.statusCodes] + * A rule based on status codes. + * + * @param {object} + * [siteEnvelope.siteConfig.autoHealRules.triggers.slowRequests] A rule based + * on request execution time. + * + * @param {string} + * [siteEnvelope.siteConfig.autoHealRules.triggers.slowRequests.timeTaken] Time + * taken. + * + * @param {number} + * [siteEnvelope.siteConfig.autoHealRules.triggers.slowRequests.count] Request + * Count. + * + * @param {string} + * [siteEnvelope.siteConfig.autoHealRules.triggers.slowRequests.timeInterval] + * Time interval. + * + * @param {object} [siteEnvelope.siteConfig.autoHealRules.actions] Actions to + * be executed when a rule is triggered. + * + * @param {string} [siteEnvelope.siteConfig.autoHealRules.actions.actionType] + * Predefined action to be taken. Possible values include: 'Recycle', + * 'LogEvent', 'CustomAction' + * + * @param {object} [siteEnvelope.siteConfig.autoHealRules.actions.customAction] + * Custom action to be taken. + * + * @param {string} + * [siteEnvelope.siteConfig.autoHealRules.actions.customAction.exe] Executable + * to be run. + * + * @param {string} + * [siteEnvelope.siteConfig.autoHealRules.actions.customAction.parameters] + * Parameters for the executable. + * + * @param {string} + * [siteEnvelope.siteConfig.autoHealRules.actions.minProcessExecutionTime] + * Minimum time the process must execute + * before taking the action + * + * @param {string} [siteEnvelope.siteConfig.tracingOptions] Tracing options. + * + * @param {string} [siteEnvelope.siteConfig.vnetName] Virtual Network name. + * + * @param {object} [siteEnvelope.siteConfig.cors] Cross-Origin Resource Sharing + * (CORS) settings. + * + * @param {array} [siteEnvelope.siteConfig.cors.allowedOrigins] Gets or sets + * the list of origins that should be allowed to make cross-origin + * calls (for example: http://example.com:12345). Use "*" to allow all. + * + * @param {object} [siteEnvelope.siteConfig.push] Push endpoint settings. + * + * @param {boolean} siteEnvelope.siteConfig.push.isPushEnabled Gets or sets a + * flag indicating whether the Push endpoint is enabled. + * + * @param {string} [siteEnvelope.siteConfig.push.tagWhitelistJson] Gets or sets + * a JSON string containing a list of tags that are whitelisted for use by the + * push registration endpoint. + * + * @param {string} [siteEnvelope.siteConfig.push.tagsRequiringAuth] Gets or + * sets a JSON string containing a list of tags that require user + * authentication to be used in the push registration endpoint. + * Tags can consist of alphanumeric characters and the following: + * '_', '@', '#', '.', ':', '-'. + * Validation should be performed at the PushRequestHandler. + * + * @param {string} [siteEnvelope.siteConfig.push.dynamicTagsJson] Gets or sets + * a JSON string containing a list of dynamic tags that will be evaluated from + * user claims in the push registration endpoint. + * + * @param {string} [siteEnvelope.siteConfig.push.kind] Kind of resource. + * + * @param {object} [siteEnvelope.siteConfig.apiDefinition] Information about + * the formal API definition for the app. + * + * @param {string} [siteEnvelope.siteConfig.apiDefinition.url] The URL of the + * API definition. + * + * @param {string} [siteEnvelope.siteConfig.autoSwapSlotName] Auto-swap slot + * name. + * + * @param {boolean} [siteEnvelope.siteConfig.localMySqlEnabled] + * true to enable local MySQL; otherwise, false. + * + * @param {number} [siteEnvelope.siteConfig.managedServiceIdentityId] Managed + * Service Identity Id + * + * @param {number} [siteEnvelope.siteConfig.xManagedServiceIdentityId] Explicit + * Managed Service Identity Id + * + * @param {array} [siteEnvelope.siteConfig.ipSecurityRestrictions] IP security + * restrictions. + * + * @param {boolean} [siteEnvelope.siteConfig.http20Enabled] Http20Enabled: + * configures a web site to allow clients to connect over http2.0 + * + * @param {string} [siteEnvelope.siteConfig.minTlsVersion] MinTlsVersion: + * configures the minimum version of TLS required for SSL requests. Possible + * values include: '1.0', '1.1', '1.2' + * + * @param {string} [siteEnvelope.siteConfig.ftpsState] State of FTP / FTPS + * service. Possible values include: 'AllAllowed', 'FtpsOnly', 'Disabled' + * + * @param {number} [siteEnvelope.siteConfig.reservedInstanceCount] Number of + * reserved instances. + * This setting only applies to the Consumption Plan + * + * @param {boolean} [siteEnvelope.scmSiteAlsoStopped] true to stop + * SCM (KUDU) site when the app is stopped; otherwise, false. The + * default is false. + * + * @param {object} [siteEnvelope.hostingEnvironmentProfile] App Service + * Environment to use for the app. + * + * @param {string} [siteEnvelope.hostingEnvironmentProfile.id] Resource ID of + * the App Service Environment. + * + * @param {boolean} [siteEnvelope.clientAffinityEnabled] true to + * enable client affinity; false to stop sending session affinity + * cookies, which route client requests in the same session to the same + * instance. Default is true. + * + * @param {boolean} [siteEnvelope.clientCertEnabled] true to + * enable client certificate authentication (TLS mutual authentication); + * otherwise, false. Default is false. + * + * @param {boolean} [siteEnvelope.hostNamesDisabled] true to + * disable the public hostnames of the app; otherwise, false. + * If true, the app is only accessible via API management process. + * + * @param {number} [siteEnvelope.containerSize] Size of the function container. + * + * @param {number} [siteEnvelope.dailyMemoryTimeQuota] Maximum allowed daily + * memory-time quota (applicable on dynamic apps only). + * + * @param {object} [siteEnvelope.cloningInfo] If specified during app creation, + * the app is cloned from a source app. + * + * @param {uuid} [siteEnvelope.cloningInfo.correlationId] Correlation ID of + * cloning operation. This ID ties multiple cloning operations + * together to use the same snapshot. + * + * @param {boolean} [siteEnvelope.cloningInfo.overwrite] true to + * overwrite destination app; otherwise, false. + * + * @param {boolean} [siteEnvelope.cloningInfo.cloneCustomHostNames] + * true to clone custom hostnames from source app; otherwise, + * false. + * + * @param {boolean} [siteEnvelope.cloningInfo.cloneSourceControl] + * true to clone source control from source app; otherwise, + * false. + * + * @param {string} siteEnvelope.cloningInfo.sourceWebAppId ARM resource ID of + * the source app. App resource ID is of the form + * /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName} + * for production slots and + * /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/slots/{slotName} + * for other slots. + * + * @param {string} [siteEnvelope.cloningInfo.hostingEnvironment] App Service + * Environment. + * + * @param {object} [siteEnvelope.cloningInfo.appSettingsOverrides] Application + * setting overrides for cloned app. If specified, these settings override the + * settings cloned + * from source app. Otherwise, application settings from source app are + * retained. + * + * @param {boolean} [siteEnvelope.cloningInfo.configureLoadBalancing] + * true to configure load balancing for source and destination + * app. + * + * @param {string} [siteEnvelope.cloningInfo.trafficManagerProfileId] ARM + * resource ID of the Traffic Manager profile to use, if it exists. Traffic + * Manager resource ID is of the form + * /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/trafficManagerProfiles/{profileName}. + * + * @param {string} [siteEnvelope.cloningInfo.trafficManagerProfileName] Name of + * Traffic Manager profile to create. This is only needed if Traffic Manager + * profile does not already exist. + * + * @param {boolean} [siteEnvelope.httpsOnly] HttpsOnly: configures a web site + * to accept only https requests. Issues redirect for + * http requests + * + * @param {string} [siteEnvelope.kind] Kind of resource. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + updateWithHttpOperationResponse(resourceGroupName, name, siteEnvelope, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._update(resourceGroupName, name, siteEnvelope, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Creates a new web, mobile, or API app in an existing resource + * group, or updates an existing app. + * + * Creates a new web, mobile, or API app in an existing resource group, or + * updates an existing app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Unique name of the app to create or update. To create + * or update a deployment slot, use the {slot} parameter. + * + * @param {object} siteEnvelope A JSON representation of the app properties. + * See example. + * + * @param {boolean} [siteEnvelope.enabled] true if the app is + * enabled; otherwise, false. Setting this value to false disables + * the app (takes the app offline). + * + * @param {array} [siteEnvelope.hostNameSslStates] Hostname SSL states are used + * to manage the SSL bindings for app's hostnames. + * + * @param {string} [siteEnvelope.serverFarmId] Resource ID of the associated + * App Service plan, formatted as: + * "/subscriptions/{subscriptionID}/resourceGroups/{groupName}/providers/Microsoft.Web/serverfarms/{appServicePlanName}". + * + * @param {boolean} [siteEnvelope.reserved] true if reserved; + * otherwise, false. + * + * @param {boolean} [siteEnvelope.isXenon] Obsolete: Hyper-V sandbox. + * + * @param {boolean} [siteEnvelope.hyperV] Hyper-V sandbox. + * + * @param {object} [siteEnvelope.siteConfig] Configuration of the app. + * + * @param {number} [siteEnvelope.siteConfig.numberOfWorkers] Number of workers. + * + * @param {array} [siteEnvelope.siteConfig.defaultDocuments] Default documents. + * + * @param {string} [siteEnvelope.siteConfig.netFrameworkVersion] .NET Framework + * version. + * + * @param {string} [siteEnvelope.siteConfig.phpVersion] Version of PHP. + * + * @param {string} [siteEnvelope.siteConfig.pythonVersion] Version of Python. + * + * @param {string} [siteEnvelope.siteConfig.nodeVersion] Version of Node.js. + * + * @param {string} [siteEnvelope.siteConfig.linuxFxVersion] Linux App Framework + * and version + * + * @param {string} [siteEnvelope.siteConfig.windowsFxVersion] Xenon App + * Framework and version + * + * @param {boolean} [siteEnvelope.siteConfig.requestTracingEnabled] + * true if request tracing is enabled; otherwise, + * false. + * + * @param {date} [siteEnvelope.siteConfig.requestTracingExpirationTime] Request + * tracing expiration time. + * + * @param {boolean} [siteEnvelope.siteConfig.remoteDebuggingEnabled] + * true if remote debugging is enabled; otherwise, + * false. + * + * @param {string} [siteEnvelope.siteConfig.remoteDebuggingVersion] Remote + * debugging version. + * + * @param {boolean} [siteEnvelope.siteConfig.httpLoggingEnabled] + * true if HTTP logging is enabled; otherwise, false. + * + * @param {number} [siteEnvelope.siteConfig.logsDirectorySizeLimit] HTTP logs + * directory size limit. + * + * @param {boolean} [siteEnvelope.siteConfig.detailedErrorLoggingEnabled] + * true if detailed error logging is enabled; otherwise, + * false. + * + * @param {string} [siteEnvelope.siteConfig.publishingUsername] Publishing user + * name. + * + * @param {array} [siteEnvelope.siteConfig.appSettings] Application settings. + * + * @param {object} [siteEnvelope.siteConfig.azureStorageAccounts] User-provided + * Azure storage accounts. + * + * @param {array} [siteEnvelope.siteConfig.connectionStrings] Connection + * strings. + * + * @param {array} [siteEnvelope.siteConfig.handlerMappings] Handler mappings. + * + * @param {string} [siteEnvelope.siteConfig.documentRoot] Document root. + * + * @param {string} [siteEnvelope.siteConfig.scmType] SCM type. Possible values + * include: 'None', 'Dropbox', 'Tfs', 'LocalGit', 'GitHub', 'CodePlexGit', + * 'CodePlexHg', 'BitbucketGit', 'BitbucketHg', 'ExternalGit', 'ExternalHg', + * 'OneDrive', 'VSO' + * + * @param {boolean} [siteEnvelope.siteConfig.use32BitWorkerProcess] + * true to use 32-bit worker process; otherwise, + * false. + * + * @param {boolean} [siteEnvelope.siteConfig.webSocketsEnabled] + * true if WebSocket is enabled; otherwise, false. + * + * @param {boolean} [siteEnvelope.siteConfig.alwaysOn] true if + * Always On is enabled; otherwise, false. + * + * @param {string} [siteEnvelope.siteConfig.javaVersion] Java version. + * + * @param {string} [siteEnvelope.siteConfig.javaContainer] Java container. + * + * @param {string} [siteEnvelope.siteConfig.javaContainerVersion] Java + * container version. + * + * @param {string} [siteEnvelope.siteConfig.appCommandLine] App command line to + * launch. + * + * @param {string} [siteEnvelope.siteConfig.managedPipelineMode] Managed + * pipeline mode. Possible values include: 'Integrated', 'Classic' + * + * @param {array} [siteEnvelope.siteConfig.virtualApplications] Virtual + * applications. + * + * @param {string} [siteEnvelope.siteConfig.loadBalancing] Site load balancing. + * Possible values include: 'WeightedRoundRobin', 'LeastRequests', + * 'LeastResponseTime', 'WeightedTotalTraffic', 'RequestHash' + * + * @param {object} [siteEnvelope.siteConfig.experiments] This is work around + * for polymophic types. + * + * @param {array} [siteEnvelope.siteConfig.experiments.rampUpRules] List of + * ramp-up rules. + * + * @param {object} [siteEnvelope.siteConfig.limits] Site limits. + * + * @param {number} [siteEnvelope.siteConfig.limits.maxPercentageCpu] Maximum + * allowed CPU usage percentage. + * + * @param {number} [siteEnvelope.siteConfig.limits.maxMemoryInMb] Maximum + * allowed memory usage in MB. + * + * @param {number} [siteEnvelope.siteConfig.limits.maxDiskSizeInMb] Maximum + * allowed disk size usage in MB. + * + * @param {boolean} [siteEnvelope.siteConfig.autoHealEnabled] true + * if Auto Heal is enabled; otherwise, false. + * + * @param {object} [siteEnvelope.siteConfig.autoHealRules] Auto Heal rules. + * + * @param {object} [siteEnvelope.siteConfig.autoHealRules.triggers] Conditions + * that describe when to execute the auto-heal actions. + * + * @param {object} [siteEnvelope.siteConfig.autoHealRules.triggers.requests] A + * rule based on total requests. + * + * @param {number} + * [siteEnvelope.siteConfig.autoHealRules.triggers.requests.count] Request + * Count. + * + * @param {string} + * [siteEnvelope.siteConfig.autoHealRules.triggers.requests.timeInterval] Time + * interval. + * + * @param {number} + * [siteEnvelope.siteConfig.autoHealRules.triggers.privateBytesInKB] A rule + * based on private bytes. + * + * @param {array} [siteEnvelope.siteConfig.autoHealRules.triggers.statusCodes] + * A rule based on status codes. + * + * @param {object} + * [siteEnvelope.siteConfig.autoHealRules.triggers.slowRequests] A rule based + * on request execution time. + * + * @param {string} + * [siteEnvelope.siteConfig.autoHealRules.triggers.slowRequests.timeTaken] Time + * taken. + * + * @param {number} + * [siteEnvelope.siteConfig.autoHealRules.triggers.slowRequests.count] Request + * Count. + * + * @param {string} + * [siteEnvelope.siteConfig.autoHealRules.triggers.slowRequests.timeInterval] + * Time interval. + * + * @param {object} [siteEnvelope.siteConfig.autoHealRules.actions] Actions to + * be executed when a rule is triggered. + * + * @param {string} [siteEnvelope.siteConfig.autoHealRules.actions.actionType] + * Predefined action to be taken. Possible values include: 'Recycle', + * 'LogEvent', 'CustomAction' + * + * @param {object} [siteEnvelope.siteConfig.autoHealRules.actions.customAction] + * Custom action to be taken. + * + * @param {string} + * [siteEnvelope.siteConfig.autoHealRules.actions.customAction.exe] Executable + * to be run. + * + * @param {string} + * [siteEnvelope.siteConfig.autoHealRules.actions.customAction.parameters] + * Parameters for the executable. + * + * @param {string} + * [siteEnvelope.siteConfig.autoHealRules.actions.minProcessExecutionTime] + * Minimum time the process must execute + * before taking the action + * + * @param {string} [siteEnvelope.siteConfig.tracingOptions] Tracing options. + * + * @param {string} [siteEnvelope.siteConfig.vnetName] Virtual Network name. + * + * @param {object} [siteEnvelope.siteConfig.cors] Cross-Origin Resource Sharing + * (CORS) settings. + * + * @param {array} [siteEnvelope.siteConfig.cors.allowedOrigins] Gets or sets + * the list of origins that should be allowed to make cross-origin + * calls (for example: http://example.com:12345). Use "*" to allow all. + * + * @param {object} [siteEnvelope.siteConfig.push] Push endpoint settings. + * + * @param {boolean} siteEnvelope.siteConfig.push.isPushEnabled Gets or sets a + * flag indicating whether the Push endpoint is enabled. + * + * @param {string} [siteEnvelope.siteConfig.push.tagWhitelistJson] Gets or sets + * a JSON string containing a list of tags that are whitelisted for use by the + * push registration endpoint. + * + * @param {string} [siteEnvelope.siteConfig.push.tagsRequiringAuth] Gets or + * sets a JSON string containing a list of tags that require user + * authentication to be used in the push registration endpoint. + * Tags can consist of alphanumeric characters and the following: + * '_', '@', '#', '.', ':', '-'. + * Validation should be performed at the PushRequestHandler. + * + * @param {string} [siteEnvelope.siteConfig.push.dynamicTagsJson] Gets or sets + * a JSON string containing a list of dynamic tags that will be evaluated from + * user claims in the push registration endpoint. + * + * @param {string} [siteEnvelope.siteConfig.push.kind] Kind of resource. + * + * @param {object} [siteEnvelope.siteConfig.apiDefinition] Information about + * the formal API definition for the app. + * + * @param {string} [siteEnvelope.siteConfig.apiDefinition.url] The URL of the + * API definition. + * + * @param {string} [siteEnvelope.siteConfig.autoSwapSlotName] Auto-swap slot + * name. + * + * @param {boolean} [siteEnvelope.siteConfig.localMySqlEnabled] + * true to enable local MySQL; otherwise, false. + * + * @param {number} [siteEnvelope.siteConfig.managedServiceIdentityId] Managed + * Service Identity Id + * + * @param {number} [siteEnvelope.siteConfig.xManagedServiceIdentityId] Explicit + * Managed Service Identity Id + * + * @param {array} [siteEnvelope.siteConfig.ipSecurityRestrictions] IP security + * restrictions. + * + * @param {boolean} [siteEnvelope.siteConfig.http20Enabled] Http20Enabled: + * configures a web site to allow clients to connect over http2.0 + * + * @param {string} [siteEnvelope.siteConfig.minTlsVersion] MinTlsVersion: + * configures the minimum version of TLS required for SSL requests. Possible + * values include: '1.0', '1.1', '1.2' + * + * @param {string} [siteEnvelope.siteConfig.ftpsState] State of FTP / FTPS + * service. Possible values include: 'AllAllowed', 'FtpsOnly', 'Disabled' + * + * @param {number} [siteEnvelope.siteConfig.reservedInstanceCount] Number of + * reserved instances. + * This setting only applies to the Consumption Plan + * + * @param {boolean} [siteEnvelope.scmSiteAlsoStopped] true to stop + * SCM (KUDU) site when the app is stopped; otherwise, false. The + * default is false. + * + * @param {object} [siteEnvelope.hostingEnvironmentProfile] App Service + * Environment to use for the app. + * + * @param {string} [siteEnvelope.hostingEnvironmentProfile.id] Resource ID of + * the App Service Environment. + * + * @param {boolean} [siteEnvelope.clientAffinityEnabled] true to + * enable client affinity; false to stop sending session affinity + * cookies, which route client requests in the same session to the same + * instance. Default is true. + * + * @param {boolean} [siteEnvelope.clientCertEnabled] true to + * enable client certificate authentication (TLS mutual authentication); + * otherwise, false. Default is false. + * + * @param {boolean} [siteEnvelope.hostNamesDisabled] true to + * disable the public hostnames of the app; otherwise, false. + * If true, the app is only accessible via API management process. + * + * @param {number} [siteEnvelope.containerSize] Size of the function container. + * + * @param {number} [siteEnvelope.dailyMemoryTimeQuota] Maximum allowed daily + * memory-time quota (applicable on dynamic apps only). + * + * @param {object} [siteEnvelope.cloningInfo] If specified during app creation, + * the app is cloned from a source app. + * + * @param {uuid} [siteEnvelope.cloningInfo.correlationId] Correlation ID of + * cloning operation. This ID ties multiple cloning operations + * together to use the same snapshot. + * + * @param {boolean} [siteEnvelope.cloningInfo.overwrite] true to + * overwrite destination app; otherwise, false. + * + * @param {boolean} [siteEnvelope.cloningInfo.cloneCustomHostNames] + * true to clone custom hostnames from source app; otherwise, + * false. + * + * @param {boolean} [siteEnvelope.cloningInfo.cloneSourceControl] + * true to clone source control from source app; otherwise, + * false. + * + * @param {string} siteEnvelope.cloningInfo.sourceWebAppId ARM resource ID of + * the source app. App resource ID is of the form + * /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName} + * for production slots and + * /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/slots/{slotName} + * for other slots. + * + * @param {string} [siteEnvelope.cloningInfo.hostingEnvironment] App Service + * Environment. + * + * @param {object} [siteEnvelope.cloningInfo.appSettingsOverrides] Application + * setting overrides for cloned app. If specified, these settings override the + * settings cloned + * from source app. Otherwise, application settings from source app are + * retained. + * + * @param {boolean} [siteEnvelope.cloningInfo.configureLoadBalancing] + * true to configure load balancing for source and destination + * app. + * + * @param {string} [siteEnvelope.cloningInfo.trafficManagerProfileId] ARM + * resource ID of the Traffic Manager profile to use, if it exists. Traffic + * Manager resource ID is of the form + * /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/trafficManagerProfiles/{profileName}. + * + * @param {string} [siteEnvelope.cloningInfo.trafficManagerProfileName] Name of + * Traffic Manager profile to create. This is only needed if Traffic Manager + * profile does not already exist. + * + * @param {boolean} [siteEnvelope.httpsOnly] HttpsOnly: configures a web site + * to accept only https requests. Issues redirect for + * http requests + * + * @param {string} [siteEnvelope.kind] Kind of resource. + * + * @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 {Site} - 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 Site} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + update(resourceGroupName, name, siteEnvelope, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._update(resourceGroupName, name, siteEnvelope, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._update(resourceGroupName, name, siteEnvelope, options, optionalCallback); + } + } + + /** + * @summary Analyze a custom hostname. + * + * Analyze a custom hostname. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.hostName] Custom hostname. + * + * @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. + */ + analyzeCustomHostnameWithHttpOperationResponse(resourceGroupName, name, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._analyzeCustomHostname(resourceGroupName, name, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Analyze a custom hostname. + * + * Analyze a custom hostname. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.hostName] Custom hostname. + * + * @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 {CustomHostnameAnalysisResult} - 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 CustomHostnameAnalysisResult} 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. + */ + analyzeCustomHostname(resourceGroupName, name, 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._analyzeCustomHostname(resourceGroupName, name, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._analyzeCustomHostname(resourceGroupName, name, options, optionalCallback); + } + } + + /** + * @summary Applies the configuration settings from the target slot onto the + * current slot. + * + * Applies the configuration settings from the target slot onto the current + * slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} slotSwapEntity JSON object that contains the target slot + * name. See example. + * + * @param {string} slotSwapEntity.targetSlot Destination deployment slot during + * swap operation. + * + * @param {boolean} slotSwapEntity.preserveVnet true to preserve + * Virtual Network to the slot during swap; otherwise, false. + * + * @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. + */ + applySlotConfigToProductionWithHttpOperationResponse(resourceGroupName, name, slotSwapEntity, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._applySlotConfigToProduction(resourceGroupName, name, slotSwapEntity, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Applies the configuration settings from the target slot onto the + * current slot. + * + * Applies the configuration settings from the target slot onto the current + * slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} slotSwapEntity JSON object that contains the target slot + * name. See example. + * + * @param {string} slotSwapEntity.targetSlot Destination deployment slot during + * swap operation. + * + * @param {boolean} slotSwapEntity.preserveVnet true to preserve + * Virtual Network to the slot during swap; otherwise, false. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + applySlotConfigToProduction(resourceGroupName, name, slotSwapEntity, 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._applySlotConfigToProduction(resourceGroupName, name, slotSwapEntity, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._applySlotConfigToProduction(resourceGroupName, name, slotSwapEntity, options, optionalCallback); + } + } + + /** + * @summary Creates a backup of an app. + * + * Creates a backup of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} request Backup configuration. You can use the JSON response + * from the POST action as input here. + * + * @param {string} [request.backupName] Name of the backup. + * + * @param {boolean} [request.enabled] True if the backup schedule is enabled + * (must be included in that case), false if the backup schedule should be + * disabled. + * + * @param {string} request.storageAccountUrl SAS URL to the container. + * + * @param {object} [request.backupSchedule] Schedule for the backup if it is + * executed periodically. + * + * @param {number} request.backupSchedule.frequencyInterval How often the + * backup should be executed (e.g. for weekly backup, this should be set to 7 + * and FrequencyUnit should be set to Day) + * + * @param {string} request.backupSchedule.frequencyUnit The unit of time for + * how often the backup should be executed (e.g. for weekly backup, this should + * be set to Day and FrequencyInterval should be set to 7). Possible values + * include: 'Day', 'Hour' + * + * @param {boolean} request.backupSchedule.keepAtLeastOneBackup True if the + * retention policy should always keep at least one backup in the storage + * account, regardless how old it is; false otherwise. + * + * @param {number} request.backupSchedule.retentionPeriodInDays After how many + * days backups should be deleted. + * + * @param {date} [request.backupSchedule.startTime] When the schedule should + * start working. + * + * @param {array} [request.databases] Databases included in the backup. + * + * @param {string} [request.kind] Kind of resource. + * + * @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. + */ + backupWithHttpOperationResponse(resourceGroupName, name, request, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._backup(resourceGroupName, name, request, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Creates a backup of an app. + * + * Creates a backup of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} request Backup configuration. You can use the JSON response + * from the POST action as input here. + * + * @param {string} [request.backupName] Name of the backup. + * + * @param {boolean} [request.enabled] True if the backup schedule is enabled + * (must be included in that case), false if the backup schedule should be + * disabled. + * + * @param {string} request.storageAccountUrl SAS URL to the container. + * + * @param {object} [request.backupSchedule] Schedule for the backup if it is + * executed periodically. + * + * @param {number} request.backupSchedule.frequencyInterval How often the + * backup should be executed (e.g. for weekly backup, this should be set to 7 + * and FrequencyUnit should be set to Day) + * + * @param {string} request.backupSchedule.frequencyUnit The unit of time for + * how often the backup should be executed (e.g. for weekly backup, this should + * be set to Day and FrequencyInterval should be set to 7). Possible values + * include: 'Day', 'Hour' + * + * @param {boolean} request.backupSchedule.keepAtLeastOneBackup True if the + * retention policy should always keep at least one backup in the storage + * account, regardless how old it is; false otherwise. + * + * @param {number} request.backupSchedule.retentionPeriodInDays After how many + * days backups should be deleted. + * + * @param {date} [request.backupSchedule.startTime] When the schedule should + * start working. + * + * @param {array} [request.databases] Databases included in the backup. + * + * @param {string} [request.kind] Kind of resource. + * + * @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 {BackupItem} - 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 BackupItem} 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. + */ + backup(resourceGroupName, name, request, 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._backup(resourceGroupName, name, request, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._backup(resourceGroupName, name, request, options, optionalCallback); + } + } + + /** + * @summary Gets existing backups of an app. + * + * Gets existing backups of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @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. + */ + listBackupsWithHttpOperationResponse(resourceGroupName, name, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listBackups(resourceGroupName, name, 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 existing backups of an app. + * + * Gets existing backups of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @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 {BackupItemCollection} - 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 BackupItemCollection} 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. + */ + listBackups(resourceGroupName, name, 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._listBackups(resourceGroupName, name, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listBackups(resourceGroupName, name, options, optionalCallback); + } + } + + /** + * @summary Gets a backup of an app by its ID. + * + * Gets a backup of an app by its ID. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} backupId ID of the backup. + * + * @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. + */ + getBackupStatusWithHttpOperationResponse(resourceGroupName, name, backupId, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._getBackupStatus(resourceGroupName, name, backupId, 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 backup of an app by its ID. + * + * Gets a backup of an app by its ID. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} backupId ID of the backup. + * + * @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 {BackupItem} - 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 BackupItem} 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. + */ + getBackupStatus(resourceGroupName, name, backupId, 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._getBackupStatus(resourceGroupName, name, backupId, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getBackupStatus(resourceGroupName, name, backupId, options, optionalCallback); + } + } + + /** + * @summary Deletes a backup of an app by its ID. + * + * Deletes a backup of an app by its ID. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} backupId ID of the backup. + * + * @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. + */ + deleteBackupWithHttpOperationResponse(resourceGroupName, name, backupId, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._deleteBackup(resourceGroupName, name, backupId, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Deletes a backup of an app by its ID. + * + * Deletes a backup of an app by its ID. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} backupId ID of the backup. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + deleteBackup(resourceGroupName, name, backupId, 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._deleteBackup(resourceGroupName, name, backupId, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._deleteBackup(resourceGroupName, name, backupId, options, optionalCallback); + } + } + + /** + * @summary Gets status of a web app backup that may be in progress, including + * secrets associated with the backup, such as the Azure Storage SAS URL. Also + * can be used to update the SAS URL for the backup if a new URL is passed in + * the request body. + * + * Gets status of a web app backup that may be in progress, including secrets + * associated with the backup, such as the Azure Storage SAS URL. Also can be + * used to update the SAS URL for the backup if a new URL is passed in the + * request body. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {string} backupId ID of backup. + * + * @param {object} request Information on backup request. + * + * @param {string} [request.backupName] Name of the backup. + * + * @param {boolean} [request.enabled] True if the backup schedule is enabled + * (must be included in that case), false if the backup schedule should be + * disabled. + * + * @param {string} request.storageAccountUrl SAS URL to the container. + * + * @param {object} [request.backupSchedule] Schedule for the backup if it is + * executed periodically. + * + * @param {number} request.backupSchedule.frequencyInterval How often the + * backup should be executed (e.g. for weekly backup, this should be set to 7 + * and FrequencyUnit should be set to Day) + * + * @param {string} request.backupSchedule.frequencyUnit The unit of time for + * how often the backup should be executed (e.g. for weekly backup, this should + * be set to Day and FrequencyInterval should be set to 7). Possible values + * include: 'Day', 'Hour' + * + * @param {boolean} request.backupSchedule.keepAtLeastOneBackup True if the + * retention policy should always keep at least one backup in the storage + * account, regardless how old it is; false otherwise. + * + * @param {number} request.backupSchedule.retentionPeriodInDays After how many + * days backups should be deleted. + * + * @param {date} [request.backupSchedule.startTime] When the schedule should + * start working. + * + * @param {array} [request.databases] Databases included in the backup. + * + * @param {string} [request.kind] Kind of resource. + * + * @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. + */ + listBackupStatusSecretsWithHttpOperationResponse(resourceGroupName, name, backupId, request, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listBackupStatusSecrets(resourceGroupName, name, backupId, request, 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 status of a web app backup that may be in progress, including + * secrets associated with the backup, such as the Azure Storage SAS URL. Also + * can be used to update the SAS URL for the backup if a new URL is passed in + * the request body. + * + * Gets status of a web app backup that may be in progress, including secrets + * associated with the backup, such as the Azure Storage SAS URL. Also can be + * used to update the SAS URL for the backup if a new URL is passed in the + * request body. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {string} backupId ID of backup. + * + * @param {object} request Information on backup request. + * + * @param {string} [request.backupName] Name of the backup. + * + * @param {boolean} [request.enabled] True if the backup schedule is enabled + * (must be included in that case), false if the backup schedule should be + * disabled. + * + * @param {string} request.storageAccountUrl SAS URL to the container. + * + * @param {object} [request.backupSchedule] Schedule for the backup if it is + * executed periodically. + * + * @param {number} request.backupSchedule.frequencyInterval How often the + * backup should be executed (e.g. for weekly backup, this should be set to 7 + * and FrequencyUnit should be set to Day) + * + * @param {string} request.backupSchedule.frequencyUnit The unit of time for + * how often the backup should be executed (e.g. for weekly backup, this should + * be set to Day and FrequencyInterval should be set to 7). Possible values + * include: 'Day', 'Hour' + * + * @param {boolean} request.backupSchedule.keepAtLeastOneBackup True if the + * retention policy should always keep at least one backup in the storage + * account, regardless how old it is; false otherwise. + * + * @param {number} request.backupSchedule.retentionPeriodInDays After how many + * days backups should be deleted. + * + * @param {date} [request.backupSchedule.startTime] When the schedule should + * start working. + * + * @param {array} [request.databases] Databases included in the backup. + * + * @param {string} [request.kind] Kind of resource. + * + * @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 {BackupItem} - 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 BackupItem} 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. + */ + listBackupStatusSecrets(resourceGroupName, name, backupId, request, 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._listBackupStatusSecrets(resourceGroupName, name, backupId, request, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listBackupStatusSecrets(resourceGroupName, name, backupId, request, options, optionalCallback); + } + } + + /** + * @summary Restores a specific backup to another app (or deployment slot, if + * specified). + * + * Restores a specific backup to another app (or deployment slot, if + * specified). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} backupId ID of the backup. + * + * @param {object} request Information on restore request . + * + * @param {string} request.storageAccountUrl SAS URL to the container. + * + * @param {string} [request.blobName] Name of a blob which contains the backup. + * + * @param {boolean} request.overwrite true if the restore + * operation can overwrite target app; otherwise, false. + * true is needed if trying to restore over an existing app. + * + * @param {string} [request.siteName] Name of an app. + * + * @param {array} [request.databases] Collection of databases which should be + * restored. This list has to match the list of databases included in the + * backup. + * + * @param {boolean} [request.ignoreConflictingHostNames] Changes a logic when + * restoring an app with custom domains. true to remove custom + * domains automatically. If false, custom domains are added to + * the app's object when it is being restored, but that might fail due to + * conflicts during the operation. + * + * @param {boolean} [request.ignoreDatabases] Ignore the databases and only + * restore the site content + * + * @param {string} [request.appServicePlan] Specify app service plan that will + * own restored site. + * + * @param {string} [request.operationType] Operation type. Possible values + * include: 'Default', 'Clone', 'Relocation', 'Snapshot', 'CloudFS' + * + * @param {boolean} [request.adjustConnectionStrings] true if + * SiteConfig.ConnectionStrings should be set in new app; otherwise, + * false. + * + * @param {string} [request.hostingEnvironment] App Service Environment name, + * if needed (only when restoring an app to an App Service Environment). + * + * @param {string} [request.kind] Kind of resource. + * + * @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. + */ + restoreWithHttpOperationResponse(resourceGroupName, name, backupId, request, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._restore(resourceGroupName, name, backupId, request, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Restores a specific backup to another app (or deployment slot, if + * specified). + * + * Restores a specific backup to another app (or deployment slot, if + * specified). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} backupId ID of the backup. + * + * @param {object} request Information on restore request . + * + * @param {string} request.storageAccountUrl SAS URL to the container. + * + * @param {string} [request.blobName] Name of a blob which contains the backup. + * + * @param {boolean} request.overwrite true if the restore + * operation can overwrite target app; otherwise, false. + * true is needed if trying to restore over an existing app. + * + * @param {string} [request.siteName] Name of an app. + * + * @param {array} [request.databases] Collection of databases which should be + * restored. This list has to match the list of databases included in the + * backup. + * + * @param {boolean} [request.ignoreConflictingHostNames] Changes a logic when + * restoring an app with custom domains. true to remove custom + * domains automatically. If false, custom domains are added to + * the app's object when it is being restored, but that might fail due to + * conflicts during the operation. + * + * @param {boolean} [request.ignoreDatabases] Ignore the databases and only + * restore the site content + * + * @param {string} [request.appServicePlan] Specify app service plan that will + * own restored site. + * + * @param {string} [request.operationType] Operation type. Possible values + * include: 'Default', 'Clone', 'Relocation', 'Snapshot', 'CloudFS' + * + * @param {boolean} [request.adjustConnectionStrings] true if + * SiteConfig.ConnectionStrings should be set in new app; otherwise, + * false. + * + * @param {string} [request.hostingEnvironment] App Service Environment name, + * if needed (only when restoring an app to an App Service Environment). + * + * @param {string} [request.kind] Kind of resource. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + restore(resourceGroupName, name, backupId, request, 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._restore(resourceGroupName, name, backupId, request, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._restore(resourceGroupName, name, backupId, request, options, optionalCallback); + } + } + + /** + * @summary List the configurations of an app + * + * List the configurations of an app + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @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. + */ + listConfigurationsWithHttpOperationResponse(resourceGroupName, name, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listConfigurations(resourceGroupName, name, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary List the configurations of an app + * + * List the configurations of an app + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @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 {SiteConfigResourceCollection} - 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 SiteConfigResourceCollection} 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. + */ + listConfigurations(resourceGroupName, name, 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._listConfigurations(resourceGroupName, name, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listConfigurations(resourceGroupName, name, options, optionalCallback); + } + } + + /** + * @summary Replaces the application settings of an app. + * + * Replaces the application settings of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} appSettings Application settings of the app. + * + * @param {object} [appSettings.properties] Settings. + * + * @param {string} [appSettings.kind] Kind of resource. + * + * @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. + */ + updateApplicationSettingsWithHttpOperationResponse(resourceGroupName, name, appSettings, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._updateApplicationSettings(resourceGroupName, name, appSettings, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Replaces the application settings of an app. + * + * Replaces the application settings of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} appSettings Application settings of the app. + * + * @param {object} [appSettings.properties] Settings. + * + * @param {string} [appSettings.kind] Kind of resource. + * + * @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 {StringDictionary} - 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 StringDictionary} 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. + */ + updateApplicationSettings(resourceGroupName, name, appSettings, 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._updateApplicationSettings(resourceGroupName, name, appSettings, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._updateApplicationSettings(resourceGroupName, name, appSettings, options, optionalCallback); + } + } + + /** + * @summary Gets the application settings of an app. + * + * Gets the application settings of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @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. + */ + listApplicationSettingsWithHttpOperationResponse(resourceGroupName, name, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listApplicationSettings(resourceGroupName, name, 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 the application settings of an app. + * + * Gets the application settings of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @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 {StringDictionary} - 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 StringDictionary} 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. + */ + listApplicationSettings(resourceGroupName, name, 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._listApplicationSettings(resourceGroupName, name, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listApplicationSettings(resourceGroupName, name, options, optionalCallback); + } + } + + /** + * @summary Updates the Authentication / Authorization settings associated with + * web app. + * + * Updates the Authentication / Authorization settings associated with web app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {object} siteAuthSettings Auth settings associated with web app. + * + * @param {boolean} [siteAuthSettings.enabled] true if the + * Authentication / Authorization feature is enabled for the current app; + * otherwise, false. + * + * @param {string} [siteAuthSettings.runtimeVersion] The RuntimeVersion of the + * Authentication / Authorization feature in use for the current app. + * The setting in this value can control the behavior of certain features in + * the Authentication / Authorization module. + * + * @param {string} [siteAuthSettings.unauthenticatedClientAction] The action to + * take when an unauthenticated client attempts to access the app. Possible + * values include: 'RedirectToLoginPage', 'AllowAnonymous' + * + * @param {boolean} [siteAuthSettings.tokenStoreEnabled] true to + * durably store platform-specific security tokens that are obtained during + * login flows; otherwise, false. + * The default is false. + * + * @param {array} [siteAuthSettings.allowedExternalRedirectUrls] External URLs + * that can be redirected to as part of logging in or logging out of the app. + * Note that the query string part of the URL is ignored. + * This is an advanced setting typically only needed by Windows Store + * application backends. + * Note that URLs within the current domain are always implicitly allowed. + * + * @param {string} [siteAuthSettings.defaultProvider] The default + * authentication provider to use when multiple providers are configured. + * This setting is only needed if multiple providers are configured and the + * unauthenticated client + * action is set to "RedirectToLoginPage". Possible values include: + * 'AzureActiveDirectory', 'Facebook', 'Google', 'MicrosoftAccount', 'Twitter' + * + * @param {number} [siteAuthSettings.tokenRefreshExtensionHours] The number of + * hours after session token expiration that a session token can be used to + * call the token refresh API. The default is 72 hours. + * + * @param {string} [siteAuthSettings.clientId] The Client ID of this relying + * party application, known as the client_id. + * This setting is required for enabling OpenID Connection authentication with + * Azure Active Directory or + * other 3rd party OpenID Connect providers. + * More information on OpenID Connect: + * http://openid.net/specs/openid-connect-core-1_0.html + * + * @param {string} [siteAuthSettings.clientSecret] The Client Secret of this + * relying party application (in Azure Active Directory, this is also referred + * to as the Key). + * This setting is optional. If no client secret is configured, the OpenID + * Connect implicit auth flow is used to authenticate end users. + * Otherwise, the OpenID Connect Authorization Code Flow is used to + * authenticate end users. + * More information on OpenID Connect: + * http://openid.net/specs/openid-connect-core-1_0.html + * + * @param {string} [siteAuthSettings.issuer] The OpenID Connect Issuer URI that + * represents the entity which issues access tokens for this application. + * When using Azure Active Directory, this value is the URI of the directory + * tenant, e.g. https://sts.windows.net/{tenant-guid}/. + * This URI is a case-sensitive identifier for the token issuer. + * More information on OpenID Connect Discovery: + * http://openid.net/specs/openid-connect-discovery-1_0.html + * + * @param {boolean} [siteAuthSettings.validateIssuer] Gets a value indicating + * whether the issuer should be a valid HTTPS url and be validated as such. + * + * @param {array} [siteAuthSettings.allowedAudiences] Allowed audience values + * to consider when validating JWTs issued by + * Azure Active Directory. Note that the ClientID value is always + * considered an + * allowed audience, regardless of this setting. + * + * @param {array} [siteAuthSettings.additionalLoginParams] Login parameters to + * send to the OpenID Connect authorization endpoint when + * a user logs in. Each parameter must be in the form "key=value". + * + * @param {string} [siteAuthSettings.googleClientId] The OpenID Connect Client + * ID for the Google web application. + * This setting is required for enabling Google Sign-In. + * Google Sign-In documentation: + * https://developers.google.com/identity/sign-in/web/ + * + * @param {string} [siteAuthSettings.googleClientSecret] The client secret + * associated with the Google web application. + * This setting is required for enabling Google Sign-In. + * Google Sign-In documentation: + * https://developers.google.com/identity/sign-in/web/ + * + * @param {array} [siteAuthSettings.googleOAuthScopes] The OAuth 2.0 scopes + * that will be requested as part of Google Sign-In authentication. + * This setting is optional. If not specified, "openid", "profile", and "email" + * are used as default scopes. + * Google Sign-In documentation: + * https://developers.google.com/identity/sign-in/web/ + * + * @param {string} [siteAuthSettings.facebookAppId] The App ID of the Facebook + * app used for login. + * This setting is required for enabling Facebook Login. + * Facebook Login documentation: + * https://developers.facebook.com/docs/facebook-login + * + * @param {string} [siteAuthSettings.facebookAppSecret] The App Secret of the + * Facebook app used for Facebook Login. + * This setting is required for enabling Facebook Login. + * Facebook Login documentation: + * https://developers.facebook.com/docs/facebook-login + * + * @param {array} [siteAuthSettings.facebookOAuthScopes] The OAuth 2.0 scopes + * that will be requested as part of Facebook Login authentication. + * This setting is optional. + * Facebook Login documentation: + * https://developers.facebook.com/docs/facebook-login + * + * @param {string} [siteAuthSettings.twitterConsumerKey] The OAuth 1.0a + * consumer key of the Twitter application used for sign-in. + * This setting is required for enabling Twitter Sign-In. + * Twitter Sign-In documentation: https://dev.twitter.com/web/sign-in + * + * @param {string} [siteAuthSettings.twitterConsumerSecret] The OAuth 1.0a + * consumer secret of the Twitter application used for sign-in. + * This setting is required for enabling Twitter Sign-In. + * Twitter Sign-In documentation: https://dev.twitter.com/web/sign-in + * + * @param {string} [siteAuthSettings.microsoftAccountClientId] The OAuth 2.0 + * client ID that was created for the app used for authentication. + * This setting is required for enabling Microsoft Account authentication. + * Microsoft Account OAuth documentation: + * https://dev.onedrive.com/auth/msa_oauth.htm + * + * @param {string} [siteAuthSettings.microsoftAccountClientSecret] The OAuth + * 2.0 client secret that was created for the app used for authentication. + * This setting is required for enabling Microsoft Account authentication. + * Microsoft Account OAuth documentation: + * https://dev.onedrive.com/auth/msa_oauth.htm + * + * @param {array} [siteAuthSettings.microsoftAccountOAuthScopes] The OAuth 2.0 + * scopes that will be requested as part of Microsoft Account authentication. + * This setting is optional. If not specified, "wl.basic" is used as the + * default scope. + * Microsoft Account Scopes and permissions documentation: + * https://msdn.microsoft.com/en-us/library/dn631845.aspx + * + * @param {string} [siteAuthSettings.kind] Kind of resource. + * + * @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. + */ + updateAuthSettingsWithHttpOperationResponse(resourceGroupName, name, siteAuthSettings, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._updateAuthSettings(resourceGroupName, name, siteAuthSettings, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Updates the Authentication / Authorization settings associated with + * web app. + * + * Updates the Authentication / Authorization settings associated with web app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {object} siteAuthSettings Auth settings associated with web app. + * + * @param {boolean} [siteAuthSettings.enabled] true if the + * Authentication / Authorization feature is enabled for the current app; + * otherwise, false. + * + * @param {string} [siteAuthSettings.runtimeVersion] The RuntimeVersion of the + * Authentication / Authorization feature in use for the current app. + * The setting in this value can control the behavior of certain features in + * the Authentication / Authorization module. + * + * @param {string} [siteAuthSettings.unauthenticatedClientAction] The action to + * take when an unauthenticated client attempts to access the app. Possible + * values include: 'RedirectToLoginPage', 'AllowAnonymous' + * + * @param {boolean} [siteAuthSettings.tokenStoreEnabled] true to + * durably store platform-specific security tokens that are obtained during + * login flows; otherwise, false. + * The default is false. + * + * @param {array} [siteAuthSettings.allowedExternalRedirectUrls] External URLs + * that can be redirected to as part of logging in or logging out of the app. + * Note that the query string part of the URL is ignored. + * This is an advanced setting typically only needed by Windows Store + * application backends. + * Note that URLs within the current domain are always implicitly allowed. + * + * @param {string} [siteAuthSettings.defaultProvider] The default + * authentication provider to use when multiple providers are configured. + * This setting is only needed if multiple providers are configured and the + * unauthenticated client + * action is set to "RedirectToLoginPage". Possible values include: + * 'AzureActiveDirectory', 'Facebook', 'Google', 'MicrosoftAccount', 'Twitter' + * + * @param {number} [siteAuthSettings.tokenRefreshExtensionHours] The number of + * hours after session token expiration that a session token can be used to + * call the token refresh API. The default is 72 hours. + * + * @param {string} [siteAuthSettings.clientId] The Client ID of this relying + * party application, known as the client_id. + * This setting is required for enabling OpenID Connection authentication with + * Azure Active Directory or + * other 3rd party OpenID Connect providers. + * More information on OpenID Connect: + * http://openid.net/specs/openid-connect-core-1_0.html + * + * @param {string} [siteAuthSettings.clientSecret] The Client Secret of this + * relying party application (in Azure Active Directory, this is also referred + * to as the Key). + * This setting is optional. If no client secret is configured, the OpenID + * Connect implicit auth flow is used to authenticate end users. + * Otherwise, the OpenID Connect Authorization Code Flow is used to + * authenticate end users. + * More information on OpenID Connect: + * http://openid.net/specs/openid-connect-core-1_0.html + * + * @param {string} [siteAuthSettings.issuer] The OpenID Connect Issuer URI that + * represents the entity which issues access tokens for this application. + * When using Azure Active Directory, this value is the URI of the directory + * tenant, e.g. https://sts.windows.net/{tenant-guid}/. + * This URI is a case-sensitive identifier for the token issuer. + * More information on OpenID Connect Discovery: + * http://openid.net/specs/openid-connect-discovery-1_0.html + * + * @param {boolean} [siteAuthSettings.validateIssuer] Gets a value indicating + * whether the issuer should be a valid HTTPS url and be validated as such. + * + * @param {array} [siteAuthSettings.allowedAudiences] Allowed audience values + * to consider when validating JWTs issued by + * Azure Active Directory. Note that the ClientID value is always + * considered an + * allowed audience, regardless of this setting. + * + * @param {array} [siteAuthSettings.additionalLoginParams] Login parameters to + * send to the OpenID Connect authorization endpoint when + * a user logs in. Each parameter must be in the form "key=value". + * + * @param {string} [siteAuthSettings.googleClientId] The OpenID Connect Client + * ID for the Google web application. + * This setting is required for enabling Google Sign-In. + * Google Sign-In documentation: + * https://developers.google.com/identity/sign-in/web/ + * + * @param {string} [siteAuthSettings.googleClientSecret] The client secret + * associated with the Google web application. + * This setting is required for enabling Google Sign-In. + * Google Sign-In documentation: + * https://developers.google.com/identity/sign-in/web/ + * + * @param {array} [siteAuthSettings.googleOAuthScopes] The OAuth 2.0 scopes + * that will be requested as part of Google Sign-In authentication. + * This setting is optional. If not specified, "openid", "profile", and "email" + * are used as default scopes. + * Google Sign-In documentation: + * https://developers.google.com/identity/sign-in/web/ + * + * @param {string} [siteAuthSettings.facebookAppId] The App ID of the Facebook + * app used for login. + * This setting is required for enabling Facebook Login. + * Facebook Login documentation: + * https://developers.facebook.com/docs/facebook-login + * + * @param {string} [siteAuthSettings.facebookAppSecret] The App Secret of the + * Facebook app used for Facebook Login. + * This setting is required for enabling Facebook Login. + * Facebook Login documentation: + * https://developers.facebook.com/docs/facebook-login + * + * @param {array} [siteAuthSettings.facebookOAuthScopes] The OAuth 2.0 scopes + * that will be requested as part of Facebook Login authentication. + * This setting is optional. + * Facebook Login documentation: + * https://developers.facebook.com/docs/facebook-login + * + * @param {string} [siteAuthSettings.twitterConsumerKey] The OAuth 1.0a + * consumer key of the Twitter application used for sign-in. + * This setting is required for enabling Twitter Sign-In. + * Twitter Sign-In documentation: https://dev.twitter.com/web/sign-in + * + * @param {string} [siteAuthSettings.twitterConsumerSecret] The OAuth 1.0a + * consumer secret of the Twitter application used for sign-in. + * This setting is required for enabling Twitter Sign-In. + * Twitter Sign-In documentation: https://dev.twitter.com/web/sign-in + * + * @param {string} [siteAuthSettings.microsoftAccountClientId] The OAuth 2.0 + * client ID that was created for the app used for authentication. + * This setting is required for enabling Microsoft Account authentication. + * Microsoft Account OAuth documentation: + * https://dev.onedrive.com/auth/msa_oauth.htm + * + * @param {string} [siteAuthSettings.microsoftAccountClientSecret] The OAuth + * 2.0 client secret that was created for the app used for authentication. + * This setting is required for enabling Microsoft Account authentication. + * Microsoft Account OAuth documentation: + * https://dev.onedrive.com/auth/msa_oauth.htm + * + * @param {array} [siteAuthSettings.microsoftAccountOAuthScopes] The OAuth 2.0 + * scopes that will be requested as part of Microsoft Account authentication. + * This setting is optional. If not specified, "wl.basic" is used as the + * default scope. + * Microsoft Account Scopes and permissions documentation: + * https://msdn.microsoft.com/en-us/library/dn631845.aspx + * + * @param {string} [siteAuthSettings.kind] Kind of resource. + * + * @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 {SiteAuthSettings} - 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 SiteAuthSettings} 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. + */ + updateAuthSettings(resourceGroupName, name, siteAuthSettings, 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._updateAuthSettings(resourceGroupName, name, siteAuthSettings, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._updateAuthSettings(resourceGroupName, name, siteAuthSettings, options, optionalCallback); + } + } + + /** + * @summary Gets the Authentication/Authorization settings of an app. + * + * Gets the Authentication/Authorization settings of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @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. + */ + getAuthSettingsWithHttpOperationResponse(resourceGroupName, name, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._getAuthSettings(resourceGroupName, name, 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 the Authentication/Authorization settings of an app. + * + * Gets the Authentication/Authorization settings of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @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 {SiteAuthSettings} - 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 SiteAuthSettings} 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. + */ + getAuthSettings(resourceGroupName, name, 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._getAuthSettings(resourceGroupName, name, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getAuthSettings(resourceGroupName, name, options, optionalCallback); + } + } + + /** + * @summary Updates the Azure storage account configurations of an app. + * + * Updates the Azure storage account configurations of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} azureStorageAccounts Azure storage accounts of the app. + * + * @param {object} [azureStorageAccounts.properties] Azure storage accounts. + * + * @param {string} [azureStorageAccounts.kind] Kind of resource. + * + * @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. + */ + updateAzureStorageAccountsWithHttpOperationResponse(resourceGroupName, name, azureStorageAccounts, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._updateAzureStorageAccounts(resourceGroupName, name, azureStorageAccounts, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Updates the Azure storage account configurations of an app. + * + * Updates the Azure storage account configurations of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} azureStorageAccounts Azure storage accounts of the app. + * + * @param {object} [azureStorageAccounts.properties] Azure storage accounts. + * + * @param {string} [azureStorageAccounts.kind] Kind of resource. + * + * @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 {AzureStoragePropertyDictionaryResource} - 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 AzureStoragePropertyDictionaryResource} 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. + */ + updateAzureStorageAccounts(resourceGroupName, name, azureStorageAccounts, 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._updateAzureStorageAccounts(resourceGroupName, name, azureStorageAccounts, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._updateAzureStorageAccounts(resourceGroupName, name, azureStorageAccounts, options, optionalCallback); + } + } + + /** + * @summary Gets the Azure storage account configurations of an app. + * + * Gets the Azure storage account configurations of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @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. + */ + listAzureStorageAccountsWithHttpOperationResponse(resourceGroupName, name, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listAzureStorageAccounts(resourceGroupName, name, 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 the Azure storage account configurations of an app. + * + * Gets the Azure storage account configurations of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @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 {AzureStoragePropertyDictionaryResource} - 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 AzureStoragePropertyDictionaryResource} 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. + */ + listAzureStorageAccounts(resourceGroupName, name, 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._listAzureStorageAccounts(resourceGroupName, name, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listAzureStorageAccounts(resourceGroupName, name, options, optionalCallback); + } + } + + /** + * @summary Updates the backup configuration of an app. + * + * Updates the backup configuration of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} request Edited backup configuration. + * + * @param {string} [request.backupName] Name of the backup. + * + * @param {boolean} [request.enabled] True if the backup schedule is enabled + * (must be included in that case), false if the backup schedule should be + * disabled. + * + * @param {string} request.storageAccountUrl SAS URL to the container. + * + * @param {object} [request.backupSchedule] Schedule for the backup if it is + * executed periodically. + * + * @param {number} request.backupSchedule.frequencyInterval How often the + * backup should be executed (e.g. for weekly backup, this should be set to 7 + * and FrequencyUnit should be set to Day) + * + * @param {string} request.backupSchedule.frequencyUnit The unit of time for + * how often the backup should be executed (e.g. for weekly backup, this should + * be set to Day and FrequencyInterval should be set to 7). Possible values + * include: 'Day', 'Hour' + * + * @param {boolean} request.backupSchedule.keepAtLeastOneBackup True if the + * retention policy should always keep at least one backup in the storage + * account, regardless how old it is; false otherwise. + * + * @param {number} request.backupSchedule.retentionPeriodInDays After how many + * days backups should be deleted. + * + * @param {date} [request.backupSchedule.startTime] When the schedule should + * start working. + * + * @param {array} [request.databases] Databases included in the backup. + * + * @param {string} [request.kind] Kind of resource. + * + * @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. + */ + updateBackupConfigurationWithHttpOperationResponse(resourceGroupName, name, request, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._updateBackupConfiguration(resourceGroupName, name, request, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Updates the backup configuration of an app. + * + * Updates the backup configuration of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} request Edited backup configuration. + * + * @param {string} [request.backupName] Name of the backup. + * + * @param {boolean} [request.enabled] True if the backup schedule is enabled + * (must be included in that case), false if the backup schedule should be + * disabled. + * + * @param {string} request.storageAccountUrl SAS URL to the container. + * + * @param {object} [request.backupSchedule] Schedule for the backup if it is + * executed periodically. + * + * @param {number} request.backupSchedule.frequencyInterval How often the + * backup should be executed (e.g. for weekly backup, this should be set to 7 + * and FrequencyUnit should be set to Day) + * + * @param {string} request.backupSchedule.frequencyUnit The unit of time for + * how often the backup should be executed (e.g. for weekly backup, this should + * be set to Day and FrequencyInterval should be set to 7). Possible values + * include: 'Day', 'Hour' + * + * @param {boolean} request.backupSchedule.keepAtLeastOneBackup True if the + * retention policy should always keep at least one backup in the storage + * account, regardless how old it is; false otherwise. + * + * @param {number} request.backupSchedule.retentionPeriodInDays After how many + * days backups should be deleted. + * + * @param {date} [request.backupSchedule.startTime] When the schedule should + * start working. + * + * @param {array} [request.databases] Databases included in the backup. + * + * @param {string} [request.kind] Kind of resource. + * + * @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 {BackupRequest} - 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 BackupRequest} 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. + */ + updateBackupConfiguration(resourceGroupName, name, request, 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._updateBackupConfiguration(resourceGroupName, name, request, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._updateBackupConfiguration(resourceGroupName, name, request, options, optionalCallback); + } + } + + /** + * @summary Deletes the backup configuration of an app. + * + * Deletes the backup configuration of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @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. + */ + deleteBackupConfigurationWithHttpOperationResponse(resourceGroupName, name, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._deleteBackupConfiguration(resourceGroupName, name, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Deletes the backup configuration of an app. + * + * Deletes the backup configuration of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + deleteBackupConfiguration(resourceGroupName, name, 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._deleteBackupConfiguration(resourceGroupName, name, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._deleteBackupConfiguration(resourceGroupName, name, options, optionalCallback); + } + } + + /** + * @summary Gets the backup configuration of an app. + * + * Gets the backup configuration of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @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. + */ + getBackupConfigurationWithHttpOperationResponse(resourceGroupName, name, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._getBackupConfiguration(resourceGroupName, name, 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 the backup configuration of an app. + * + * Gets the backup configuration of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @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 {BackupRequest} - 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 BackupRequest} 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. + */ + getBackupConfiguration(resourceGroupName, name, 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._getBackupConfiguration(resourceGroupName, name, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getBackupConfiguration(resourceGroupName, name, options, optionalCallback); + } + } + + /** + * @summary Replaces the connection strings of an app. + * + * Replaces the connection strings of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} connectionStrings Connection strings of the app or + * deployment slot. See example. + * + * @param {object} [connectionStrings.properties] Connection strings. + * + * @param {string} [connectionStrings.kind] Kind of resource. + * + * @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. + */ + updateConnectionStringsWithHttpOperationResponse(resourceGroupName, name, connectionStrings, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._updateConnectionStrings(resourceGroupName, name, connectionStrings, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Replaces the connection strings of an app. + * + * Replaces the connection strings of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} connectionStrings Connection strings of the app or + * deployment slot. See example. + * + * @param {object} [connectionStrings.properties] Connection strings. + * + * @param {string} [connectionStrings.kind] Kind of resource. + * + * @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 {ConnectionStringDictionary} - 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 ConnectionStringDictionary} 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. + */ + updateConnectionStrings(resourceGroupName, name, connectionStrings, 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._updateConnectionStrings(resourceGroupName, name, connectionStrings, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._updateConnectionStrings(resourceGroupName, name, connectionStrings, options, optionalCallback); + } + } + + /** + * @summary Gets the connection strings of an app. + * + * Gets the connection strings of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @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. + */ + listConnectionStringsWithHttpOperationResponse(resourceGroupName, name, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listConnectionStrings(resourceGroupName, name, 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 the connection strings of an app. + * + * Gets the connection strings of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @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 {ConnectionStringDictionary} - 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 ConnectionStringDictionary} 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. + */ + listConnectionStrings(resourceGroupName, name, 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._listConnectionStrings(resourceGroupName, name, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listConnectionStrings(resourceGroupName, name, options, optionalCallback); + } + } + + /** + * @summary Gets the logging configuration of an app. + * + * Gets the logging configuration of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @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. + */ + getDiagnosticLogsConfigurationWithHttpOperationResponse(resourceGroupName, name, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._getDiagnosticLogsConfiguration(resourceGroupName, name, 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 the logging configuration of an app. + * + * Gets the logging configuration of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @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 {SiteLogsConfig} - 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 SiteLogsConfig} 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. + */ + getDiagnosticLogsConfiguration(resourceGroupName, name, 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._getDiagnosticLogsConfiguration(resourceGroupName, name, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getDiagnosticLogsConfiguration(resourceGroupName, name, options, optionalCallback); + } + } + + /** + * @summary Updates the logging configuration of an app. + * + * Updates the logging configuration of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} siteLogsConfig A SiteLogsConfig JSON object that contains + * the logging configuration to change in the "properties" property. + * + * @param {object} [siteLogsConfig.applicationLogs] Application logs + * configuration. + * + * @param {object} [siteLogsConfig.applicationLogs.fileSystem] Application logs + * to file system configuration. + * + * @param {string} [siteLogsConfig.applicationLogs.fileSystem.level] Log level. + * Possible values include: 'Off', 'Verbose', 'Information', 'Warning', 'Error' + * + * @param {object} [siteLogsConfig.applicationLogs.azureTableStorage] + * Application logs to azure table storage configuration. + * + * @param {string} [siteLogsConfig.applicationLogs.azureTableStorage.level] Log + * level. Possible values include: 'Off', 'Verbose', 'Information', 'Warning', + * 'Error' + * + * @param {string} siteLogsConfig.applicationLogs.azureTableStorage.sasUrl SAS + * URL to an Azure table with add/query/delete permissions. + * + * @param {object} [siteLogsConfig.applicationLogs.azureBlobStorage] + * Application logs to blob storage configuration. + * + * @param {string} [siteLogsConfig.applicationLogs.azureBlobStorage.level] Log + * level. Possible values include: 'Off', 'Verbose', 'Information', 'Warning', + * 'Error' + * + * @param {string} [siteLogsConfig.applicationLogs.azureBlobStorage.sasUrl] SAS + * url to a azure blob container with read/write/list/delete permissions. + * + * @param {number} + * [siteLogsConfig.applicationLogs.azureBlobStorage.retentionInDays] Retention + * in days. + * Remove blobs older than X days. + * 0 or lower means no retention. + * + * @param {object} [siteLogsConfig.httpLogs] HTTP logs configuration. + * + * @param {object} [siteLogsConfig.httpLogs.fileSystem] Http logs to file + * system configuration. + * + * @param {number} [siteLogsConfig.httpLogs.fileSystem.retentionInMb] Maximum + * size in megabytes that http log files can use. + * When reached old log files will be removed to make space for new ones. + * Value can range between 25 and 100. + * + * @param {number} [siteLogsConfig.httpLogs.fileSystem.retentionInDays] + * Retention in days. + * Remove files older than X days. + * 0 or lower means no retention. + * + * @param {boolean} [siteLogsConfig.httpLogs.fileSystem.enabled] True if + * configuration is enabled, false if it is disabled and null if configuration + * is not set. + * + * @param {object} [siteLogsConfig.httpLogs.azureBlobStorage] Http logs to + * azure blob storage configuration. + * + * @param {string} [siteLogsConfig.httpLogs.azureBlobStorage.sasUrl] SAS url to + * a azure blob container with read/write/list/delete permissions. + * + * @param {number} [siteLogsConfig.httpLogs.azureBlobStorage.retentionInDays] + * Retention in days. + * Remove blobs older than X days. + * 0 or lower means no retention. + * + * @param {boolean} [siteLogsConfig.httpLogs.azureBlobStorage.enabled] True if + * configuration is enabled, false if it is disabled and null if configuration + * is not set. + * + * @param {object} [siteLogsConfig.failedRequestsTracing] Failed requests + * tracing configuration. + * + * @param {object} [siteLogsConfig.detailedErrorMessages] Detailed error + * messages configuration. + * + * @param {boolean} [siteLogsConfig.detailedErrorMessages.enabled] True if + * configuration is enabled, false if it is disabled and null if configuration + * is not set. + * + * @param {string} [siteLogsConfig.kind] Kind of resource. + * + * @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. + */ + updateDiagnosticLogsConfigWithHttpOperationResponse(resourceGroupName, name, siteLogsConfig, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._updateDiagnosticLogsConfig(resourceGroupName, name, siteLogsConfig, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Updates the logging configuration of an app. + * + * Updates the logging configuration of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} siteLogsConfig A SiteLogsConfig JSON object that contains + * the logging configuration to change in the "properties" property. + * + * @param {object} [siteLogsConfig.applicationLogs] Application logs + * configuration. + * + * @param {object} [siteLogsConfig.applicationLogs.fileSystem] Application logs + * to file system configuration. + * + * @param {string} [siteLogsConfig.applicationLogs.fileSystem.level] Log level. + * Possible values include: 'Off', 'Verbose', 'Information', 'Warning', 'Error' + * + * @param {object} [siteLogsConfig.applicationLogs.azureTableStorage] + * Application logs to azure table storage configuration. + * + * @param {string} [siteLogsConfig.applicationLogs.azureTableStorage.level] Log + * level. Possible values include: 'Off', 'Verbose', 'Information', 'Warning', + * 'Error' + * + * @param {string} siteLogsConfig.applicationLogs.azureTableStorage.sasUrl SAS + * URL to an Azure table with add/query/delete permissions. + * + * @param {object} [siteLogsConfig.applicationLogs.azureBlobStorage] + * Application logs to blob storage configuration. + * + * @param {string} [siteLogsConfig.applicationLogs.azureBlobStorage.level] Log + * level. Possible values include: 'Off', 'Verbose', 'Information', 'Warning', + * 'Error' + * + * @param {string} [siteLogsConfig.applicationLogs.azureBlobStorage.sasUrl] SAS + * url to a azure blob container with read/write/list/delete permissions. + * + * @param {number} + * [siteLogsConfig.applicationLogs.azureBlobStorage.retentionInDays] Retention + * in days. + * Remove blobs older than X days. + * 0 or lower means no retention. + * + * @param {object} [siteLogsConfig.httpLogs] HTTP logs configuration. + * + * @param {object} [siteLogsConfig.httpLogs.fileSystem] Http logs to file + * system configuration. + * + * @param {number} [siteLogsConfig.httpLogs.fileSystem.retentionInMb] Maximum + * size in megabytes that http log files can use. + * When reached old log files will be removed to make space for new ones. + * Value can range between 25 and 100. + * + * @param {number} [siteLogsConfig.httpLogs.fileSystem.retentionInDays] + * Retention in days. + * Remove files older than X days. + * 0 or lower means no retention. + * + * @param {boolean} [siteLogsConfig.httpLogs.fileSystem.enabled] True if + * configuration is enabled, false if it is disabled and null if configuration + * is not set. + * + * @param {object} [siteLogsConfig.httpLogs.azureBlobStorage] Http logs to + * azure blob storage configuration. + * + * @param {string} [siteLogsConfig.httpLogs.azureBlobStorage.sasUrl] SAS url to + * a azure blob container with read/write/list/delete permissions. + * + * @param {number} [siteLogsConfig.httpLogs.azureBlobStorage.retentionInDays] + * Retention in days. + * Remove blobs older than X days. + * 0 or lower means no retention. + * + * @param {boolean} [siteLogsConfig.httpLogs.azureBlobStorage.enabled] True if + * configuration is enabled, false if it is disabled and null if configuration + * is not set. + * + * @param {object} [siteLogsConfig.failedRequestsTracing] Failed requests + * tracing configuration. + * + * @param {object} [siteLogsConfig.detailedErrorMessages] Detailed error + * messages configuration. + * + * @param {boolean} [siteLogsConfig.detailedErrorMessages.enabled] True if + * configuration is enabled, false if it is disabled and null if configuration + * is not set. + * + * @param {string} [siteLogsConfig.kind] Kind of resource. + * + * @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 {SiteLogsConfig} - 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 SiteLogsConfig} 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. + */ + updateDiagnosticLogsConfig(resourceGroupName, name, siteLogsConfig, 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._updateDiagnosticLogsConfig(resourceGroupName, name, siteLogsConfig, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._updateDiagnosticLogsConfig(resourceGroupName, name, siteLogsConfig, options, optionalCallback); + } + } + + /** + * @summary Replaces the metadata of an app. + * + * Replaces the metadata of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} metadata Edited metadata of the app or deployment slot. See + * example. + * + * @param {object} [metadata.properties] Settings. + * + * @param {string} [metadata.kind] Kind of resource. + * + * @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. + */ + updateMetadataWithHttpOperationResponse(resourceGroupName, name, metadata, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._updateMetadata(resourceGroupName, name, metadata, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Replaces the metadata of an app. + * + * Replaces the metadata of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} metadata Edited metadata of the app or deployment slot. See + * example. + * + * @param {object} [metadata.properties] Settings. + * + * @param {string} [metadata.kind] Kind of resource. + * + * @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 {StringDictionary} - 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 StringDictionary} 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. + */ + updateMetadata(resourceGroupName, name, metadata, 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._updateMetadata(resourceGroupName, name, metadata, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._updateMetadata(resourceGroupName, name, metadata, options, optionalCallback); + } + } + + /** + * @summary Gets the metadata of an app. + * + * Gets the metadata of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @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. + */ + listMetadataWithHttpOperationResponse(resourceGroupName, name, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listMetadata(resourceGroupName, name, 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 the metadata of an app. + * + * Gets the metadata of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @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 {StringDictionary} - 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 StringDictionary} 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. + */ + listMetadata(resourceGroupName, name, 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._listMetadata(resourceGroupName, name, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listMetadata(resourceGroupName, name, options, optionalCallback); + } + } + + /** + * @summary Gets the Git/FTP publishing credentials of an app. + * + * Gets the Git/FTP publishing credentials of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @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. + */ + listPublishingCredentialsWithHttpOperationResponse(resourceGroupName, name, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listPublishingCredentials(resourceGroupName, name, 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 the Git/FTP publishing credentials of an app. + * + * Gets the Git/FTP publishing credentials of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @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 {User} - 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 User} 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. + */ + listPublishingCredentials(resourceGroupName, name, 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._listPublishingCredentials(resourceGroupName, name, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listPublishingCredentials(resourceGroupName, name, options, optionalCallback); + } + } + + /** + * @summary Updates the Push settings associated with web app. + * + * Updates the Push settings associated with web app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {object} pushSettings Push settings associated with web app. + * + * @param {boolean} pushSettings.isPushEnabled Gets or sets a flag indicating + * whether the Push endpoint is enabled. + * + * @param {string} [pushSettings.tagWhitelistJson] Gets or sets a JSON string + * containing a list of tags that are whitelisted for use by the push + * registration endpoint. + * + * @param {string} [pushSettings.tagsRequiringAuth] Gets or sets a JSON string + * containing a list of tags that require user authentication to be used in the + * push registration endpoint. + * Tags can consist of alphanumeric characters and the following: + * '_', '@', '#', '.', ':', '-'. + * Validation should be performed at the PushRequestHandler. + * + * @param {string} [pushSettings.dynamicTagsJson] Gets or sets a JSON string + * containing a list of dynamic tags that will be evaluated from user claims in + * the push registration endpoint. + * + * @param {string} [pushSettings.kind] Kind of resource. + * + * @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. + */ + updateSitePushSettingsWithHttpOperationResponse(resourceGroupName, name, pushSettings, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._updateSitePushSettings(resourceGroupName, name, pushSettings, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Updates the Push settings associated with web app. + * + * Updates the Push settings associated with web app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {object} pushSettings Push settings associated with web app. + * + * @param {boolean} pushSettings.isPushEnabled Gets or sets a flag indicating + * whether the Push endpoint is enabled. + * + * @param {string} [pushSettings.tagWhitelistJson] Gets or sets a JSON string + * containing a list of tags that are whitelisted for use by the push + * registration endpoint. + * + * @param {string} [pushSettings.tagsRequiringAuth] Gets or sets a JSON string + * containing a list of tags that require user authentication to be used in the + * push registration endpoint. + * Tags can consist of alphanumeric characters and the following: + * '_', '@', '#', '.', ':', '-'. + * Validation should be performed at the PushRequestHandler. + * + * @param {string} [pushSettings.dynamicTagsJson] Gets or sets a JSON string + * containing a list of dynamic tags that will be evaluated from user claims in + * the push registration endpoint. + * + * @param {string} [pushSettings.kind] Kind of resource. + * + * @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 {PushSettings} - 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 PushSettings} 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. + */ + updateSitePushSettings(resourceGroupName, name, pushSettings, 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._updateSitePushSettings(resourceGroupName, name, pushSettings, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._updateSitePushSettings(resourceGroupName, name, pushSettings, options, optionalCallback); + } + } + + /** + * @summary Gets the Push settings associated with web app. + * + * Gets the Push settings associated with web app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @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. + */ + listSitePushSettingsWithHttpOperationResponse(resourceGroupName, name, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listSitePushSettings(resourceGroupName, name, 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 the Push settings associated with web app. + * + * Gets the Push settings associated with web app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @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 {PushSettings} - 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 PushSettings} 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. + */ + listSitePushSettings(resourceGroupName, name, 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._listSitePushSettings(resourceGroupName, name, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listSitePushSettings(resourceGroupName, name, options, optionalCallback); + } + } + + /** + * @summary Gets the names of app settings and connection strings that stick to + * the slot (not swapped). + * + * Gets the names of app settings and connection strings that stick to the slot + * (not swapped). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @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. + */ + listSlotConfigurationNamesWithHttpOperationResponse(resourceGroupName, name, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listSlotConfigurationNames(resourceGroupName, name, 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 the names of app settings and connection strings that stick to + * the slot (not swapped). + * + * Gets the names of app settings and connection strings that stick to the slot + * (not swapped). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @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 {SlotConfigNamesResource} - 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 SlotConfigNamesResource} 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. + */ + listSlotConfigurationNames(resourceGroupName, name, 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._listSlotConfigurationNames(resourceGroupName, name, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listSlotConfigurationNames(resourceGroupName, name, options, optionalCallback); + } + } + + /** + * @summary Updates the names of application settings and connection string + * that remain with the slot during swap operation. + * + * Updates the names of application settings and connection string that remain + * with the slot during swap operation. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} slotConfigNames Names of application settings and connection + * strings. See example. + * + * @param {array} [slotConfigNames.connectionStringNames] List of connection + * string names. + * + * @param {array} [slotConfigNames.appSettingNames] List of application + * settings names. + * + * @param {array} [slotConfigNames.azureStorageConfigNames] List of external + * Azure storage account identifiers. + * + * @param {string} [slotConfigNames.kind] Kind of resource. + * + * @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. + */ + updateSlotConfigurationNamesWithHttpOperationResponse(resourceGroupName, name, slotConfigNames, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._updateSlotConfigurationNames(resourceGroupName, name, slotConfigNames, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Updates the names of application settings and connection string + * that remain with the slot during swap operation. + * + * Updates the names of application settings and connection string that remain + * with the slot during swap operation. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} slotConfigNames Names of application settings and connection + * strings. See example. + * + * @param {array} [slotConfigNames.connectionStringNames] List of connection + * string names. + * + * @param {array} [slotConfigNames.appSettingNames] List of application + * settings names. + * + * @param {array} [slotConfigNames.azureStorageConfigNames] List of external + * Azure storage account identifiers. + * + * @param {string} [slotConfigNames.kind] Kind of resource. + * + * @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 {SlotConfigNamesResource} - 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 SlotConfigNamesResource} 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. + */ + updateSlotConfigurationNames(resourceGroupName, name, slotConfigNames, 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._updateSlotConfigurationNames(resourceGroupName, name, slotConfigNames, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._updateSlotConfigurationNames(resourceGroupName, name, slotConfigNames, options, optionalCallback); + } + } + + /** + * @summary Gets a Swift Virtual Network connection. + * + * Gets a Swift Virtual Network connection. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @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. + */ + getSwiftVirtualNetworkConnectionWithHttpOperationResponse(resourceGroupName, name, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._getSwiftVirtualNetworkConnection(resourceGroupName, name, 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 Swift Virtual Network connection. + * + * Gets a Swift Virtual Network connection. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @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 {SwiftVirtualNetwork} - 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 SwiftVirtualNetwork} 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. + */ + getSwiftVirtualNetworkConnection(resourceGroupName, name, 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._getSwiftVirtualNetworkConnection(resourceGroupName, name, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getSwiftVirtualNetworkConnection(resourceGroupName, name, options, optionalCallback); + } + } + + /** + * @summary Integrates this Web App with a Virtual Network. This requires that + * 1) "swiftSupported" is true when doing a GET against this resource, and 2) + * that the target Subnet has already been delegated, and is not + * in use by another App Service Plan other than the one this App is in. + * + * Integrates this Web App with a Virtual Network. This requires that 1) + * "swiftSupported" is true when doing a GET against this resource, and 2) that + * the target Subnet has already been delegated, and is not + * in use by another App Service Plan other than the one this App is in. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} connectionEnvelope Properties of the Virtual Network + * connection. See example. + * + * @param {string} [connectionEnvelope.subnetResourceId] The Virtual Network + * subnet's resource ID. This is the subnet that this Web App will join. This + * subnet must have a delegation to Microsoft.Web/serverFarms defined first. + * + * @param {boolean} [connectionEnvelope.swiftSupported] A flag that specifies + * if the scale unit this Web App is on supports Swift integration. + * + * @param {string} [connectionEnvelope.kind] Kind of resource. + * + * @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. + */ + createOrUpdateSwiftVirtualNetworkConnectionWithHttpOperationResponse(resourceGroupName, name, connectionEnvelope, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._createOrUpdateSwiftVirtualNetworkConnection(resourceGroupName, name, connectionEnvelope, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Integrates this Web App with a Virtual Network. This requires that + * 1) "swiftSupported" is true when doing a GET against this resource, and 2) + * that the target Subnet has already been delegated, and is not + * in use by another App Service Plan other than the one this App is in. + * + * Integrates this Web App with a Virtual Network. This requires that 1) + * "swiftSupported" is true when doing a GET against this resource, and 2) that + * the target Subnet has already been delegated, and is not + * in use by another App Service Plan other than the one this App is in. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} connectionEnvelope Properties of the Virtual Network + * connection. See example. + * + * @param {string} [connectionEnvelope.subnetResourceId] The Virtual Network + * subnet's resource ID. This is the subnet that this Web App will join. This + * subnet must have a delegation to Microsoft.Web/serverFarms defined first. + * + * @param {boolean} [connectionEnvelope.swiftSupported] A flag that specifies + * if the scale unit this Web App is on supports Swift integration. + * + * @param {string} [connectionEnvelope.kind] Kind of resource. + * + * @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 {SwiftVirtualNetwork} - 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 SwiftVirtualNetwork} 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. + */ + createOrUpdateSwiftVirtualNetworkConnection(resourceGroupName, name, connectionEnvelope, 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._createOrUpdateSwiftVirtualNetworkConnection(resourceGroupName, name, connectionEnvelope, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._createOrUpdateSwiftVirtualNetworkConnection(resourceGroupName, name, connectionEnvelope, options, optionalCallback); + } + } + + /** + * @summary Deletes a Swift Virtual Network connection from an app (or + * deployment slot). + * + * Deletes a Swift Virtual Network connection from an app (or deployment slot). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @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. + */ + deleteSwiftVirtualNetworkWithHttpOperationResponse(resourceGroupName, name, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._deleteSwiftVirtualNetwork(resourceGroupName, name, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Deletes a Swift Virtual Network connection from an app (or + * deployment slot). + * + * Deletes a Swift Virtual Network connection from an app (or deployment slot). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + deleteSwiftVirtualNetwork(resourceGroupName, name, 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._deleteSwiftVirtualNetwork(resourceGroupName, name, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._deleteSwiftVirtualNetwork(resourceGroupName, name, options, optionalCallback); + } + } + + /** + * @summary Integrates this Web App with a Virtual Network. This requires that + * 1) "swiftSupported" is true when doing a GET against this resource, and 2) + * that the target Subnet has already been delegated, and is not + * in use by another App Service Plan other than the one this App is in. + * + * Integrates this Web App with a Virtual Network. This requires that 1) + * "swiftSupported" is true when doing a GET against this resource, and 2) that + * the target Subnet has already been delegated, and is not + * in use by another App Service Plan other than the one this App is in. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} connectionEnvelope Properties of the Virtual Network + * connection. See example. + * + * @param {string} [connectionEnvelope.subnetResourceId] The Virtual Network + * subnet's resource ID. This is the subnet that this Web App will join. This + * subnet must have a delegation to Microsoft.Web/serverFarms defined first. + * + * @param {boolean} [connectionEnvelope.swiftSupported] A flag that specifies + * if the scale unit this Web App is on supports Swift integration. + * + * @param {string} [connectionEnvelope.kind] Kind of resource. + * + * @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. + */ + updateSwiftVirtualNetworkConnectionWithHttpOperationResponse(resourceGroupName, name, connectionEnvelope, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._updateSwiftVirtualNetworkConnection(resourceGroupName, name, connectionEnvelope, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Integrates this Web App with a Virtual Network. This requires that + * 1) "swiftSupported" is true when doing a GET against this resource, and 2) + * that the target Subnet has already been delegated, and is not + * in use by another App Service Plan other than the one this App is in. + * + * Integrates this Web App with a Virtual Network. This requires that 1) + * "swiftSupported" is true when doing a GET against this resource, and 2) that + * the target Subnet has already been delegated, and is not + * in use by another App Service Plan other than the one this App is in. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} connectionEnvelope Properties of the Virtual Network + * connection. See example. + * + * @param {string} [connectionEnvelope.subnetResourceId] The Virtual Network + * subnet's resource ID. This is the subnet that this Web App will join. This + * subnet must have a delegation to Microsoft.Web/serverFarms defined first. + * + * @param {boolean} [connectionEnvelope.swiftSupported] A flag that specifies + * if the scale unit this Web App is on supports Swift integration. + * + * @param {string} [connectionEnvelope.kind] Kind of resource. + * + * @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 {SwiftVirtualNetwork} - 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 SwiftVirtualNetwork} 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. + */ + updateSwiftVirtualNetworkConnection(resourceGroupName, name, connectionEnvelope, 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._updateSwiftVirtualNetworkConnection(resourceGroupName, name, connectionEnvelope, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._updateSwiftVirtualNetworkConnection(resourceGroupName, name, connectionEnvelope, options, optionalCallback); + } + } + + /** + * @summary Gets the configuration of an app, such as platform version and + * bitness, default documents, virtual applications, Always On, etc. + * + * Gets the configuration of an app, such as platform version and bitness, + * default documents, virtual applications, Always On, etc. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @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. + */ + getConfigurationWithHttpOperationResponse(resourceGroupName, name, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._getConfiguration(resourceGroupName, name, 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 the configuration of an app, such as platform version and + * bitness, default documents, virtual applications, Always On, etc. + * + * Gets the configuration of an app, such as platform version and bitness, + * default documents, virtual applications, Always On, etc. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @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 {SiteConfigResource} - 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 SiteConfigResource} 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. + */ + getConfiguration(resourceGroupName, name, 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._getConfiguration(resourceGroupName, name, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getConfiguration(resourceGroupName, name, options, optionalCallback); + } + } + + /** + * @summary Updates the configuration of an app. + * + * Updates the configuration of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} siteConfig JSON representation of a SiteConfig object. See + * example. + * + * @param {number} [siteConfig.numberOfWorkers] Number of workers. + * + * @param {array} [siteConfig.defaultDocuments] Default documents. + * + * @param {string} [siteConfig.netFrameworkVersion] .NET Framework version. + * + * @param {string} [siteConfig.phpVersion] Version of PHP. + * + * @param {string} [siteConfig.pythonVersion] Version of Python. + * + * @param {string} [siteConfig.nodeVersion] Version of Node.js. + * + * @param {string} [siteConfig.linuxFxVersion] Linux App Framework and version + * + * @param {string} [siteConfig.windowsFxVersion] Xenon App Framework and + * version + * + * @param {boolean} [siteConfig.requestTracingEnabled] true if + * request tracing is enabled; otherwise, false. + * + * @param {date} [siteConfig.requestTracingExpirationTime] Request tracing + * expiration time. + * + * @param {boolean} [siteConfig.remoteDebuggingEnabled] true if + * remote debugging is enabled; otherwise, false. + * + * @param {string} [siteConfig.remoteDebuggingVersion] Remote debugging + * version. + * + * @param {boolean} [siteConfig.httpLoggingEnabled] true if HTTP + * logging is enabled; otherwise, false. + * + * @param {number} [siteConfig.logsDirectorySizeLimit] HTTP logs directory size + * limit. + * + * @param {boolean} [siteConfig.detailedErrorLoggingEnabled] true + * if detailed error logging is enabled; otherwise, false. + * + * @param {string} [siteConfig.publishingUsername] Publishing user name. + * + * @param {array} [siteConfig.appSettings] Application settings. + * + * @param {object} [siteConfig.azureStorageAccounts] User-provided Azure + * storage accounts. + * + * @param {array} [siteConfig.connectionStrings] Connection strings. + * + * @param {array} [siteConfig.handlerMappings] Handler mappings. + * + * @param {string} [siteConfig.documentRoot] Document root. + * + * @param {string} [siteConfig.scmType] SCM type. Possible values include: + * 'None', 'Dropbox', 'Tfs', 'LocalGit', 'GitHub', 'CodePlexGit', 'CodePlexHg', + * 'BitbucketGit', 'BitbucketHg', 'ExternalGit', 'ExternalHg', 'OneDrive', + * 'VSO' + * + * @param {boolean} [siteConfig.use32BitWorkerProcess] true to use + * 32-bit worker process; otherwise, false. + * + * @param {boolean} [siteConfig.webSocketsEnabled] true if + * WebSocket is enabled; otherwise, false. + * + * @param {boolean} [siteConfig.alwaysOn] true if Always On is + * enabled; otherwise, false. + * + * @param {string} [siteConfig.javaVersion] Java version. + * + * @param {string} [siteConfig.javaContainer] Java container. + * + * @param {string} [siteConfig.javaContainerVersion] Java container version. + * + * @param {string} [siteConfig.appCommandLine] App command line to launch. + * + * @param {string} [siteConfig.managedPipelineMode] Managed pipeline mode. + * Possible values include: 'Integrated', 'Classic' + * + * @param {array} [siteConfig.virtualApplications] Virtual applications. + * + * @param {string} [siteConfig.loadBalancing] Site load balancing. Possible + * values include: 'WeightedRoundRobin', 'LeastRequests', 'LeastResponseTime', + * 'WeightedTotalTraffic', 'RequestHash' + * + * @param {object} [siteConfig.experiments] This is work around for polymophic + * types. + * + * @param {array} [siteConfig.experiments.rampUpRules] List of ramp-up rules. + * + * @param {object} [siteConfig.limits] Site limits. + * + * @param {number} [siteConfig.limits.maxPercentageCpu] Maximum allowed CPU + * usage percentage. + * + * @param {number} [siteConfig.limits.maxMemoryInMb] Maximum allowed memory + * usage in MB. + * + * @param {number} [siteConfig.limits.maxDiskSizeInMb] Maximum allowed disk + * size usage in MB. + * + * @param {boolean} [siteConfig.autoHealEnabled] true if Auto Heal + * is enabled; otherwise, false. + * + * @param {object} [siteConfig.autoHealRules] Auto Heal rules. + * + * @param {object} [siteConfig.autoHealRules.triggers] Conditions that describe + * when to execute the auto-heal actions. + * + * @param {object} [siteConfig.autoHealRules.triggers.requests] A rule based on + * total requests. + * + * @param {number} [siteConfig.autoHealRules.triggers.requests.count] Request + * Count. + * + * @param {string} [siteConfig.autoHealRules.triggers.requests.timeInterval] + * Time interval. + * + * @param {number} [siteConfig.autoHealRules.triggers.privateBytesInKB] A rule + * based on private bytes. + * + * @param {array} [siteConfig.autoHealRules.triggers.statusCodes] A rule based + * on status codes. + * + * @param {object} [siteConfig.autoHealRules.triggers.slowRequests] A rule + * based on request execution time. + * + * @param {string} [siteConfig.autoHealRules.triggers.slowRequests.timeTaken] + * Time taken. + * + * @param {number} [siteConfig.autoHealRules.triggers.slowRequests.count] + * Request Count. + * + * @param {string} + * [siteConfig.autoHealRules.triggers.slowRequests.timeInterval] Time interval. + * + * @param {object} [siteConfig.autoHealRules.actions] Actions to be executed + * when a rule is triggered. + * + * @param {string} [siteConfig.autoHealRules.actions.actionType] Predefined + * action to be taken. Possible values include: 'Recycle', 'LogEvent', + * 'CustomAction' + * + * @param {object} [siteConfig.autoHealRules.actions.customAction] Custom + * action to be taken. + * + * @param {string} [siteConfig.autoHealRules.actions.customAction.exe] + * Executable to be run. + * + * @param {string} [siteConfig.autoHealRules.actions.customAction.parameters] + * Parameters for the executable. + * + * @param {string} [siteConfig.autoHealRules.actions.minProcessExecutionTime] + * Minimum time the process must execute + * before taking the action + * + * @param {string} [siteConfig.tracingOptions] Tracing options. + * + * @param {string} [siteConfig.vnetName] Virtual Network name. + * + * @param {object} [siteConfig.cors] Cross-Origin Resource Sharing (CORS) + * settings. + * + * @param {array} [siteConfig.cors.allowedOrigins] Gets or sets the list of + * origins that should be allowed to make cross-origin + * calls (for example: http://example.com:12345). Use "*" to allow all. + * + * @param {object} [siteConfig.push] Push endpoint settings. + * + * @param {boolean} siteConfig.push.isPushEnabled Gets or sets a flag + * indicating whether the Push endpoint is enabled. + * + * @param {string} [siteConfig.push.tagWhitelistJson] Gets or sets a JSON + * string containing a list of tags that are whitelisted for use by the push + * registration endpoint. + * + * @param {string} [siteConfig.push.tagsRequiringAuth] Gets or sets a JSON + * string containing a list of tags that require user authentication to be used + * in the push registration endpoint. + * Tags can consist of alphanumeric characters and the following: + * '_', '@', '#', '.', ':', '-'. + * Validation should be performed at the PushRequestHandler. + * + * @param {string} [siteConfig.push.dynamicTagsJson] Gets or sets a JSON string + * containing a list of dynamic tags that will be evaluated from user claims in + * the push registration endpoint. + * + * @param {string} [siteConfig.push.kind] Kind of resource. + * + * @param {object} [siteConfig.apiDefinition] Information about the formal API + * definition for the app. + * + * @param {string} [siteConfig.apiDefinition.url] The URL of the API + * definition. + * + * @param {string} [siteConfig.autoSwapSlotName] Auto-swap slot name. + * + * @param {boolean} [siteConfig.localMySqlEnabled] true to enable + * local MySQL; otherwise, false. + * + * @param {number} [siteConfig.managedServiceIdentityId] Managed Service + * Identity Id + * + * @param {number} [siteConfig.xManagedServiceIdentityId] Explicit Managed + * Service Identity Id + * + * @param {array} [siteConfig.ipSecurityRestrictions] IP security restrictions. + * + * @param {boolean} [siteConfig.http20Enabled] Http20Enabled: configures a web + * site to allow clients to connect over http2.0 + * + * @param {string} [siteConfig.minTlsVersion] MinTlsVersion: configures the + * minimum version of TLS required for SSL requests. Possible values include: + * '1.0', '1.1', '1.2' + * + * @param {string} [siteConfig.ftpsState] State of FTP / FTPS service. Possible + * values include: 'AllAllowed', 'FtpsOnly', 'Disabled' + * + * @param {number} [siteConfig.reservedInstanceCount] Number of reserved + * instances. + * This setting only applies to the Consumption Plan + * + * @param {string} [siteConfig.kind] Kind of resource. + * + * @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. + */ + createOrUpdateConfigurationWithHttpOperationResponse(resourceGroupName, name, siteConfig, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._createOrUpdateConfiguration(resourceGroupName, name, siteConfig, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Updates the configuration of an app. + * + * Updates the configuration of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} siteConfig JSON representation of a SiteConfig object. See + * example. + * + * @param {number} [siteConfig.numberOfWorkers] Number of workers. + * + * @param {array} [siteConfig.defaultDocuments] Default documents. + * + * @param {string} [siteConfig.netFrameworkVersion] .NET Framework version. + * + * @param {string} [siteConfig.phpVersion] Version of PHP. + * + * @param {string} [siteConfig.pythonVersion] Version of Python. + * + * @param {string} [siteConfig.nodeVersion] Version of Node.js. + * + * @param {string} [siteConfig.linuxFxVersion] Linux App Framework and version + * + * @param {string} [siteConfig.windowsFxVersion] Xenon App Framework and + * version + * + * @param {boolean} [siteConfig.requestTracingEnabled] true if + * request tracing is enabled; otherwise, false. + * + * @param {date} [siteConfig.requestTracingExpirationTime] Request tracing + * expiration time. + * + * @param {boolean} [siteConfig.remoteDebuggingEnabled] true if + * remote debugging is enabled; otherwise, false. + * + * @param {string} [siteConfig.remoteDebuggingVersion] Remote debugging + * version. + * + * @param {boolean} [siteConfig.httpLoggingEnabled] true if HTTP + * logging is enabled; otherwise, false. + * + * @param {number} [siteConfig.logsDirectorySizeLimit] HTTP logs directory size + * limit. + * + * @param {boolean} [siteConfig.detailedErrorLoggingEnabled] true + * if detailed error logging is enabled; otherwise, false. + * + * @param {string} [siteConfig.publishingUsername] Publishing user name. + * + * @param {array} [siteConfig.appSettings] Application settings. + * + * @param {object} [siteConfig.azureStorageAccounts] User-provided Azure + * storage accounts. + * + * @param {array} [siteConfig.connectionStrings] Connection strings. + * + * @param {array} [siteConfig.handlerMappings] Handler mappings. + * + * @param {string} [siteConfig.documentRoot] Document root. + * + * @param {string} [siteConfig.scmType] SCM type. Possible values include: + * 'None', 'Dropbox', 'Tfs', 'LocalGit', 'GitHub', 'CodePlexGit', 'CodePlexHg', + * 'BitbucketGit', 'BitbucketHg', 'ExternalGit', 'ExternalHg', 'OneDrive', + * 'VSO' + * + * @param {boolean} [siteConfig.use32BitWorkerProcess] true to use + * 32-bit worker process; otherwise, false. + * + * @param {boolean} [siteConfig.webSocketsEnabled] true if + * WebSocket is enabled; otherwise, false. + * + * @param {boolean} [siteConfig.alwaysOn] true if Always On is + * enabled; otherwise, false. + * + * @param {string} [siteConfig.javaVersion] Java version. + * + * @param {string} [siteConfig.javaContainer] Java container. + * + * @param {string} [siteConfig.javaContainerVersion] Java container version. + * + * @param {string} [siteConfig.appCommandLine] App command line to launch. + * + * @param {string} [siteConfig.managedPipelineMode] Managed pipeline mode. + * Possible values include: 'Integrated', 'Classic' + * + * @param {array} [siteConfig.virtualApplications] Virtual applications. + * + * @param {string} [siteConfig.loadBalancing] Site load balancing. Possible + * values include: 'WeightedRoundRobin', 'LeastRequests', 'LeastResponseTime', + * 'WeightedTotalTraffic', 'RequestHash' + * + * @param {object} [siteConfig.experiments] This is work around for polymophic + * types. + * + * @param {array} [siteConfig.experiments.rampUpRules] List of ramp-up rules. + * + * @param {object} [siteConfig.limits] Site limits. + * + * @param {number} [siteConfig.limits.maxPercentageCpu] Maximum allowed CPU + * usage percentage. + * + * @param {number} [siteConfig.limits.maxMemoryInMb] Maximum allowed memory + * usage in MB. + * + * @param {number} [siteConfig.limits.maxDiskSizeInMb] Maximum allowed disk + * size usage in MB. + * + * @param {boolean} [siteConfig.autoHealEnabled] true if Auto Heal + * is enabled; otherwise, false. + * + * @param {object} [siteConfig.autoHealRules] Auto Heal rules. + * + * @param {object} [siteConfig.autoHealRules.triggers] Conditions that describe + * when to execute the auto-heal actions. + * + * @param {object} [siteConfig.autoHealRules.triggers.requests] A rule based on + * total requests. + * + * @param {number} [siteConfig.autoHealRules.triggers.requests.count] Request + * Count. + * + * @param {string} [siteConfig.autoHealRules.triggers.requests.timeInterval] + * Time interval. + * + * @param {number} [siteConfig.autoHealRules.triggers.privateBytesInKB] A rule + * based on private bytes. + * + * @param {array} [siteConfig.autoHealRules.triggers.statusCodes] A rule based + * on status codes. + * + * @param {object} [siteConfig.autoHealRules.triggers.slowRequests] A rule + * based on request execution time. + * + * @param {string} [siteConfig.autoHealRules.triggers.slowRequests.timeTaken] + * Time taken. + * + * @param {number} [siteConfig.autoHealRules.triggers.slowRequests.count] + * Request Count. + * + * @param {string} + * [siteConfig.autoHealRules.triggers.slowRequests.timeInterval] Time interval. + * + * @param {object} [siteConfig.autoHealRules.actions] Actions to be executed + * when a rule is triggered. + * + * @param {string} [siteConfig.autoHealRules.actions.actionType] Predefined + * action to be taken. Possible values include: 'Recycle', 'LogEvent', + * 'CustomAction' + * + * @param {object} [siteConfig.autoHealRules.actions.customAction] Custom + * action to be taken. + * + * @param {string} [siteConfig.autoHealRules.actions.customAction.exe] + * Executable to be run. + * + * @param {string} [siteConfig.autoHealRules.actions.customAction.parameters] + * Parameters for the executable. + * + * @param {string} [siteConfig.autoHealRules.actions.minProcessExecutionTime] + * Minimum time the process must execute + * before taking the action + * + * @param {string} [siteConfig.tracingOptions] Tracing options. + * + * @param {string} [siteConfig.vnetName] Virtual Network name. + * + * @param {object} [siteConfig.cors] Cross-Origin Resource Sharing (CORS) + * settings. + * + * @param {array} [siteConfig.cors.allowedOrigins] Gets or sets the list of + * origins that should be allowed to make cross-origin + * calls (for example: http://example.com:12345). Use "*" to allow all. + * + * @param {object} [siteConfig.push] Push endpoint settings. + * + * @param {boolean} siteConfig.push.isPushEnabled Gets or sets a flag + * indicating whether the Push endpoint is enabled. + * + * @param {string} [siteConfig.push.tagWhitelistJson] Gets or sets a JSON + * string containing a list of tags that are whitelisted for use by the push + * registration endpoint. + * + * @param {string} [siteConfig.push.tagsRequiringAuth] Gets or sets a JSON + * string containing a list of tags that require user authentication to be used + * in the push registration endpoint. + * Tags can consist of alphanumeric characters and the following: + * '_', '@', '#', '.', ':', '-'. + * Validation should be performed at the PushRequestHandler. + * + * @param {string} [siteConfig.push.dynamicTagsJson] Gets or sets a JSON string + * containing a list of dynamic tags that will be evaluated from user claims in + * the push registration endpoint. + * + * @param {string} [siteConfig.push.kind] Kind of resource. + * + * @param {object} [siteConfig.apiDefinition] Information about the formal API + * definition for the app. + * + * @param {string} [siteConfig.apiDefinition.url] The URL of the API + * definition. + * + * @param {string} [siteConfig.autoSwapSlotName] Auto-swap slot name. + * + * @param {boolean} [siteConfig.localMySqlEnabled] true to enable + * local MySQL; otherwise, false. + * + * @param {number} [siteConfig.managedServiceIdentityId] Managed Service + * Identity Id + * + * @param {number} [siteConfig.xManagedServiceIdentityId] Explicit Managed + * Service Identity Id + * + * @param {array} [siteConfig.ipSecurityRestrictions] IP security restrictions. + * + * @param {boolean} [siteConfig.http20Enabled] Http20Enabled: configures a web + * site to allow clients to connect over http2.0 + * + * @param {string} [siteConfig.minTlsVersion] MinTlsVersion: configures the + * minimum version of TLS required for SSL requests. Possible values include: + * '1.0', '1.1', '1.2' + * + * @param {string} [siteConfig.ftpsState] State of FTP / FTPS service. Possible + * values include: 'AllAllowed', 'FtpsOnly', 'Disabled' + * + * @param {number} [siteConfig.reservedInstanceCount] Number of reserved + * instances. + * This setting only applies to the Consumption Plan + * + * @param {string} [siteConfig.kind] Kind of resource. + * + * @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 {SiteConfigResource} - 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 SiteConfigResource} 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. + */ + createOrUpdateConfiguration(resourceGroupName, name, siteConfig, 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._createOrUpdateConfiguration(resourceGroupName, name, siteConfig, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._createOrUpdateConfiguration(resourceGroupName, name, siteConfig, options, optionalCallback); + } + } + + /** + * @summary Updates the configuration of an app. + * + * Updates the configuration of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} siteConfig JSON representation of a SiteConfig object. See + * example. + * + * @param {number} [siteConfig.numberOfWorkers] Number of workers. + * + * @param {array} [siteConfig.defaultDocuments] Default documents. + * + * @param {string} [siteConfig.netFrameworkVersion] .NET Framework version. + * + * @param {string} [siteConfig.phpVersion] Version of PHP. + * + * @param {string} [siteConfig.pythonVersion] Version of Python. + * + * @param {string} [siteConfig.nodeVersion] Version of Node.js. + * + * @param {string} [siteConfig.linuxFxVersion] Linux App Framework and version + * + * @param {string} [siteConfig.windowsFxVersion] Xenon App Framework and + * version + * + * @param {boolean} [siteConfig.requestTracingEnabled] true if + * request tracing is enabled; otherwise, false. + * + * @param {date} [siteConfig.requestTracingExpirationTime] Request tracing + * expiration time. + * + * @param {boolean} [siteConfig.remoteDebuggingEnabled] true if + * remote debugging is enabled; otherwise, false. + * + * @param {string} [siteConfig.remoteDebuggingVersion] Remote debugging + * version. + * + * @param {boolean} [siteConfig.httpLoggingEnabled] true if HTTP + * logging is enabled; otherwise, false. + * + * @param {number} [siteConfig.logsDirectorySizeLimit] HTTP logs directory size + * limit. + * + * @param {boolean} [siteConfig.detailedErrorLoggingEnabled] true + * if detailed error logging is enabled; otherwise, false. + * + * @param {string} [siteConfig.publishingUsername] Publishing user name. + * + * @param {array} [siteConfig.appSettings] Application settings. + * + * @param {object} [siteConfig.azureStorageAccounts] User-provided Azure + * storage accounts. + * + * @param {array} [siteConfig.connectionStrings] Connection strings. + * + * @param {array} [siteConfig.handlerMappings] Handler mappings. + * + * @param {string} [siteConfig.documentRoot] Document root. + * + * @param {string} [siteConfig.scmType] SCM type. Possible values include: + * 'None', 'Dropbox', 'Tfs', 'LocalGit', 'GitHub', 'CodePlexGit', 'CodePlexHg', + * 'BitbucketGit', 'BitbucketHg', 'ExternalGit', 'ExternalHg', 'OneDrive', + * 'VSO' + * + * @param {boolean} [siteConfig.use32BitWorkerProcess] true to use + * 32-bit worker process; otherwise, false. + * + * @param {boolean} [siteConfig.webSocketsEnabled] true if + * WebSocket is enabled; otherwise, false. + * + * @param {boolean} [siteConfig.alwaysOn] true if Always On is + * enabled; otherwise, false. + * + * @param {string} [siteConfig.javaVersion] Java version. + * + * @param {string} [siteConfig.javaContainer] Java container. + * + * @param {string} [siteConfig.javaContainerVersion] Java container version. + * + * @param {string} [siteConfig.appCommandLine] App command line to launch. + * + * @param {string} [siteConfig.managedPipelineMode] Managed pipeline mode. + * Possible values include: 'Integrated', 'Classic' + * + * @param {array} [siteConfig.virtualApplications] Virtual applications. + * + * @param {string} [siteConfig.loadBalancing] Site load balancing. Possible + * values include: 'WeightedRoundRobin', 'LeastRequests', 'LeastResponseTime', + * 'WeightedTotalTraffic', 'RequestHash' + * + * @param {object} [siteConfig.experiments] This is work around for polymophic + * types. + * + * @param {array} [siteConfig.experiments.rampUpRules] List of ramp-up rules. + * + * @param {object} [siteConfig.limits] Site limits. + * + * @param {number} [siteConfig.limits.maxPercentageCpu] Maximum allowed CPU + * usage percentage. + * + * @param {number} [siteConfig.limits.maxMemoryInMb] Maximum allowed memory + * usage in MB. + * + * @param {number} [siteConfig.limits.maxDiskSizeInMb] Maximum allowed disk + * size usage in MB. + * + * @param {boolean} [siteConfig.autoHealEnabled] true if Auto Heal + * is enabled; otherwise, false. + * + * @param {object} [siteConfig.autoHealRules] Auto Heal rules. + * + * @param {object} [siteConfig.autoHealRules.triggers] Conditions that describe + * when to execute the auto-heal actions. + * + * @param {object} [siteConfig.autoHealRules.triggers.requests] A rule based on + * total requests. + * + * @param {number} [siteConfig.autoHealRules.triggers.requests.count] Request + * Count. + * + * @param {string} [siteConfig.autoHealRules.triggers.requests.timeInterval] + * Time interval. + * + * @param {number} [siteConfig.autoHealRules.triggers.privateBytesInKB] A rule + * based on private bytes. + * + * @param {array} [siteConfig.autoHealRules.triggers.statusCodes] A rule based + * on status codes. + * + * @param {object} [siteConfig.autoHealRules.triggers.slowRequests] A rule + * based on request execution time. + * + * @param {string} [siteConfig.autoHealRules.triggers.slowRequests.timeTaken] + * Time taken. + * + * @param {number} [siteConfig.autoHealRules.triggers.slowRequests.count] + * Request Count. + * + * @param {string} + * [siteConfig.autoHealRules.triggers.slowRequests.timeInterval] Time interval. + * + * @param {object} [siteConfig.autoHealRules.actions] Actions to be executed + * when a rule is triggered. + * + * @param {string} [siteConfig.autoHealRules.actions.actionType] Predefined + * action to be taken. Possible values include: 'Recycle', 'LogEvent', + * 'CustomAction' + * + * @param {object} [siteConfig.autoHealRules.actions.customAction] Custom + * action to be taken. + * + * @param {string} [siteConfig.autoHealRules.actions.customAction.exe] + * Executable to be run. + * + * @param {string} [siteConfig.autoHealRules.actions.customAction.parameters] + * Parameters for the executable. + * + * @param {string} [siteConfig.autoHealRules.actions.minProcessExecutionTime] + * Minimum time the process must execute + * before taking the action + * + * @param {string} [siteConfig.tracingOptions] Tracing options. + * + * @param {string} [siteConfig.vnetName] Virtual Network name. + * + * @param {object} [siteConfig.cors] Cross-Origin Resource Sharing (CORS) + * settings. + * + * @param {array} [siteConfig.cors.allowedOrigins] Gets or sets the list of + * origins that should be allowed to make cross-origin + * calls (for example: http://example.com:12345). Use "*" to allow all. + * + * @param {object} [siteConfig.push] Push endpoint settings. + * + * @param {boolean} siteConfig.push.isPushEnabled Gets or sets a flag + * indicating whether the Push endpoint is enabled. + * + * @param {string} [siteConfig.push.tagWhitelistJson] Gets or sets a JSON + * string containing a list of tags that are whitelisted for use by the push + * registration endpoint. + * + * @param {string} [siteConfig.push.tagsRequiringAuth] Gets or sets a JSON + * string containing a list of tags that require user authentication to be used + * in the push registration endpoint. + * Tags can consist of alphanumeric characters and the following: + * '_', '@', '#', '.', ':', '-'. + * Validation should be performed at the PushRequestHandler. + * + * @param {string} [siteConfig.push.dynamicTagsJson] Gets or sets a JSON string + * containing a list of dynamic tags that will be evaluated from user claims in + * the push registration endpoint. + * + * @param {string} [siteConfig.push.kind] Kind of resource. + * + * @param {object} [siteConfig.apiDefinition] Information about the formal API + * definition for the app. + * + * @param {string} [siteConfig.apiDefinition.url] The URL of the API + * definition. + * + * @param {string} [siteConfig.autoSwapSlotName] Auto-swap slot name. + * + * @param {boolean} [siteConfig.localMySqlEnabled] true to enable + * local MySQL; otherwise, false. + * + * @param {number} [siteConfig.managedServiceIdentityId] Managed Service + * Identity Id + * + * @param {number} [siteConfig.xManagedServiceIdentityId] Explicit Managed + * Service Identity Id + * + * @param {array} [siteConfig.ipSecurityRestrictions] IP security restrictions. + * + * @param {boolean} [siteConfig.http20Enabled] Http20Enabled: configures a web + * site to allow clients to connect over http2.0 + * + * @param {string} [siteConfig.minTlsVersion] MinTlsVersion: configures the + * minimum version of TLS required for SSL requests. Possible values include: + * '1.0', '1.1', '1.2' + * + * @param {string} [siteConfig.ftpsState] State of FTP / FTPS service. Possible + * values include: 'AllAllowed', 'FtpsOnly', 'Disabled' + * + * @param {number} [siteConfig.reservedInstanceCount] Number of reserved + * instances. + * This setting only applies to the Consumption Plan + * + * @param {string} [siteConfig.kind] Kind of resource. + * + * @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. + */ + updateConfigurationWithHttpOperationResponse(resourceGroupName, name, siteConfig, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._updateConfiguration(resourceGroupName, name, siteConfig, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Updates the configuration of an app. + * + * Updates the configuration of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} siteConfig JSON representation of a SiteConfig object. See + * example. + * + * @param {number} [siteConfig.numberOfWorkers] Number of workers. + * + * @param {array} [siteConfig.defaultDocuments] Default documents. + * + * @param {string} [siteConfig.netFrameworkVersion] .NET Framework version. + * + * @param {string} [siteConfig.phpVersion] Version of PHP. + * + * @param {string} [siteConfig.pythonVersion] Version of Python. + * + * @param {string} [siteConfig.nodeVersion] Version of Node.js. + * + * @param {string} [siteConfig.linuxFxVersion] Linux App Framework and version + * + * @param {string} [siteConfig.windowsFxVersion] Xenon App Framework and + * version + * + * @param {boolean} [siteConfig.requestTracingEnabled] true if + * request tracing is enabled; otherwise, false. + * + * @param {date} [siteConfig.requestTracingExpirationTime] Request tracing + * expiration time. + * + * @param {boolean} [siteConfig.remoteDebuggingEnabled] true if + * remote debugging is enabled; otherwise, false. + * + * @param {string} [siteConfig.remoteDebuggingVersion] Remote debugging + * version. + * + * @param {boolean} [siteConfig.httpLoggingEnabled] true if HTTP + * logging is enabled; otherwise, false. + * + * @param {number} [siteConfig.logsDirectorySizeLimit] HTTP logs directory size + * limit. + * + * @param {boolean} [siteConfig.detailedErrorLoggingEnabled] true + * if detailed error logging is enabled; otherwise, false. + * + * @param {string} [siteConfig.publishingUsername] Publishing user name. + * + * @param {array} [siteConfig.appSettings] Application settings. + * + * @param {object} [siteConfig.azureStorageAccounts] User-provided Azure + * storage accounts. + * + * @param {array} [siteConfig.connectionStrings] Connection strings. + * + * @param {array} [siteConfig.handlerMappings] Handler mappings. + * + * @param {string} [siteConfig.documentRoot] Document root. + * + * @param {string} [siteConfig.scmType] SCM type. Possible values include: + * 'None', 'Dropbox', 'Tfs', 'LocalGit', 'GitHub', 'CodePlexGit', 'CodePlexHg', + * 'BitbucketGit', 'BitbucketHg', 'ExternalGit', 'ExternalHg', 'OneDrive', + * 'VSO' + * + * @param {boolean} [siteConfig.use32BitWorkerProcess] true to use + * 32-bit worker process; otherwise, false. + * + * @param {boolean} [siteConfig.webSocketsEnabled] true if + * WebSocket is enabled; otherwise, false. + * + * @param {boolean} [siteConfig.alwaysOn] true if Always On is + * enabled; otherwise, false. + * + * @param {string} [siteConfig.javaVersion] Java version. + * + * @param {string} [siteConfig.javaContainer] Java container. + * + * @param {string} [siteConfig.javaContainerVersion] Java container version. + * + * @param {string} [siteConfig.appCommandLine] App command line to launch. + * + * @param {string} [siteConfig.managedPipelineMode] Managed pipeline mode. + * Possible values include: 'Integrated', 'Classic' + * + * @param {array} [siteConfig.virtualApplications] Virtual applications. + * + * @param {string} [siteConfig.loadBalancing] Site load balancing. Possible + * values include: 'WeightedRoundRobin', 'LeastRequests', 'LeastResponseTime', + * 'WeightedTotalTraffic', 'RequestHash' + * + * @param {object} [siteConfig.experiments] This is work around for polymophic + * types. + * + * @param {array} [siteConfig.experiments.rampUpRules] List of ramp-up rules. + * + * @param {object} [siteConfig.limits] Site limits. + * + * @param {number} [siteConfig.limits.maxPercentageCpu] Maximum allowed CPU + * usage percentage. + * + * @param {number} [siteConfig.limits.maxMemoryInMb] Maximum allowed memory + * usage in MB. + * + * @param {number} [siteConfig.limits.maxDiskSizeInMb] Maximum allowed disk + * size usage in MB. + * + * @param {boolean} [siteConfig.autoHealEnabled] true if Auto Heal + * is enabled; otherwise, false. + * + * @param {object} [siteConfig.autoHealRules] Auto Heal rules. + * + * @param {object} [siteConfig.autoHealRules.triggers] Conditions that describe + * when to execute the auto-heal actions. + * + * @param {object} [siteConfig.autoHealRules.triggers.requests] A rule based on + * total requests. + * + * @param {number} [siteConfig.autoHealRules.triggers.requests.count] Request + * Count. + * + * @param {string} [siteConfig.autoHealRules.triggers.requests.timeInterval] + * Time interval. + * + * @param {number} [siteConfig.autoHealRules.triggers.privateBytesInKB] A rule + * based on private bytes. + * + * @param {array} [siteConfig.autoHealRules.triggers.statusCodes] A rule based + * on status codes. + * + * @param {object} [siteConfig.autoHealRules.triggers.slowRequests] A rule + * based on request execution time. + * + * @param {string} [siteConfig.autoHealRules.triggers.slowRequests.timeTaken] + * Time taken. + * + * @param {number} [siteConfig.autoHealRules.triggers.slowRequests.count] + * Request Count. + * + * @param {string} + * [siteConfig.autoHealRules.triggers.slowRequests.timeInterval] Time interval. + * + * @param {object} [siteConfig.autoHealRules.actions] Actions to be executed + * when a rule is triggered. + * + * @param {string} [siteConfig.autoHealRules.actions.actionType] Predefined + * action to be taken. Possible values include: 'Recycle', 'LogEvent', + * 'CustomAction' + * + * @param {object} [siteConfig.autoHealRules.actions.customAction] Custom + * action to be taken. + * + * @param {string} [siteConfig.autoHealRules.actions.customAction.exe] + * Executable to be run. + * + * @param {string} [siteConfig.autoHealRules.actions.customAction.parameters] + * Parameters for the executable. + * + * @param {string} [siteConfig.autoHealRules.actions.minProcessExecutionTime] + * Minimum time the process must execute + * before taking the action + * + * @param {string} [siteConfig.tracingOptions] Tracing options. + * + * @param {string} [siteConfig.vnetName] Virtual Network name. + * + * @param {object} [siteConfig.cors] Cross-Origin Resource Sharing (CORS) + * settings. + * + * @param {array} [siteConfig.cors.allowedOrigins] Gets or sets the list of + * origins that should be allowed to make cross-origin + * calls (for example: http://example.com:12345). Use "*" to allow all. + * + * @param {object} [siteConfig.push] Push endpoint settings. + * + * @param {boolean} siteConfig.push.isPushEnabled Gets or sets a flag + * indicating whether the Push endpoint is enabled. + * + * @param {string} [siteConfig.push.tagWhitelistJson] Gets or sets a JSON + * string containing a list of tags that are whitelisted for use by the push + * registration endpoint. + * + * @param {string} [siteConfig.push.tagsRequiringAuth] Gets or sets a JSON + * string containing a list of tags that require user authentication to be used + * in the push registration endpoint. + * Tags can consist of alphanumeric characters and the following: + * '_', '@', '#', '.', ':', '-'. + * Validation should be performed at the PushRequestHandler. + * + * @param {string} [siteConfig.push.dynamicTagsJson] Gets or sets a JSON string + * containing a list of dynamic tags that will be evaluated from user claims in + * the push registration endpoint. + * + * @param {string} [siteConfig.push.kind] Kind of resource. + * + * @param {object} [siteConfig.apiDefinition] Information about the formal API + * definition for the app. + * + * @param {string} [siteConfig.apiDefinition.url] The URL of the API + * definition. + * + * @param {string} [siteConfig.autoSwapSlotName] Auto-swap slot name. + * + * @param {boolean} [siteConfig.localMySqlEnabled] true to enable + * local MySQL; otherwise, false. + * + * @param {number} [siteConfig.managedServiceIdentityId] Managed Service + * Identity Id + * + * @param {number} [siteConfig.xManagedServiceIdentityId] Explicit Managed + * Service Identity Id + * + * @param {array} [siteConfig.ipSecurityRestrictions] IP security restrictions. + * + * @param {boolean} [siteConfig.http20Enabled] Http20Enabled: configures a web + * site to allow clients to connect over http2.0 + * + * @param {string} [siteConfig.minTlsVersion] MinTlsVersion: configures the + * minimum version of TLS required for SSL requests. Possible values include: + * '1.0', '1.1', '1.2' + * + * @param {string} [siteConfig.ftpsState] State of FTP / FTPS service. Possible + * values include: 'AllAllowed', 'FtpsOnly', 'Disabled' + * + * @param {number} [siteConfig.reservedInstanceCount] Number of reserved + * instances. + * This setting only applies to the Consumption Plan + * + * @param {string} [siteConfig.kind] Kind of resource. + * + * @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 {SiteConfigResource} - 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 SiteConfigResource} 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. + */ + updateConfiguration(resourceGroupName, name, siteConfig, 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._updateConfiguration(resourceGroupName, name, siteConfig, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._updateConfiguration(resourceGroupName, name, siteConfig, options, optionalCallback); + } + } + + /** + * @summary Gets a list of web app configuration snapshots identifiers. Each + * element of the list contains a timestamp and the ID of the snapshot. + * + * Gets a list of web app configuration snapshots identifiers. Each element of + * the list contains a timestamp and the ID of the snapshot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @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. + */ + listConfigurationSnapshotInfoWithHttpOperationResponse(resourceGroupName, name, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listConfigurationSnapshotInfo(resourceGroupName, name, 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 web app configuration snapshots identifiers. Each + * element of the list contains a timestamp and the ID of the snapshot. + * + * Gets a list of web app configuration snapshots identifiers. Each element of + * the list contains a timestamp and the ID of the snapshot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @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 {SiteConfigurationSnapshotInfoCollection} - 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 SiteConfigurationSnapshotInfoCollection} 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. + */ + listConfigurationSnapshotInfo(resourceGroupName, name, 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._listConfigurationSnapshotInfo(resourceGroupName, name, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listConfigurationSnapshotInfo(resourceGroupName, name, options, optionalCallback); + } + } + + /** + * @summary Gets a snapshot of the configuration of an app at a previous point + * in time. + * + * Gets a snapshot of the configuration of an app at a previous point in time. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} snapshotId The ID of the snapshot to read. + * + * @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. + */ + getConfigurationSnapshotWithHttpOperationResponse(resourceGroupName, name, snapshotId, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._getConfigurationSnapshot(resourceGroupName, name, snapshotId, 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 snapshot of the configuration of an app at a previous point + * in time. + * + * Gets a snapshot of the configuration of an app at a previous point in time. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} snapshotId The ID of the snapshot to read. + * + * @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 {SiteConfigResource} - 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 SiteConfigResource} 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. + */ + getConfigurationSnapshot(resourceGroupName, name, snapshotId, 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._getConfigurationSnapshot(resourceGroupName, name, snapshotId, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getConfigurationSnapshot(resourceGroupName, name, snapshotId, options, optionalCallback); + } + } + + /** + * @summary Reverts the configuration of an app to a previous snapshot. + * + * Reverts the configuration of an app to a previous snapshot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} snapshotId The ID of the snapshot to read. + * + * @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. + */ + recoverSiteConfigurationSnapshotWithHttpOperationResponse(resourceGroupName, name, snapshotId, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._recoverSiteConfigurationSnapshot(resourceGroupName, name, snapshotId, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Reverts the configuration of an app to a previous snapshot. + * + * Reverts the configuration of an app to a previous snapshot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} snapshotId The ID of the snapshot to read. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + recoverSiteConfigurationSnapshot(resourceGroupName, name, snapshotId, 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._recoverSiteConfigurationSnapshot(resourceGroupName, name, snapshotId, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._recoverSiteConfigurationSnapshot(resourceGroupName, name, snapshotId, options, optionalCallback); + } + } + + /** + * @summary Gets the last lines of docker logs for the given site + * + * Gets the last lines of docker logs for the given site + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @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. + */ + getWebSiteContainerLogsWithHttpOperationResponse(resourceGroupName, name, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._getWebSiteContainerLogs(resourceGroupName, name, 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 the last lines of docker logs for the given site + * + * Gets the last lines of docker logs for the given site + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @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 {Object} - 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. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + getWebSiteContainerLogs(resourceGroupName, name, 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._getWebSiteContainerLogs(resourceGroupName, name, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getWebSiteContainerLogs(resourceGroupName, name, options, optionalCallback); + } + } + + /** + * @summary Gets the ZIP archived docker log files for the given site + * + * Gets the ZIP archived docker log files for the given site + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @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. + */ + getContainerLogsZipWithHttpOperationResponse(resourceGroupName, name, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._getContainerLogsZip(resourceGroupName, name, 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 the ZIP archived docker log files for the given site + * + * Gets the ZIP archived docker log files for the given site + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @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 {Object} - 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. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + getContainerLogsZip(resourceGroupName, name, 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._getContainerLogsZip(resourceGroupName, name, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getContainerLogsZip(resourceGroupName, name, options, optionalCallback); + } + } + + /** + * @summary List continuous web jobs for an app, or a deployment slot. + * + * List continuous web jobs for an app, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @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. + */ + listContinuousWebJobsWithHttpOperationResponse(resourceGroupName, name, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listContinuousWebJobs(resourceGroupName, name, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary List continuous web jobs for an app, or a deployment slot. + * + * List continuous web jobs for an app, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @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 {ContinuousWebJobCollection} - 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 ContinuousWebJobCollection} 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. + */ + listContinuousWebJobs(resourceGroupName, name, 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._listContinuousWebJobs(resourceGroupName, name, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listContinuousWebJobs(resourceGroupName, name, options, optionalCallback); + } + } + + /** + * @summary Gets a continuous web job by its ID for an app, or a deployment + * slot. + * + * Gets a continuous web job by its ID for an app, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} webJobName Name of Web Job. + * + * @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. + */ + getContinuousWebJobWithHttpOperationResponse(resourceGroupName, name, webJobName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._getContinuousWebJob(resourceGroupName, name, webJobName, 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 continuous web job by its ID for an app, or a deployment + * slot. + * + * Gets a continuous web job by its ID for an app, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} webJobName Name of Web Job. + * + * @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 {ContinuousWebJob} - 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 ContinuousWebJob} 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. + */ + getContinuousWebJob(resourceGroupName, name, webJobName, 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._getContinuousWebJob(resourceGroupName, name, webJobName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getContinuousWebJob(resourceGroupName, name, webJobName, options, optionalCallback); + } + } + + /** + * @summary Delete a continuous web job by its ID for an app, or a deployment + * slot. + * + * Delete a continuous web job by its ID for an app, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} webJobName Name of Web Job. + * + * @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. + */ + deleteContinuousWebJobWithHttpOperationResponse(resourceGroupName, name, webJobName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._deleteContinuousWebJob(resourceGroupName, name, webJobName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Delete a continuous web job by its ID for an app, or a deployment + * slot. + * + * Delete a continuous web job by its ID for an app, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} webJobName Name of Web Job. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + deleteContinuousWebJob(resourceGroupName, name, webJobName, 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._deleteContinuousWebJob(resourceGroupName, name, webJobName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._deleteContinuousWebJob(resourceGroupName, name, webJobName, options, optionalCallback); + } + } + + /** + * @summary Start a continuous web job for an app, or a deployment slot. + * + * Start a continuous web job for an app, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} webJobName Name of Web Job. + * + * @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. + */ + startContinuousWebJobWithHttpOperationResponse(resourceGroupName, name, webJobName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._startContinuousWebJob(resourceGroupName, name, webJobName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Start a continuous web job for an app, or a deployment slot. + * + * Start a continuous web job for an app, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} webJobName Name of Web Job. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + startContinuousWebJob(resourceGroupName, name, webJobName, 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._startContinuousWebJob(resourceGroupName, name, webJobName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._startContinuousWebJob(resourceGroupName, name, webJobName, options, optionalCallback); + } + } + + /** + * @summary Stop a continuous web job for an app, or a deployment slot. + * + * Stop a continuous web job for an app, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} webJobName Name of Web Job. + * + * @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. + */ + stopContinuousWebJobWithHttpOperationResponse(resourceGroupName, name, webJobName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._stopContinuousWebJob(resourceGroupName, name, webJobName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Stop a continuous web job for an app, or a deployment slot. + * + * Stop a continuous web job for an app, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} webJobName Name of Web Job. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + stopContinuousWebJob(resourceGroupName, name, webJobName, 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._stopContinuousWebJob(resourceGroupName, name, webJobName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._stopContinuousWebJob(resourceGroupName, name, webJobName, options, optionalCallback); + } + } + + /** + * @summary List deployments for an app, or a deployment slot. + * + * List deployments for an app, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @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. + */ + listDeploymentsWithHttpOperationResponse(resourceGroupName, name, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listDeployments(resourceGroupName, name, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary List deployments for an app, or a deployment slot. + * + * List deployments for an app, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @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 {DeploymentCollection} - 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 DeploymentCollection} 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. + */ + listDeployments(resourceGroupName, name, 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._listDeployments(resourceGroupName, name, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listDeployments(resourceGroupName, name, options, optionalCallback); + } + } + + /** + * @summary Get a deployment by its ID for an app, or a deployment slot. + * + * Get a deployment by its ID for an app, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} id Deployment ID. + * + * @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. + */ + getDeploymentWithHttpOperationResponse(resourceGroupName, name, id, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._getDeployment(resourceGroupName, name, id, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Get a deployment by its ID for an app, or a deployment slot. + * + * Get a deployment by its ID for an app, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} id Deployment ID. + * + * @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 {Deployment} - 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 Deployment} 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. + */ + getDeployment(resourceGroupName, name, id, 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._getDeployment(resourceGroupName, name, id, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getDeployment(resourceGroupName, name, id, options, optionalCallback); + } + } + + /** + * @summary Create a deployment for an app, or a deployment slot. + * + * Create a deployment for an app, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} id ID of an existing deployment. + * + * @param {object} deployment Deployment details. + * + * @param {number} [deployment.status] Deployment status. + * + * @param {string} [deployment.message] Details about deployment status. + * + * @param {string} [deployment.author] Who authored the deployment. + * + * @param {string} [deployment.deployer] Who performed the deployment. + * + * @param {string} [deployment.authorEmail] Author email. + * + * @param {date} [deployment.startTime] Start time. + * + * @param {date} [deployment.endTime] End time. + * + * @param {boolean} [deployment.active] True if deployment is currently active, + * false if completed and null if not started. + * + * @param {string} [deployment.details] Details on deployment. + * + * @param {string} [deployment.kind] Kind of resource. + * + * @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. + */ + createDeploymentWithHttpOperationResponse(resourceGroupName, name, id, deployment, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._createDeployment(resourceGroupName, name, id, deployment, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Create a deployment for an app, or a deployment slot. + * + * Create a deployment for an app, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} id ID of an existing deployment. + * + * @param {object} deployment Deployment details. + * + * @param {number} [deployment.status] Deployment status. + * + * @param {string} [deployment.message] Details about deployment status. + * + * @param {string} [deployment.author] Who authored the deployment. + * + * @param {string} [deployment.deployer] Who performed the deployment. + * + * @param {string} [deployment.authorEmail] Author email. + * + * @param {date} [deployment.startTime] Start time. + * + * @param {date} [deployment.endTime] End time. + * + * @param {boolean} [deployment.active] True if deployment is currently active, + * false if completed and null if not started. + * + * @param {string} [deployment.details] Details on deployment. + * + * @param {string} [deployment.kind] Kind of resource. + * + * @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 {Deployment} - 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 Deployment} 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. + */ + createDeployment(resourceGroupName, name, id, deployment, 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._createDeployment(resourceGroupName, name, id, deployment, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._createDeployment(resourceGroupName, name, id, deployment, options, optionalCallback); + } + } + + /** + * @summary Delete a deployment by its ID for an app, or a deployment slot. + * + * Delete a deployment by its ID for an app, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} id Deployment ID. + * + * @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. + */ + deleteDeploymentWithHttpOperationResponse(resourceGroupName, name, id, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._deleteDeployment(resourceGroupName, name, id, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Delete a deployment by its ID for an app, or a deployment slot. + * + * Delete a deployment by its ID for an app, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} id Deployment ID. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + deleteDeployment(resourceGroupName, name, id, 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._deleteDeployment(resourceGroupName, name, id, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._deleteDeployment(resourceGroupName, name, id, options, optionalCallback); + } + } + + /** + * @summary List deployment log for specific deployment for an app, or a + * deployment slot. + * + * List deployment log for specific deployment for an app, or a deployment + * slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} id The ID of a specific deployment. This is the value of the + * name property in the JSON response from "GET + * /api/sites/{siteName}/deployments". + * + * @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. + */ + listDeploymentLogWithHttpOperationResponse(resourceGroupName, name, id, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listDeploymentLog(resourceGroupName, name, id, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary List deployment log for specific deployment for an app, or a + * deployment slot. + * + * List deployment log for specific deployment for an app, or a deployment + * slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} id The ID of a specific deployment. This is the value of the + * name property in the JSON response from "GET + * /api/sites/{siteName}/deployments". + * + * @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 {Deployment} - 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 Deployment} 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. + */ + listDeploymentLog(resourceGroupName, name, id, 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._listDeploymentLog(resourceGroupName, name, id, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listDeploymentLog(resourceGroupName, name, id, options, optionalCallback); + } + } + + /** + * @summary Discovers an existing app backup that can be restored from a blob + * in Azure storage. Use this to get information about the databases stored in + * a backup. + * + * Discovers an existing app backup that can be restored from a blob in Azure + * storage. Use this to get information about the databases stored in a backup. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} request A RestoreRequest object that includes Azure storage + * URL and blog name for discovery of backup. + * + * @param {string} request.storageAccountUrl SAS URL to the container. + * + * @param {string} [request.blobName] Name of a blob which contains the backup. + * + * @param {boolean} request.overwrite true if the restore + * operation can overwrite target app; otherwise, false. + * true is needed if trying to restore over an existing app. + * + * @param {string} [request.siteName] Name of an app. + * + * @param {array} [request.databases] Collection of databases which should be + * restored. This list has to match the list of databases included in the + * backup. + * + * @param {boolean} [request.ignoreConflictingHostNames] Changes a logic when + * restoring an app with custom domains. true to remove custom + * domains automatically. If false, custom domains are added to + * the app's object when it is being restored, but that might fail due to + * conflicts during the operation. + * + * @param {boolean} [request.ignoreDatabases] Ignore the databases and only + * restore the site content + * + * @param {string} [request.appServicePlan] Specify app service plan that will + * own restored site. + * + * @param {string} [request.operationType] Operation type. Possible values + * include: 'Default', 'Clone', 'Relocation', 'Snapshot', 'CloudFS' + * + * @param {boolean} [request.adjustConnectionStrings] true if + * SiteConfig.ConnectionStrings should be set in new app; otherwise, + * false. + * + * @param {string} [request.hostingEnvironment] App Service Environment name, + * if needed (only when restoring an app to an App Service Environment). + * + * @param {string} [request.kind] Kind of resource. + * + * @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. + */ + discoverBackupWithHttpOperationResponse(resourceGroupName, name, request, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._discoverBackup(resourceGroupName, name, request, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Discovers an existing app backup that can be restored from a blob + * in Azure storage. Use this to get information about the databases stored in + * a backup. + * + * Discovers an existing app backup that can be restored from a blob in Azure + * storage. Use this to get information about the databases stored in a backup. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} request A RestoreRequest object that includes Azure storage + * URL and blog name for discovery of backup. + * + * @param {string} request.storageAccountUrl SAS URL to the container. + * + * @param {string} [request.blobName] Name of a blob which contains the backup. + * + * @param {boolean} request.overwrite true if the restore + * operation can overwrite target app; otherwise, false. + * true is needed if trying to restore over an existing app. + * + * @param {string} [request.siteName] Name of an app. + * + * @param {array} [request.databases] Collection of databases which should be + * restored. This list has to match the list of databases included in the + * backup. + * + * @param {boolean} [request.ignoreConflictingHostNames] Changes a logic when + * restoring an app with custom domains. true to remove custom + * domains automatically. If false, custom domains are added to + * the app's object when it is being restored, but that might fail due to + * conflicts during the operation. + * + * @param {boolean} [request.ignoreDatabases] Ignore the databases and only + * restore the site content + * + * @param {string} [request.appServicePlan] Specify app service plan that will + * own restored site. + * + * @param {string} [request.operationType] Operation type. Possible values + * include: 'Default', 'Clone', 'Relocation', 'Snapshot', 'CloudFS' + * + * @param {boolean} [request.adjustConnectionStrings] true if + * SiteConfig.ConnectionStrings should be set in new app; otherwise, + * false. + * + * @param {string} [request.hostingEnvironment] App Service Environment name, + * if needed (only when restoring an app to an App Service Environment). + * + * @param {string} [request.kind] Kind of resource. + * + * @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 {RestoreRequest} - 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 RestoreRequest} 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. + */ + discoverBackup(resourceGroupName, name, request, 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._discoverBackup(resourceGroupName, name, request, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._discoverBackup(resourceGroupName, name, request, options, optionalCallback); + } + } + + /** + * @summary Lists ownership identifiers for domain associated with web app. + * + * Lists ownership identifiers for domain associated with web app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @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. + */ + listDomainOwnershipIdentifiersWithHttpOperationResponse(resourceGroupName, name, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listDomainOwnershipIdentifiers(resourceGroupName, name, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Lists ownership identifiers for domain associated with web app. + * + * Lists ownership identifiers for domain associated with web app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @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 {IdentifierCollection} - 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 IdentifierCollection} 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. + */ + listDomainOwnershipIdentifiers(resourceGroupName, name, 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._listDomainOwnershipIdentifiers(resourceGroupName, name, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listDomainOwnershipIdentifiers(resourceGroupName, name, options, optionalCallback); + } + } + + /** + * @summary Get domain ownership identifier for web app. + * + * Get domain ownership identifier for web app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} domainOwnershipIdentifierName Name of domain ownership + * identifier. + * + * @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. + */ + getDomainOwnershipIdentifierWithHttpOperationResponse(resourceGroupName, name, domainOwnershipIdentifierName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._getDomainOwnershipIdentifier(resourceGroupName, name, domainOwnershipIdentifierName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Get domain ownership identifier for web app. + * + * Get domain ownership identifier for web app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} domainOwnershipIdentifierName Name of domain ownership + * identifier. + * + * @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 {Identifier} - 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 Identifier} 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. + */ + getDomainOwnershipIdentifier(resourceGroupName, name, domainOwnershipIdentifierName, 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._getDomainOwnershipIdentifier(resourceGroupName, name, domainOwnershipIdentifierName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getDomainOwnershipIdentifier(resourceGroupName, name, domainOwnershipIdentifierName, options, optionalCallback); + } + } + + /** + * @summary Creates a domain ownership identifier for web app, or updates an + * existing ownership identifier. + * + * Creates a domain ownership identifier for web app, or updates an existing + * ownership identifier. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} domainOwnershipIdentifierName Name of domain ownership + * identifier. + * + * @param {object} domainOwnershipIdentifier A JSON representation of the + * domain ownership properties. + * + * @param {string} [domainOwnershipIdentifier.identifierId] String + * representation of the identity. + * + * @param {string} [domainOwnershipIdentifier.kind] Kind of resource. + * + * @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. + */ + createOrUpdateDomainOwnershipIdentifierWithHttpOperationResponse(resourceGroupName, name, domainOwnershipIdentifierName, domainOwnershipIdentifier, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._createOrUpdateDomainOwnershipIdentifier(resourceGroupName, name, domainOwnershipIdentifierName, domainOwnershipIdentifier, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Creates a domain ownership identifier for web app, or updates an + * existing ownership identifier. + * + * Creates a domain ownership identifier for web app, or updates an existing + * ownership identifier. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} domainOwnershipIdentifierName Name of domain ownership + * identifier. + * + * @param {object} domainOwnershipIdentifier A JSON representation of the + * domain ownership properties. + * + * @param {string} [domainOwnershipIdentifier.identifierId] String + * representation of the identity. + * + * @param {string} [domainOwnershipIdentifier.kind] Kind of resource. + * + * @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 {Identifier} - 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 Identifier} 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. + */ + createOrUpdateDomainOwnershipIdentifier(resourceGroupName, name, domainOwnershipIdentifierName, domainOwnershipIdentifier, 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._createOrUpdateDomainOwnershipIdentifier(resourceGroupName, name, domainOwnershipIdentifierName, domainOwnershipIdentifier, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._createOrUpdateDomainOwnershipIdentifier(resourceGroupName, name, domainOwnershipIdentifierName, domainOwnershipIdentifier, options, optionalCallback); + } + } + + /** + * @summary Deletes a domain ownership identifier for a web app. + * + * Deletes a domain ownership identifier for a web app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} domainOwnershipIdentifierName Name of domain ownership + * identifier. + * + * @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. + */ + deleteDomainOwnershipIdentifierWithHttpOperationResponse(resourceGroupName, name, domainOwnershipIdentifierName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._deleteDomainOwnershipIdentifier(resourceGroupName, name, domainOwnershipIdentifierName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Deletes a domain ownership identifier for a web app. + * + * Deletes a domain ownership identifier for a web app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} domainOwnershipIdentifierName Name of domain ownership + * identifier. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + deleteDomainOwnershipIdentifier(resourceGroupName, name, domainOwnershipIdentifierName, 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._deleteDomainOwnershipIdentifier(resourceGroupName, name, domainOwnershipIdentifierName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._deleteDomainOwnershipIdentifier(resourceGroupName, name, domainOwnershipIdentifierName, options, optionalCallback); + } + } + + /** + * @summary Creates a domain ownership identifier for web app, or updates an + * existing ownership identifier. + * + * Creates a domain ownership identifier for web app, or updates an existing + * ownership identifier. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} domainOwnershipIdentifierName Name of domain ownership + * identifier. + * + * @param {object} domainOwnershipIdentifier A JSON representation of the + * domain ownership properties. + * + * @param {string} [domainOwnershipIdentifier.identifierId] String + * representation of the identity. + * + * @param {string} [domainOwnershipIdentifier.kind] Kind of resource. + * + * @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. + */ + updateDomainOwnershipIdentifierWithHttpOperationResponse(resourceGroupName, name, domainOwnershipIdentifierName, domainOwnershipIdentifier, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._updateDomainOwnershipIdentifier(resourceGroupName, name, domainOwnershipIdentifierName, domainOwnershipIdentifier, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Creates a domain ownership identifier for web app, or updates an + * existing ownership identifier. + * + * Creates a domain ownership identifier for web app, or updates an existing + * ownership identifier. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} domainOwnershipIdentifierName Name of domain ownership + * identifier. + * + * @param {object} domainOwnershipIdentifier A JSON representation of the + * domain ownership properties. + * + * @param {string} [domainOwnershipIdentifier.identifierId] String + * representation of the identity. + * + * @param {string} [domainOwnershipIdentifier.kind] Kind of resource. + * + * @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 {Identifier} - 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 Identifier} 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. + */ + updateDomainOwnershipIdentifier(resourceGroupName, name, domainOwnershipIdentifierName, domainOwnershipIdentifier, 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._updateDomainOwnershipIdentifier(resourceGroupName, name, domainOwnershipIdentifierName, domainOwnershipIdentifier, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._updateDomainOwnershipIdentifier(resourceGroupName, name, domainOwnershipIdentifierName, domainOwnershipIdentifier, options, optionalCallback); + } + } + + /** + * @summary Get the status of the last MSDeploy operation. + * + * Get the status of the last MSDeploy operation. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @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. + */ + getMSDeployStatusWithHttpOperationResponse(resourceGroupName, name, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._getMSDeployStatus(resourceGroupName, name, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Get the status of the last MSDeploy operation. + * + * Get the status of the last MSDeploy operation. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @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 {MSDeployStatus} - 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 MSDeployStatus} 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. + */ + getMSDeployStatus(resourceGroupName, name, 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._getMSDeployStatus(resourceGroupName, name, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getMSDeployStatus(resourceGroupName, name, options, optionalCallback); + } + } + + /** + * @summary Invoke the MSDeploy web app extension. + * + * Invoke the MSDeploy web app extension. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {object} mSDeploy Details of MSDeploy operation + * + * @param {string} [mSDeploy.packageUri] Package URI + * + * @param {string} [mSDeploy.connectionString] SQL Connection String + * + * @param {string} [mSDeploy.dbType] Database Type + * + * @param {string} [mSDeploy.setParametersXmlFileUri] URI of MSDeploy + * Parameters file. Must not be set if SetParameters is used. + * + * @param {object} [mSDeploy.setParameters] MSDeploy Parameters. Must not be + * set if SetParametersXmlFileUri is used. + * + * @param {boolean} [mSDeploy.skipAppData] Controls whether the MSDeploy + * operation skips the App_Data directory. + * If set to true, the existing App_Data directory on the + * destination + * will not be deleted, and any App_Data directory in the source will be + * ignored. + * Setting is false by default. + * + * @param {boolean} [mSDeploy.appOffline] Sets the AppOffline rule while the + * MSDeploy operation executes. + * Setting is false by default. + * + * @param {string} [mSDeploy.kind] Kind of resource. + * + * @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. + */ + createMSDeployOperationWithHttpOperationResponse(resourceGroupName, name, mSDeploy, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._createMSDeployOperation(resourceGroupName, name, mSDeploy, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Invoke the MSDeploy web app extension. + * + * Invoke the MSDeploy web app extension. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {object} mSDeploy Details of MSDeploy operation + * + * @param {string} [mSDeploy.packageUri] Package URI + * + * @param {string} [mSDeploy.connectionString] SQL Connection String + * + * @param {string} [mSDeploy.dbType] Database Type + * + * @param {string} [mSDeploy.setParametersXmlFileUri] URI of MSDeploy + * Parameters file. Must not be set if SetParameters is used. + * + * @param {object} [mSDeploy.setParameters] MSDeploy Parameters. Must not be + * set if SetParametersXmlFileUri is used. + * + * @param {boolean} [mSDeploy.skipAppData] Controls whether the MSDeploy + * operation skips the App_Data directory. + * If set to true, the existing App_Data directory on the + * destination + * will not be deleted, and any App_Data directory in the source will be + * ignored. + * Setting is false by default. + * + * @param {boolean} [mSDeploy.appOffline] Sets the AppOffline rule while the + * MSDeploy operation executes. + * Setting is false by default. + * + * @param {string} [mSDeploy.kind] Kind of resource. + * + * @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 {MSDeployStatus} - 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 MSDeployStatus} 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. + */ + createMSDeployOperation(resourceGroupName, name, mSDeploy, 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._createMSDeployOperation(resourceGroupName, name, mSDeploy, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._createMSDeployOperation(resourceGroupName, name, mSDeploy, options, optionalCallback); + } + } + + /** + * @summary Get the MSDeploy Log for the last MSDeploy operation. + * + * Get the MSDeploy Log for the last MSDeploy operation. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @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. + */ + getMSDeployLogWithHttpOperationResponse(resourceGroupName, name, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._getMSDeployLog(resourceGroupName, name, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Get the MSDeploy Log for the last MSDeploy operation. + * + * Get the MSDeploy Log for the last MSDeploy operation. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @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 {MSDeployLog} - 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 MSDeployLog} 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. + */ + getMSDeployLog(resourceGroupName, name, 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._getMSDeployLog(resourceGroupName, name, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getMSDeployLog(resourceGroupName, name, options, optionalCallback); + } + } + + /** + * @summary List the functions for a web site, or a deployment slot. + * + * List the functions for a web site, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @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. + */ + listFunctionsWithHttpOperationResponse(resourceGroupName, name, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listFunctions(resourceGroupName, name, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary List the functions for a web site, or a deployment slot. + * + * List the functions for a web site, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @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 {FunctionEnvelopeCollection} - 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 FunctionEnvelopeCollection} 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. + */ + listFunctions(resourceGroupName, name, 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._listFunctions(resourceGroupName, name, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listFunctions(resourceGroupName, name, options, optionalCallback); + } + } + + /** + * @summary Fetch a short lived token that can be exchanged for a master key. + * + * Fetch a short lived token that can be exchanged for a master key. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @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. + */ + getFunctionsAdminTokenWithHttpOperationResponse(resourceGroupName, name, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._getFunctionsAdminToken(resourceGroupName, name, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Fetch a short lived token that can be exchanged for a master key. + * + * Fetch a short lived token that can be exchanged for a master key. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @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 {String} - 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. + * + * {string} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + getFunctionsAdminToken(resourceGroupName, name, 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._getFunctionsAdminToken(resourceGroupName, name, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getFunctionsAdminToken(resourceGroupName, name, options, optionalCallback); + } + } + + /** + * @summary Get function information by its ID for web site, or a deployment + * slot. + * + * Get function information by its ID for web site, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} functionName Function name. + * + * @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. + */ + getFunctionWithHttpOperationResponse(resourceGroupName, name, functionName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._getFunction(resourceGroupName, name, functionName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Get function information by its ID for web site, or a deployment + * slot. + * + * Get function information by its ID for web site, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} functionName Function name. + * + * @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 {FunctionEnvelope} - 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 FunctionEnvelope} 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. + */ + getFunction(resourceGroupName, name, functionName, 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._getFunction(resourceGroupName, name, functionName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getFunction(resourceGroupName, name, functionName, options, optionalCallback); + } + } + + /** + * @summary Create function for web site, or a deployment slot. + * + * Create function for web site, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} functionName Function name. + * + * @param {object} functionEnvelope Function details. + * + * @param {string} [functionEnvelope.functionAppId] Function App ID. + * + * @param {string} [functionEnvelope.scriptRootPathHref] Script root path URI. + * + * @param {string} [functionEnvelope.scriptHref] Script URI. + * + * @param {string} [functionEnvelope.configHref] Config URI. + * + * @param {string} [functionEnvelope.secretsFileHref] Secrets file URI. + * + * @param {string} [functionEnvelope.href] Function URI. + * + * @param {object} [functionEnvelope.config] Config information. + * + * @param {object} [functionEnvelope.files] File list. + * + * @param {string} [functionEnvelope.testData] Test data used when testing via + * the Azure Portal. + * + * @param {string} [functionEnvelope.kind] Kind of resource. + * + * @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. + */ + createFunctionWithHttpOperationResponse(resourceGroupName, name, functionName, functionEnvelope, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._createFunction(resourceGroupName, name, functionName, functionEnvelope, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Create function for web site, or a deployment slot. + * + * Create function for web site, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} functionName Function name. + * + * @param {object} functionEnvelope Function details. + * + * @param {string} [functionEnvelope.functionAppId] Function App ID. + * + * @param {string} [functionEnvelope.scriptRootPathHref] Script root path URI. + * + * @param {string} [functionEnvelope.scriptHref] Script URI. + * + * @param {string} [functionEnvelope.configHref] Config URI. + * + * @param {string} [functionEnvelope.secretsFileHref] Secrets file URI. + * + * @param {string} [functionEnvelope.href] Function URI. + * + * @param {object} [functionEnvelope.config] Config information. + * + * @param {object} [functionEnvelope.files] File list. + * + * @param {string} [functionEnvelope.testData] Test data used when testing via + * the Azure Portal. + * + * @param {string} [functionEnvelope.kind] Kind of resource. + * + * @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 {FunctionEnvelope} - 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 FunctionEnvelope} 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. + */ + createFunction(resourceGroupName, name, functionName, functionEnvelope, 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._createFunction(resourceGroupName, name, functionName, functionEnvelope, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._createFunction(resourceGroupName, name, functionName, functionEnvelope, options, optionalCallback); + } + } + + /** + * @summary Delete a function for web site, or a deployment slot. + * + * Delete a function for web site, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} functionName Function name. + * + * @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. + */ + deleteFunctionWithHttpOperationResponse(resourceGroupName, name, functionName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._deleteFunction(resourceGroupName, name, functionName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Delete a function for web site, or a deployment slot. + * + * Delete a function for web site, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} functionName Function name. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + deleteFunction(resourceGroupName, name, functionName, 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._deleteFunction(resourceGroupName, name, functionName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._deleteFunction(resourceGroupName, name, functionName, options, optionalCallback); + } + } + + /** + * @summary Get function secrets for a function in a web site, or a deployment + * slot. + * + * Get function secrets for a function in a web site, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} functionName Function name. + * + * @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. + */ + listFunctionSecretsWithHttpOperationResponse(resourceGroupName, name, functionName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listFunctionSecrets(resourceGroupName, name, functionName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Get function secrets for a function in a web site, or a deployment + * slot. + * + * Get function secrets for a function in a web site, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} functionName Function name. + * + * @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 {FunctionSecrets} - 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 FunctionSecrets} 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. + */ + listFunctionSecrets(resourceGroupName, name, functionName, 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._listFunctionSecrets(resourceGroupName, name, functionName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listFunctionSecrets(resourceGroupName, name, functionName, options, optionalCallback); + } + } + + /** + * @summary Get hostname bindings for an app or a deployment slot. + * + * Get hostname bindings for an app or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @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. + */ + listHostNameBindingsWithHttpOperationResponse(resourceGroupName, name, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listHostNameBindings(resourceGroupName, name, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Get hostname bindings for an app or a deployment slot. + * + * Get hostname bindings for an app or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @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 {HostNameBindingCollection} - 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 HostNameBindingCollection} 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. + */ + listHostNameBindings(resourceGroupName, name, 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._listHostNameBindings(resourceGroupName, name, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listHostNameBindings(resourceGroupName, name, options, optionalCallback); + } + } + + /** + * @summary Get the named hostname binding for an app (or deployment slot, if + * specified). + * + * Get the named hostname binding for an app (or deployment slot, if + * specified). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} hostName Hostname in the hostname binding. + * + * @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. + */ + getHostNameBindingWithHttpOperationResponse(resourceGroupName, name, hostName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._getHostNameBinding(resourceGroupName, name, hostName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Get the named hostname binding for an app (or deployment slot, if + * specified). + * + * Get the named hostname binding for an app (or deployment slot, if + * specified). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} hostName Hostname in the hostname binding. + * + * @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 {HostNameBinding} - 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 HostNameBinding} 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. + */ + getHostNameBinding(resourceGroupName, name, hostName, 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._getHostNameBinding(resourceGroupName, name, hostName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getHostNameBinding(resourceGroupName, name, hostName, options, optionalCallback); + } + } + + /** + * @summary Creates a hostname binding for an app. + * + * Creates a hostname binding for an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} hostName Hostname in the hostname binding. + * + * @param {object} hostNameBinding Binding details. This is the JSON + * representation of a HostNameBinding object. + * + * @param {string} [hostNameBinding.siteName] App Service app name. + * + * @param {string} [hostNameBinding.domainId] Fully qualified ARM domain + * resource URI. + * + * @param {string} [hostNameBinding.azureResourceName] Azure resource name. + * + * @param {string} [hostNameBinding.azureResourceType] Azure resource type. + * Possible values include: 'Website', 'TrafficManager' + * + * @param {string} [hostNameBinding.customHostNameDnsRecordType] Custom DNS + * record type. Possible values include: 'CName', 'A' + * + * @param {string} [hostNameBinding.hostNameType] Hostname type. Possible + * values include: 'Verified', 'Managed' + * + * @param {string} [hostNameBinding.sslState] SSL type. Possible values + * include: 'Disabled', 'SniEnabled', 'IpBasedEnabled' + * + * @param {string} [hostNameBinding.thumbprint] SSL certificate thumbprint + * + * @param {string} [hostNameBinding.kind] Kind of resource. + * + * @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. + */ + createOrUpdateHostNameBindingWithHttpOperationResponse(resourceGroupName, name, hostName, hostNameBinding, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._createOrUpdateHostNameBinding(resourceGroupName, name, hostName, hostNameBinding, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Creates a hostname binding for an app. + * + * Creates a hostname binding for an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} hostName Hostname in the hostname binding. + * + * @param {object} hostNameBinding Binding details. This is the JSON + * representation of a HostNameBinding object. + * + * @param {string} [hostNameBinding.siteName] App Service app name. + * + * @param {string} [hostNameBinding.domainId] Fully qualified ARM domain + * resource URI. + * + * @param {string} [hostNameBinding.azureResourceName] Azure resource name. + * + * @param {string} [hostNameBinding.azureResourceType] Azure resource type. + * Possible values include: 'Website', 'TrafficManager' + * + * @param {string} [hostNameBinding.customHostNameDnsRecordType] Custom DNS + * record type. Possible values include: 'CName', 'A' + * + * @param {string} [hostNameBinding.hostNameType] Hostname type. Possible + * values include: 'Verified', 'Managed' + * + * @param {string} [hostNameBinding.sslState] SSL type. Possible values + * include: 'Disabled', 'SniEnabled', 'IpBasedEnabled' + * + * @param {string} [hostNameBinding.thumbprint] SSL certificate thumbprint + * + * @param {string} [hostNameBinding.kind] Kind of resource. + * + * @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 {HostNameBinding} - 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 HostNameBinding} 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. + */ + createOrUpdateHostNameBinding(resourceGroupName, name, hostName, hostNameBinding, 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._createOrUpdateHostNameBinding(resourceGroupName, name, hostName, hostNameBinding, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._createOrUpdateHostNameBinding(resourceGroupName, name, hostName, hostNameBinding, options, optionalCallback); + } + } + + /** + * @summary Deletes a hostname binding for an app. + * + * Deletes a hostname binding for an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} hostName Hostname in the hostname binding. + * + * @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. + */ + deleteHostNameBindingWithHttpOperationResponse(resourceGroupName, name, hostName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._deleteHostNameBinding(resourceGroupName, name, hostName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Deletes a hostname binding for an app. + * + * Deletes a hostname binding for an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} hostName Hostname in the hostname binding. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + deleteHostNameBinding(resourceGroupName, name, hostName, 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._deleteHostNameBinding(resourceGroupName, name, hostName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._deleteHostNameBinding(resourceGroupName, name, hostName, options, optionalCallback); + } + } + + /** + * @summary Retrieves a specific Service Bus Hybrid Connection used by this Web + * App. + * + * Retrieves a specific Service Bus Hybrid Connection used by this Web App. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @param {string} namespaceName The namespace for this hybrid connection. + * + * @param {string} relayName The relay name for this hybrid connection. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + getHybridConnectionWithHttpOperationResponse(resourceGroupName, name, namespaceName, relayName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._getHybridConnection(resourceGroupName, name, namespaceName, relayName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Retrieves a specific Service Bus Hybrid Connection used by this Web + * App. + * + * Retrieves a specific Service Bus Hybrid Connection used by this Web App. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @param {string} namespaceName The namespace for this hybrid connection. + * + * @param {string} relayName The relay name for this hybrid connection. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {HybridConnection} - 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 HybridConnection} 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. + */ + getHybridConnection(resourceGroupName, name, namespaceName, relayName, 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._getHybridConnection(resourceGroupName, name, namespaceName, relayName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getHybridConnection(resourceGroupName, name, namespaceName, relayName, options, optionalCallback); + } + } + + /** + * @summary Creates a new Hybrid Connection using a Service Bus relay. + * + * Creates a new Hybrid Connection using a Service Bus relay. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @param {string} namespaceName The namespace for this hybrid connection. + * + * @param {string} relayName The relay name for this hybrid connection. + * + * @param {object} connectionEnvelope The details of the hybrid connection. + * + * @param {string} [connectionEnvelope.serviceBusNamespace] The name of the + * Service Bus namespace. + * + * @param {string} [connectionEnvelope.relayName] The name of the Service Bus + * relay. + * + * @param {string} [connectionEnvelope.relayArmUri] The ARM URI to the Service + * Bus relay. + * + * @param {string} [connectionEnvelope.hostname] The hostname of the endpoint. + * + * @param {number} [connectionEnvelope.port] The port of the endpoint. + * + * @param {string} [connectionEnvelope.sendKeyName] The name of the Service Bus + * key which has Send permissions. This is used to authenticate to Service Bus. + * + * @param {string} [connectionEnvelope.sendKeyValue] The value of the Service + * Bus key. This is used to authenticate to Service Bus. In ARM this key will + * not be returned + * normally, use the POST /listKeys API instead. + * + * @param {string} [connectionEnvelope.serviceBusSuffix] The suffix for the + * service bus endpoint. By default this is .servicebus.windows.net + * + * @param {string} [connectionEnvelope.kind] Kind of resource. + * + * @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. + */ + createOrUpdateHybridConnectionWithHttpOperationResponse(resourceGroupName, name, namespaceName, relayName, connectionEnvelope, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._createOrUpdateHybridConnection(resourceGroupName, name, namespaceName, relayName, connectionEnvelope, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Creates a new Hybrid Connection using a Service Bus relay. + * + * Creates a new Hybrid Connection using a Service Bus relay. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @param {string} namespaceName The namespace for this hybrid connection. + * + * @param {string} relayName The relay name for this hybrid connection. + * + * @param {object} connectionEnvelope The details of the hybrid connection. + * + * @param {string} [connectionEnvelope.serviceBusNamespace] The name of the + * Service Bus namespace. + * + * @param {string} [connectionEnvelope.relayName] The name of the Service Bus + * relay. + * + * @param {string} [connectionEnvelope.relayArmUri] The ARM URI to the Service + * Bus relay. + * + * @param {string} [connectionEnvelope.hostname] The hostname of the endpoint. + * + * @param {number} [connectionEnvelope.port] The port of the endpoint. + * + * @param {string} [connectionEnvelope.sendKeyName] The name of the Service Bus + * key which has Send permissions. This is used to authenticate to Service Bus. + * + * @param {string} [connectionEnvelope.sendKeyValue] The value of the Service + * Bus key. This is used to authenticate to Service Bus. In ARM this key will + * not be returned + * normally, use the POST /listKeys API instead. + * + * @param {string} [connectionEnvelope.serviceBusSuffix] The suffix for the + * service bus endpoint. By default this is .servicebus.windows.net + * + * @param {string} [connectionEnvelope.kind] Kind of resource. + * + * @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 {HybridConnection} - 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 HybridConnection} 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. + */ + createOrUpdateHybridConnection(resourceGroupName, name, namespaceName, relayName, connectionEnvelope, 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._createOrUpdateHybridConnection(resourceGroupName, name, namespaceName, relayName, connectionEnvelope, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._createOrUpdateHybridConnection(resourceGroupName, name, namespaceName, relayName, connectionEnvelope, options, optionalCallback); + } + } + + /** + * @summary Removes a Hybrid Connection from this site. + * + * Removes a Hybrid Connection from this site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @param {string} namespaceName The namespace for this hybrid connection. + * + * @param {string} relayName The relay name for this hybrid connection. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + deleteHybridConnectionWithHttpOperationResponse(resourceGroupName, name, namespaceName, relayName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._deleteHybridConnection(resourceGroupName, name, namespaceName, relayName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Removes a Hybrid Connection from this site. + * + * Removes a Hybrid Connection from this site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @param {string} namespaceName The namespace for this hybrid connection. + * + * @param {string} relayName The relay name for this hybrid connection. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + deleteHybridConnection(resourceGroupName, name, namespaceName, relayName, 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._deleteHybridConnection(resourceGroupName, name, namespaceName, relayName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._deleteHybridConnection(resourceGroupName, name, namespaceName, relayName, options, optionalCallback); + } + } + + /** + * @summary Creates a new Hybrid Connection using a Service Bus relay. + * + * Creates a new Hybrid Connection using a Service Bus relay. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @param {string} namespaceName The namespace for this hybrid connection. + * + * @param {string} relayName The relay name for this hybrid connection. + * + * @param {object} connectionEnvelope The details of the hybrid connection. + * + * @param {string} [connectionEnvelope.serviceBusNamespace] The name of the + * Service Bus namespace. + * + * @param {string} [connectionEnvelope.relayName] The name of the Service Bus + * relay. + * + * @param {string} [connectionEnvelope.relayArmUri] The ARM URI to the Service + * Bus relay. + * + * @param {string} [connectionEnvelope.hostname] The hostname of the endpoint. + * + * @param {number} [connectionEnvelope.port] The port of the endpoint. + * + * @param {string} [connectionEnvelope.sendKeyName] The name of the Service Bus + * key which has Send permissions. This is used to authenticate to Service Bus. + * + * @param {string} [connectionEnvelope.sendKeyValue] The value of the Service + * Bus key. This is used to authenticate to Service Bus. In ARM this key will + * not be returned + * normally, use the POST /listKeys API instead. + * + * @param {string} [connectionEnvelope.serviceBusSuffix] The suffix for the + * service bus endpoint. By default this is .servicebus.windows.net + * + * @param {string} [connectionEnvelope.kind] Kind of resource. + * + * @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. + */ + updateHybridConnectionWithHttpOperationResponse(resourceGroupName, name, namespaceName, relayName, connectionEnvelope, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._updateHybridConnection(resourceGroupName, name, namespaceName, relayName, connectionEnvelope, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Creates a new Hybrid Connection using a Service Bus relay. + * + * Creates a new Hybrid Connection using a Service Bus relay. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @param {string} namespaceName The namespace for this hybrid connection. + * + * @param {string} relayName The relay name for this hybrid connection. + * + * @param {object} connectionEnvelope The details of the hybrid connection. + * + * @param {string} [connectionEnvelope.serviceBusNamespace] The name of the + * Service Bus namespace. + * + * @param {string} [connectionEnvelope.relayName] The name of the Service Bus + * relay. + * + * @param {string} [connectionEnvelope.relayArmUri] The ARM URI to the Service + * Bus relay. + * + * @param {string} [connectionEnvelope.hostname] The hostname of the endpoint. + * + * @param {number} [connectionEnvelope.port] The port of the endpoint. + * + * @param {string} [connectionEnvelope.sendKeyName] The name of the Service Bus + * key which has Send permissions. This is used to authenticate to Service Bus. + * + * @param {string} [connectionEnvelope.sendKeyValue] The value of the Service + * Bus key. This is used to authenticate to Service Bus. In ARM this key will + * not be returned + * normally, use the POST /listKeys API instead. + * + * @param {string} [connectionEnvelope.serviceBusSuffix] The suffix for the + * service bus endpoint. By default this is .servicebus.windows.net + * + * @param {string} [connectionEnvelope.kind] Kind of resource. + * + * @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 {HybridConnection} - 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 HybridConnection} 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. + */ + updateHybridConnection(resourceGroupName, name, namespaceName, relayName, connectionEnvelope, 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._updateHybridConnection(resourceGroupName, name, namespaceName, relayName, connectionEnvelope, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._updateHybridConnection(resourceGroupName, name, namespaceName, relayName, connectionEnvelope, options, optionalCallback); + } + } + + /** + * @summary Gets the send key name and value for a Hybrid Connection. + * + * Gets the send key name and value for a Hybrid Connection. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @param {string} namespaceName The namespace for this hybrid connection. + * + * @param {string} relayName The relay name for this hybrid connection. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listHybridConnectionKeysWithHttpOperationResponse(resourceGroupName, name, namespaceName, relayName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listHybridConnectionKeys(resourceGroupName, name, namespaceName, relayName, 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 the send key name and value for a Hybrid Connection. + * + * Gets the send key name and value for a Hybrid Connection. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @param {string} namespaceName The namespace for this hybrid connection. + * + * @param {string} relayName The relay name for this hybrid connection. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {HybridConnectionKey} - 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 HybridConnectionKey} 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. + */ + listHybridConnectionKeys(resourceGroupName, name, namespaceName, relayName, 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._listHybridConnectionKeys(resourceGroupName, name, namespaceName, relayName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listHybridConnectionKeys(resourceGroupName, name, namespaceName, relayName, options, optionalCallback); + } + } + + /** + * @summary Retrieves all Service Bus Hybrid Connections used by this Web App. + * + * Retrieves all Service Bus Hybrid Connections used by this Web App. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @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. + */ + listHybridConnectionsWithHttpOperationResponse(resourceGroupName, name, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listHybridConnections(resourceGroupName, name, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Retrieves all Service Bus Hybrid Connections used by this Web App. + * + * Retrieves all Service Bus Hybrid Connections used by this Web App. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @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 {HybridConnection} - 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 HybridConnection} 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. + */ + listHybridConnections(resourceGroupName, name, 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._listHybridConnections(resourceGroupName, name, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listHybridConnections(resourceGroupName, name, options, optionalCallback); + } + } + + /** + * @summary Gets hybrid connections configured for an app (or deployment slot, + * if specified). + * + * Gets hybrid connections configured for an app (or deployment slot, if + * specified). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @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. + */ + listRelayServiceConnectionsWithHttpOperationResponse(resourceGroupName, name, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listRelayServiceConnections(resourceGroupName, name, 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 hybrid connections configured for an app (or deployment slot, + * if specified). + * + * Gets hybrid connections configured for an app (or deployment slot, if + * specified). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @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 {RelayServiceConnectionEntity} - 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 RelayServiceConnectionEntity} 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. + */ + listRelayServiceConnections(resourceGroupName, name, 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._listRelayServiceConnections(resourceGroupName, name, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listRelayServiceConnections(resourceGroupName, name, options, optionalCallback); + } + } + + /** + * @summary Gets a hybrid connection configuration by its name. + * + * Gets a hybrid connection configuration by its name. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} entityName Name of the hybrid connection. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + getRelayServiceConnectionWithHttpOperationResponse(resourceGroupName, name, entityName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._getRelayServiceConnection(resourceGroupName, name, entityName, 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 hybrid connection configuration by its name. + * + * Gets a hybrid connection configuration by its name. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} entityName Name of the hybrid connection. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {RelayServiceConnectionEntity} - 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 RelayServiceConnectionEntity} 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. + */ + getRelayServiceConnection(resourceGroupName, name, entityName, 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._getRelayServiceConnection(resourceGroupName, name, entityName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getRelayServiceConnection(resourceGroupName, name, entityName, options, optionalCallback); + } + } + + /** + * @summary Creates a new hybrid connection configuration (PUT), or updates an + * existing one (PATCH). + * + * Creates a new hybrid connection configuration (PUT), or updates an existing + * one (PATCH). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} entityName Name of the hybrid connection configuration. + * + * @param {object} connectionEnvelope Details of the hybrid connection + * configuration. + * + * @param {string} [connectionEnvelope.entityName] + * + * @param {string} [connectionEnvelope.entityConnectionString] + * + * @param {string} [connectionEnvelope.resourceType] + * + * @param {string} [connectionEnvelope.resourceConnectionString] + * + * @param {string} [connectionEnvelope.hostname] + * + * @param {number} [connectionEnvelope.port] + * + * @param {string} [connectionEnvelope.biztalkUri] + * + * @param {string} [connectionEnvelope.kind] Kind of resource. + * + * @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. + */ + createOrUpdateRelayServiceConnectionWithHttpOperationResponse(resourceGroupName, name, entityName, connectionEnvelope, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._createOrUpdateRelayServiceConnection(resourceGroupName, name, entityName, connectionEnvelope, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Creates a new hybrid connection configuration (PUT), or updates an + * existing one (PATCH). + * + * Creates a new hybrid connection configuration (PUT), or updates an existing + * one (PATCH). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} entityName Name of the hybrid connection configuration. + * + * @param {object} connectionEnvelope Details of the hybrid connection + * configuration. + * + * @param {string} [connectionEnvelope.entityName] + * + * @param {string} [connectionEnvelope.entityConnectionString] + * + * @param {string} [connectionEnvelope.resourceType] + * + * @param {string} [connectionEnvelope.resourceConnectionString] + * + * @param {string} [connectionEnvelope.hostname] + * + * @param {number} [connectionEnvelope.port] + * + * @param {string} [connectionEnvelope.biztalkUri] + * + * @param {string} [connectionEnvelope.kind] Kind of resource. + * + * @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 {RelayServiceConnectionEntity} - 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 RelayServiceConnectionEntity} 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. + */ + createOrUpdateRelayServiceConnection(resourceGroupName, name, entityName, connectionEnvelope, 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._createOrUpdateRelayServiceConnection(resourceGroupName, name, entityName, connectionEnvelope, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._createOrUpdateRelayServiceConnection(resourceGroupName, name, entityName, connectionEnvelope, options, optionalCallback); + } + } + + /** + * @summary Deletes a relay service connection by its name. + * + * Deletes a relay service connection by its name. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} entityName Name of the hybrid connection configuration. + * + * @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. + */ + deleteRelayServiceConnectionWithHttpOperationResponse(resourceGroupName, name, entityName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._deleteRelayServiceConnection(resourceGroupName, name, entityName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Deletes a relay service connection by its name. + * + * Deletes a relay service connection by its name. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} entityName Name of the hybrid connection configuration. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + deleteRelayServiceConnection(resourceGroupName, name, entityName, 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._deleteRelayServiceConnection(resourceGroupName, name, entityName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._deleteRelayServiceConnection(resourceGroupName, name, entityName, options, optionalCallback); + } + } + + /** + * @summary Creates a new hybrid connection configuration (PUT), or updates an + * existing one (PATCH). + * + * Creates a new hybrid connection configuration (PUT), or updates an existing + * one (PATCH). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} entityName Name of the hybrid connection configuration. + * + * @param {object} connectionEnvelope Details of the hybrid connection + * configuration. + * + * @param {string} [connectionEnvelope.entityName] + * + * @param {string} [connectionEnvelope.entityConnectionString] + * + * @param {string} [connectionEnvelope.resourceType] + * + * @param {string} [connectionEnvelope.resourceConnectionString] + * + * @param {string} [connectionEnvelope.hostname] + * + * @param {number} [connectionEnvelope.port] + * + * @param {string} [connectionEnvelope.biztalkUri] + * + * @param {string} [connectionEnvelope.kind] Kind of resource. + * + * @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. + */ + updateRelayServiceConnectionWithHttpOperationResponse(resourceGroupName, name, entityName, connectionEnvelope, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._updateRelayServiceConnection(resourceGroupName, name, entityName, connectionEnvelope, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Creates a new hybrid connection configuration (PUT), or updates an + * existing one (PATCH). + * + * Creates a new hybrid connection configuration (PUT), or updates an existing + * one (PATCH). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} entityName Name of the hybrid connection configuration. + * + * @param {object} connectionEnvelope Details of the hybrid connection + * configuration. + * + * @param {string} [connectionEnvelope.entityName] + * + * @param {string} [connectionEnvelope.entityConnectionString] + * + * @param {string} [connectionEnvelope.resourceType] + * + * @param {string} [connectionEnvelope.resourceConnectionString] + * + * @param {string} [connectionEnvelope.hostname] + * + * @param {number} [connectionEnvelope.port] + * + * @param {string} [connectionEnvelope.biztalkUri] + * + * @param {string} [connectionEnvelope.kind] Kind of resource. + * + * @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 {RelayServiceConnectionEntity} - 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 RelayServiceConnectionEntity} 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. + */ + updateRelayServiceConnection(resourceGroupName, name, entityName, connectionEnvelope, 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._updateRelayServiceConnection(resourceGroupName, name, entityName, connectionEnvelope, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._updateRelayServiceConnection(resourceGroupName, name, entityName, connectionEnvelope, options, optionalCallback); + } + } + + /** + * @summary Gets all scale-out instances of an app. + * + * Gets all scale-out instances of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @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. + */ + listInstanceIdentifiersWithHttpOperationResponse(resourceGroupName, name, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listInstanceIdentifiers(resourceGroupName, name, 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 all scale-out instances of an app. + * + * Gets all scale-out instances of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @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 {WebAppInstanceCollection} - 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 WebAppInstanceCollection} 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. + */ + listInstanceIdentifiers(resourceGroupName, name, 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._listInstanceIdentifiers(resourceGroupName, name, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listInstanceIdentifiers(resourceGroupName, name, options, optionalCallback); + } + } + + /** + * @summary Get the status of the last MSDeploy operation. + * + * Get the status of the last MSDeploy operation. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {string} instanceId ID of web app instance. + * + * @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. + */ + getInstanceMsDeployStatusWithHttpOperationResponse(resourceGroupName, name, instanceId, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._getInstanceMsDeployStatus(resourceGroupName, name, instanceId, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Get the status of the last MSDeploy operation. + * + * Get the status of the last MSDeploy operation. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {string} instanceId ID of web app instance. + * + * @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 {MSDeployStatus} - 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 MSDeployStatus} 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. + */ + getInstanceMsDeployStatus(resourceGroupName, name, instanceId, 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._getInstanceMsDeployStatus(resourceGroupName, name, instanceId, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getInstanceMsDeployStatus(resourceGroupName, name, instanceId, options, optionalCallback); + } + } + + /** + * @summary Invoke the MSDeploy web app extension. + * + * Invoke the MSDeploy web app extension. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {string} instanceId ID of web app instance. + * + * @param {object} mSDeploy Details of MSDeploy operation + * + * @param {string} [mSDeploy.packageUri] Package URI + * + * @param {string} [mSDeploy.connectionString] SQL Connection String + * + * @param {string} [mSDeploy.dbType] Database Type + * + * @param {string} [mSDeploy.setParametersXmlFileUri] URI of MSDeploy + * Parameters file. Must not be set if SetParameters is used. + * + * @param {object} [mSDeploy.setParameters] MSDeploy Parameters. Must not be + * set if SetParametersXmlFileUri is used. + * + * @param {boolean} [mSDeploy.skipAppData] Controls whether the MSDeploy + * operation skips the App_Data directory. + * If set to true, the existing App_Data directory on the + * destination + * will not be deleted, and any App_Data directory in the source will be + * ignored. + * Setting is false by default. + * + * @param {boolean} [mSDeploy.appOffline] Sets the AppOffline rule while the + * MSDeploy operation executes. + * Setting is false by default. + * + * @param {string} [mSDeploy.kind] Kind of resource. + * + * @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. + */ + createInstanceMSDeployOperationWithHttpOperationResponse(resourceGroupName, name, instanceId, mSDeploy, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._createInstanceMSDeployOperation(resourceGroupName, name, instanceId, mSDeploy, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Invoke the MSDeploy web app extension. + * + * Invoke the MSDeploy web app extension. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {string} instanceId ID of web app instance. + * + * @param {object} mSDeploy Details of MSDeploy operation + * + * @param {string} [mSDeploy.packageUri] Package URI + * + * @param {string} [mSDeploy.connectionString] SQL Connection String + * + * @param {string} [mSDeploy.dbType] Database Type + * + * @param {string} [mSDeploy.setParametersXmlFileUri] URI of MSDeploy + * Parameters file. Must not be set if SetParameters is used. + * + * @param {object} [mSDeploy.setParameters] MSDeploy Parameters. Must not be + * set if SetParametersXmlFileUri is used. + * + * @param {boolean} [mSDeploy.skipAppData] Controls whether the MSDeploy + * operation skips the App_Data directory. + * If set to true, the existing App_Data directory on the + * destination + * will not be deleted, and any App_Data directory in the source will be + * ignored. + * Setting is false by default. + * + * @param {boolean} [mSDeploy.appOffline] Sets the AppOffline rule while the + * MSDeploy operation executes. + * Setting is false by default. + * + * @param {string} [mSDeploy.kind] Kind of resource. + * + * @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 {MSDeployStatus} - 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 MSDeployStatus} 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. + */ + createInstanceMSDeployOperation(resourceGroupName, name, instanceId, mSDeploy, 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._createInstanceMSDeployOperation(resourceGroupName, name, instanceId, mSDeploy, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._createInstanceMSDeployOperation(resourceGroupName, name, instanceId, mSDeploy, options, optionalCallback); + } + } + + /** + * @summary Get the MSDeploy Log for the last MSDeploy operation. + * + * Get the MSDeploy Log for the last MSDeploy operation. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {string} instanceId ID of web app instance. + * + * @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. + */ + getInstanceMSDeployLogWithHttpOperationResponse(resourceGroupName, name, instanceId, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._getInstanceMSDeployLog(resourceGroupName, name, instanceId, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Get the MSDeploy Log for the last MSDeploy operation. + * + * Get the MSDeploy Log for the last MSDeploy operation. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {string} instanceId ID of web app instance. + * + * @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 {MSDeployLog} - 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 MSDeployLog} 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. + */ + getInstanceMSDeployLog(resourceGroupName, name, instanceId, 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._getInstanceMSDeployLog(resourceGroupName, name, instanceId, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getInstanceMSDeployLog(resourceGroupName, name, instanceId, options, optionalCallback); + } + } + + /** + * @summary Get list of processes for a web site, or a deployment slot, or for + * a specific scaled-out instance in a web site. + * + * Get list of processes for a web site, or a deployment slot, or for a + * specific scaled-out instance in a web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} instanceId ID of a specific scaled-out instance. This is the + * value of the name property in the JSON response from "GET + * api/sites/{siteName}/instances". + * + * @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. + */ + listInstanceProcessesWithHttpOperationResponse(resourceGroupName, name, instanceId, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listInstanceProcesses(resourceGroupName, name, instanceId, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Get list of processes for a web site, or a deployment slot, or for + * a specific scaled-out instance in a web site. + * + * Get list of processes for a web site, or a deployment slot, or for a + * specific scaled-out instance in a web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} instanceId ID of a specific scaled-out instance. This is the + * value of the name property in the JSON response from "GET + * api/sites/{siteName}/instances". + * + * @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 {ProcessInfoCollection} - 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 ProcessInfoCollection} 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. + */ + listInstanceProcesses(resourceGroupName, name, instanceId, 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._listInstanceProcesses(resourceGroupName, name, instanceId, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listInstanceProcesses(resourceGroupName, name, instanceId, options, optionalCallback); + } + } + + /** + * @summary Get process information by its ID for a specific scaled-out + * instance in a web site. + * + * Get process information by its ID for a specific scaled-out instance in a + * web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @param {string} instanceId ID of a specific scaled-out instance. This is the + * value of the name property in the JSON response from "GET + * api/sites/{siteName}/instances". + * + * @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. + */ + getInstanceProcessWithHttpOperationResponse(resourceGroupName, name, processId, instanceId, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._getInstanceProcess(resourceGroupName, name, processId, instanceId, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Get process information by its ID for a specific scaled-out + * instance in a web site. + * + * Get process information by its ID for a specific scaled-out instance in a + * web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @param {string} instanceId ID of a specific scaled-out instance. This is the + * value of the name property in the JSON response from "GET + * api/sites/{siteName}/instances". + * + * @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 {ProcessInfo} - 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 ProcessInfo} 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. + */ + getInstanceProcess(resourceGroupName, name, processId, instanceId, 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._getInstanceProcess(resourceGroupName, name, processId, instanceId, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getInstanceProcess(resourceGroupName, name, processId, instanceId, options, optionalCallback); + } + } + + /** + * @summary Terminate a process by its ID for a web site, or a deployment slot, + * or specific scaled-out instance in a web site. + * + * Terminate a process by its ID for a web site, or a deployment slot, or + * specific scaled-out instance in a web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @param {string} instanceId ID of a specific scaled-out instance. This is the + * value of the name property in the JSON response from "GET + * api/sites/{siteName}/instances". + * + * @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. + */ + deleteInstanceProcessWithHttpOperationResponse(resourceGroupName, name, processId, instanceId, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._deleteInstanceProcess(resourceGroupName, name, processId, instanceId, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Terminate a process by its ID for a web site, or a deployment slot, + * or specific scaled-out instance in a web site. + * + * Terminate a process by its ID for a web site, or a deployment slot, or + * specific scaled-out instance in a web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @param {string} instanceId ID of a specific scaled-out instance. This is the + * value of the name property in the JSON response from "GET + * api/sites/{siteName}/instances". + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + deleteInstanceProcess(resourceGroupName, name, processId, instanceId, 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._deleteInstanceProcess(resourceGroupName, name, processId, instanceId, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._deleteInstanceProcess(resourceGroupName, name, processId, instanceId, options, optionalCallback); + } + } + + /** + * @summary Get a memory dump of a process by its ID for a specific scaled-out + * instance in a web site. + * + * Get a memory dump of a process by its ID for a specific scaled-out instance + * in a web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @param {string} instanceId ID of a specific scaled-out instance. This is the + * value of the name property in the JSON response from "GET + * api/sites/{siteName}/instances". + * + * @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. + */ + getInstanceProcessDumpWithHttpOperationResponse(resourceGroupName, name, processId, instanceId, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._getInstanceProcessDump(resourceGroupName, name, processId, instanceId, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Get a memory dump of a process by its ID for a specific scaled-out + * instance in a web site. + * + * Get a memory dump of a process by its ID for a specific scaled-out instance + * in a web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @param {string} instanceId ID of a specific scaled-out instance. This is the + * value of the name property in the JSON response from "GET + * api/sites/{siteName}/instances". + * + * @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 {Object} - 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. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + getInstanceProcessDump(resourceGroupName, name, processId, instanceId, 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._getInstanceProcessDump(resourceGroupName, name, processId, instanceId, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getInstanceProcessDump(resourceGroupName, name, processId, instanceId, options, optionalCallback); + } + } + + /** + * @summary List module information for a process by its ID for a specific + * scaled-out instance in a web site. + * + * List module information for a process by its ID for a specific scaled-out + * instance in a web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @param {string} instanceId ID of a specific scaled-out instance. This is the + * value of the name property in the JSON response from "GET + * api/sites/{siteName}/instances". + * + * @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. + */ + listInstanceProcessModulesWithHttpOperationResponse(resourceGroupName, name, processId, instanceId, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listInstanceProcessModules(resourceGroupName, name, processId, instanceId, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary List module information for a process by its ID for a specific + * scaled-out instance in a web site. + * + * List module information for a process by its ID for a specific scaled-out + * instance in a web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @param {string} instanceId ID of a specific scaled-out instance. This is the + * value of the name property in the JSON response from "GET + * api/sites/{siteName}/instances". + * + * @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 {ProcessModuleInfoCollection} - 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 ProcessModuleInfoCollection} 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. + */ + listInstanceProcessModules(resourceGroupName, name, processId, instanceId, 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._listInstanceProcessModules(resourceGroupName, name, processId, instanceId, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listInstanceProcessModules(resourceGroupName, name, processId, instanceId, options, optionalCallback); + } + } + + /** + * @summary Get process information by its ID for a specific scaled-out + * instance in a web site. + * + * Get process information by its ID for a specific scaled-out instance in a + * web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @param {string} baseAddress Module base address. + * + * @param {string} instanceId ID of a specific scaled-out instance. This is the + * value of the name property in the JSON response from "GET + * api/sites/{siteName}/instances". + * + * @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. + */ + getInstanceProcessModuleWithHttpOperationResponse(resourceGroupName, name, processId, baseAddress, instanceId, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._getInstanceProcessModule(resourceGroupName, name, processId, baseAddress, instanceId, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Get process information by its ID for a specific scaled-out + * instance in a web site. + * + * Get process information by its ID for a specific scaled-out instance in a + * web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @param {string} baseAddress Module base address. + * + * @param {string} instanceId ID of a specific scaled-out instance. This is the + * value of the name property in the JSON response from "GET + * api/sites/{siteName}/instances". + * + * @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 {ProcessModuleInfo} - 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 ProcessModuleInfo} 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. + */ + getInstanceProcessModule(resourceGroupName, name, processId, baseAddress, instanceId, 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._getInstanceProcessModule(resourceGroupName, name, processId, baseAddress, instanceId, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getInstanceProcessModule(resourceGroupName, name, processId, baseAddress, instanceId, options, optionalCallback); + } + } + + /** + * @summary List the threads in a process by its ID for a specific scaled-out + * instance in a web site. + * + * List the threads in a process by its ID for a specific scaled-out instance + * in a web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @param {string} instanceId ID of a specific scaled-out instance. This is the + * value of the name property in the JSON response from "GET + * api/sites/{siteName}/instances". + * + * @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. + */ + listInstanceProcessThreadsWithHttpOperationResponse(resourceGroupName, name, processId, instanceId, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listInstanceProcessThreads(resourceGroupName, name, processId, instanceId, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary List the threads in a process by its ID for a specific scaled-out + * instance in a web site. + * + * List the threads in a process by its ID for a specific scaled-out instance + * in a web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @param {string} instanceId ID of a specific scaled-out instance. This is the + * value of the name property in the JSON response from "GET + * api/sites/{siteName}/instances". + * + * @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 {ProcessThreadInfoCollection} - 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 ProcessThreadInfoCollection} 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. + */ + listInstanceProcessThreads(resourceGroupName, name, processId, instanceId, 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._listInstanceProcessThreads(resourceGroupName, name, processId, instanceId, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listInstanceProcessThreads(resourceGroupName, name, processId, instanceId, options, optionalCallback); + } + } + + /** + * @summary Get thread information by Thread ID for a specific process, in a + * specific scaled-out instance in a web site. + * + * Get thread information by Thread ID for a specific process, in a specific + * scaled-out instance in a web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @param {string} threadId TID. + * + * @param {string} instanceId ID of a specific scaled-out instance. This is the + * value of the name property in the JSON response from "GET + * api/sites/{siteName}/instances". + * + * @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. + */ + getInstanceProcessThreadWithHttpOperationResponse(resourceGroupName, name, processId, threadId, instanceId, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._getInstanceProcessThread(resourceGroupName, name, processId, threadId, instanceId, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Get thread information by Thread ID for a specific process, in a + * specific scaled-out instance in a web site. + * + * Get thread information by Thread ID for a specific process, in a specific + * scaled-out instance in a web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @param {string} threadId TID. + * + * @param {string} instanceId ID of a specific scaled-out instance. This is the + * value of the name property in the JSON response from "GET + * api/sites/{siteName}/instances". + * + * @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 {ProcessThreadInfo} - 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 ProcessThreadInfo} 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. + */ + getInstanceProcessThread(resourceGroupName, name, processId, threadId, instanceId, 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._getInstanceProcessThread(resourceGroupName, name, processId, threadId, instanceId, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getInstanceProcessThread(resourceGroupName, name, processId, threadId, instanceId, options, optionalCallback); + } + } + + /** + * @summary Shows whether an app can be cloned to another resource group or + * subscription. + * + * Shows whether an app can be cloned to another resource group or + * subscription. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @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. + */ + isCloneableWithHttpOperationResponse(resourceGroupName, name, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._isCloneable(resourceGroupName, name, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Shows whether an app can be cloned to another resource group or + * subscription. + * + * Shows whether an app can be cloned to another resource group or + * subscription. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @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 {SiteCloneability} - 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 SiteCloneability} 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. + */ + isCloneable(resourceGroupName, name, 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._isCloneable(resourceGroupName, name, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._isCloneable(resourceGroupName, name, options, optionalCallback); + } + } + + /** + * @summary This is to allow calling via powershell and ARM template. + * + * This is to allow calling via powershell and ARM template. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @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. + */ + listSyncFunctionTriggersWithHttpOperationResponse(resourceGroupName, name, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listSyncFunctionTriggers(resourceGroupName, name, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary This is to allow calling via powershell and ARM template. + * + * This is to allow calling via powershell and ARM template. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @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 {FunctionSecrets} - 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 FunctionSecrets} 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. + */ + listSyncFunctionTriggers(resourceGroupName, name, 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._listSyncFunctionTriggers(resourceGroupName, name, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listSyncFunctionTriggers(resourceGroupName, name, options, optionalCallback); + } + } + + /** + * @summary Gets all metric definitions of an app (or deployment slot, if + * specified). + * + * Gets all metric definitions of an app (or deployment slot, if specified). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @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. + */ + listMetricDefinitionsWithHttpOperationResponse(resourceGroupName, name, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listMetricDefinitions(resourceGroupName, name, 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 all metric definitions of an app (or deployment slot, if + * specified). + * + * Gets all metric definitions of an app (or deployment slot, if specified). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @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 {ResourceMetricDefinitionCollection} - 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 ResourceMetricDefinitionCollection} 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. + */ + listMetricDefinitions(resourceGroupName, name, 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._listMetricDefinitions(resourceGroupName, name, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listMetricDefinitions(resourceGroupName, name, options, optionalCallback); + } + } + + /** + * @summary Gets performance metrics of an app (or deployment slot, if + * specified). + * + * Gets performance metrics of an app (or deployment slot, if specified). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} [options] Optional Parameters. + * + * @param {boolean} [options.details] Specify "true" to include metric details + * in the response. It is "false" by default. + * + * @param {string} [options.filter] Return only metrics specified in the filter + * (using OData syntax). For example: $filter=(name.value eq 'Metric1' or + * name.value eq 'Metric2') and startTime eq 2014-01-01T00:00:00Z and endTime + * eq 2014-12-31T23:59:59Z and timeGrain eq duration'[Hour|Minute|Day]'. + * + * @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. + */ + listMetricsWithHttpOperationResponse(resourceGroupName, name, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listMetrics(resourceGroupName, name, 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 performance metrics of an app (or deployment slot, if + * specified). + * + * Gets performance metrics of an app (or deployment slot, if specified). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} [options] Optional Parameters. + * + * @param {boolean} [options.details] Specify "true" to include metric details + * in the response. It is "false" by default. + * + * @param {string} [options.filter] Return only metrics specified in the filter + * (using OData syntax). For example: $filter=(name.value eq 'Metric1' or + * name.value eq 'Metric2') and startTime eq 2014-01-01T00:00:00Z and endTime + * eq 2014-12-31T23:59:59Z and timeGrain eq duration'[Hour|Minute|Day]'. + * + * @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 {ResourceMetricCollection} - 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 ResourceMetricCollection} 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. + */ + listMetrics(resourceGroupName, name, 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._listMetrics(resourceGroupName, name, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listMetrics(resourceGroupName, name, options, optionalCallback); + } + } + + /** + * @summary Restores a web app. + * + * Restores a web app. + * + * @param {string} subscriptionName Azure subscription. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {object} migrationOptions Migration migrationOptions. + * + * @param {string} migrationOptions.azurefilesConnectionString AzureFiles + * connection string. + * + * @param {string} migrationOptions.azurefilesShare AzureFiles share. + * + * @param {boolean} [migrationOptions.switchSiteAfterMigration] + * trueif the app should be switched over; otherwise, + * false. + * + * @param {boolean} [migrationOptions.blockWriteAccessToSite] true + * if the app should be read only during copy operation; otherwise, + * false. + * + * @param {string} [migrationOptions.kind] Kind of resource. + * + * @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. + */ + migrateStorageWithHttpOperationResponse(subscriptionName, resourceGroupName, name, migrationOptions, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._migrateStorage(subscriptionName, resourceGroupName, name, migrationOptions, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Restores a web app. + * + * Restores a web app. + * + * @param {string} subscriptionName Azure subscription. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {object} migrationOptions Migration migrationOptions. + * + * @param {string} migrationOptions.azurefilesConnectionString AzureFiles + * connection string. + * + * @param {string} migrationOptions.azurefilesShare AzureFiles share. + * + * @param {boolean} [migrationOptions.switchSiteAfterMigration] + * trueif the app should be switched over; otherwise, + * false. + * + * @param {boolean} [migrationOptions.blockWriteAccessToSite] true + * if the app should be read only during copy operation; otherwise, + * false. + * + * @param {string} [migrationOptions.kind] Kind of resource. + * + * @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 {StorageMigrationResponse} - 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 StorageMigrationResponse} 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. + */ + migrateStorage(subscriptionName, resourceGroupName, name, migrationOptions, 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._migrateStorage(subscriptionName, resourceGroupName, name, migrationOptions, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._migrateStorage(subscriptionName, resourceGroupName, name, migrationOptions, options, optionalCallback); + } + } + + /** + * @summary Migrates a local (in-app) MySql database to a remote MySql + * database. + * + * Migrates a local (in-app) MySql database to a remote MySql database. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {object} migrationRequestEnvelope MySql migration options. + * + * @param {string} migrationRequestEnvelope.connectionString Connection string + * to the remote MySQL database. + * + * @param {string} migrationRequestEnvelope.migrationType The type of migration + * operation to be done. Possible values include: 'LocalToRemote', + * 'RemoteToLocal' + * + * @param {string} [migrationRequestEnvelope.kind] Kind of resource. + * + * @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. + */ + migrateMySqlWithHttpOperationResponse(resourceGroupName, name, migrationRequestEnvelope, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._migrateMySql(resourceGroupName, name, migrationRequestEnvelope, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Migrates a local (in-app) MySql database to a remote MySql + * database. + * + * Migrates a local (in-app) MySql database to a remote MySql database. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {object} migrationRequestEnvelope MySql migration options. + * + * @param {string} migrationRequestEnvelope.connectionString Connection string + * to the remote MySQL database. + * + * @param {string} migrationRequestEnvelope.migrationType The type of migration + * operation to be done. Possible values include: 'LocalToRemote', + * 'RemoteToLocal' + * + * @param {string} [migrationRequestEnvelope.kind] Kind of resource. + * + * @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 {Operation} - 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 Operation} 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. + */ + migrateMySql(resourceGroupName, name, migrationRequestEnvelope, 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._migrateMySql(resourceGroupName, name, migrationRequestEnvelope, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._migrateMySql(resourceGroupName, name, migrationRequestEnvelope, options, optionalCallback); + } + } + + /** + * @summary Returns the status of MySql in app migration, if one is active, and + * whether or not MySql in app is enabled + * + * Returns the status of MySql in app migration, if one is active, and whether + * or not MySql in app is enabled + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @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. + */ + getMigrateMySqlStatusWithHttpOperationResponse(resourceGroupName, name, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._getMigrateMySqlStatus(resourceGroupName, name, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Returns the status of MySql in app migration, if one is active, and + * whether or not MySql in app is enabled + * + * Returns the status of MySql in app migration, if one is active, and whether + * or not MySql in app is enabled + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @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 {MigrateMySqlStatus} - 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 MigrateMySqlStatus} 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. + */ + getMigrateMySqlStatus(resourceGroupName, name, 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._getMigrateMySqlStatus(resourceGroupName, name, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getMigrateMySqlStatus(resourceGroupName, name, options, optionalCallback); + } + } + + /** + * @summary Gets all network features used by the app (or deployment slot, if + * specified). + * + * Gets all network features used by the app (or deployment slot, if + * specified). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} view The type of view. This can either be "summary" or + * "detailed". + * + * @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. + */ + listNetworkFeaturesWithHttpOperationResponse(resourceGroupName, name, view, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listNetworkFeatures(resourceGroupName, name, view, 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 all network features used by the app (or deployment slot, if + * specified). + * + * Gets all network features used by the app (or deployment slot, if + * specified). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} view The type of view. This can either be "summary" or + * "detailed". + * + * @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 {NetworkFeatures} - 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 NetworkFeatures} 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. + */ + listNetworkFeatures(resourceGroupName, name, view, 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._listNetworkFeatures(resourceGroupName, name, view, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listNetworkFeatures(resourceGroupName, name, view, options, optionalCallback); + } + } + + /** + * @summary Start capturing network packets for the site. + * + * Start capturing network packets for the site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.durationInSeconds] The duration to keep capturing + * in seconds. + * + * @param {number} [options.maxFrameLength] The maximum frame length in bytes + * (Optional). + * + * @param {string} [options.sasUrl] The Blob URL to store capture file. + * + * @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. + */ + startWebSiteNetworkTraceWithHttpOperationResponse(resourceGroupName, name, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._startWebSiteNetworkTrace(resourceGroupName, name, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Start capturing network packets for the site. + * + * Start capturing network packets for the site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.durationInSeconds] The duration to keep capturing + * in seconds. + * + * @param {number} [options.maxFrameLength] The maximum frame length in bytes + * (Optional). + * + * @param {string} [options.sasUrl] The Blob URL to store capture file. + * + * @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 {String} - 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. + * + * {string} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + startWebSiteNetworkTrace(resourceGroupName, name, 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._startWebSiteNetworkTrace(resourceGroupName, name, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._startWebSiteNetworkTrace(resourceGroupName, name, options, optionalCallback); + } + } + + /** + * @summary Stop ongoing capturing network packets for the site. + * + * Stop ongoing capturing network packets for the site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @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. + */ + stopWebSiteNetworkTraceWithHttpOperationResponse(resourceGroupName, name, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._stopWebSiteNetworkTrace(resourceGroupName, name, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Stop ongoing capturing network packets for the site. + * + * Stop ongoing capturing network packets for the site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @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 {String} - 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. + * + * {string} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + stopWebSiteNetworkTrace(resourceGroupName, name, 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._stopWebSiteNetworkTrace(resourceGroupName, name, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._stopWebSiteNetworkTrace(resourceGroupName, name, options, optionalCallback); + } + } + + /** + * @summary Generates a new publishing password for an app (or deployment slot, + * if specified). + * + * Generates a new publishing password for an app (or deployment slot, if + * specified). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @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. + */ + generateNewSitePublishingPasswordWithHttpOperationResponse(resourceGroupName, name, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._generateNewSitePublishingPassword(resourceGroupName, name, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Generates a new publishing password for an app (or deployment slot, + * if specified). + * + * Generates a new publishing password for an app (or deployment slot, if + * specified). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + generateNewSitePublishingPassword(resourceGroupName, name, 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._generateNewSitePublishingPassword(resourceGroupName, name, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._generateNewSitePublishingPassword(resourceGroupName, name, options, optionalCallback); + } + } + + /** + * @summary Gets perfmon counters for web app. + * + * Gets perfmon counters for web app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.filter] Return only usages/metrics specified in the + * filter. Filter conforms to odata syntax. Example: $filter=(startTime eq + * 2014-01-01T00:00:00Z and endTime eq 2014-12-31T23:59:59Z and timeGrain eq + * duration'[Hour|Minute|Day]'. + * + * @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. + */ + listPerfMonCountersWithHttpOperationResponse(resourceGroupName, name, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listPerfMonCounters(resourceGroupName, name, 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 perfmon counters for web app. + * + * Gets perfmon counters for web app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.filter] Return only usages/metrics specified in the + * filter. Filter conforms to odata syntax. Example: $filter=(startTime eq + * 2014-01-01T00:00:00Z and endTime eq 2014-12-31T23:59:59Z and timeGrain eq + * duration'[Hour|Minute|Day]'. + * + * @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 {PerfMonCounterCollection} - 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 PerfMonCounterCollection} 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. + */ + listPerfMonCounters(resourceGroupName, name, 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._listPerfMonCounters(resourceGroupName, name, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listPerfMonCounters(resourceGroupName, name, options, optionalCallback); + } + } + + /** + * @summary Gets web app's event logs. + * + * Gets web app's event logs. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @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. + */ + getSitePhpErrorLogFlagWithHttpOperationResponse(resourceGroupName, name, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._getSitePhpErrorLogFlag(resourceGroupName, name, 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 web app's event logs. + * + * Gets web app's event logs. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @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 {SitePhpErrorLogFlag} - 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 SitePhpErrorLogFlag} 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. + */ + getSitePhpErrorLogFlag(resourceGroupName, name, 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._getSitePhpErrorLogFlag(resourceGroupName, name, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getSitePhpErrorLogFlag(resourceGroupName, name, options, optionalCallback); + } + } + + /** + * @summary Gets the premier add-ons of an app. + * + * Gets the premier add-ons of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @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. + */ + listPremierAddOnsWithHttpOperationResponse(resourceGroupName, name, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listPremierAddOns(resourceGroupName, name, 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 the premier add-ons of an app. + * + * Gets the premier add-ons of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @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 {PremierAddOn} - 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 PremierAddOn} 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. + */ + listPremierAddOns(resourceGroupName, name, 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._listPremierAddOns(resourceGroupName, name, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listPremierAddOns(resourceGroupName, name, options, optionalCallback); + } + } + + /** + * @summary Gets a named add-on of an app. + * + * Gets a named add-on of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} premierAddOnName Add-on name. + * + * @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. + */ + getPremierAddOnWithHttpOperationResponse(resourceGroupName, name, premierAddOnName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._getPremierAddOn(resourceGroupName, name, premierAddOnName, 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 named add-on of an app. + * + * Gets a named add-on of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} premierAddOnName Add-on name. + * + * @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 {PremierAddOn} - 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 PremierAddOn} 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. + */ + getPremierAddOn(resourceGroupName, name, premierAddOnName, 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._getPremierAddOn(resourceGroupName, name, premierAddOnName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getPremierAddOn(resourceGroupName, name, premierAddOnName, options, optionalCallback); + } + } + + /** + * @summary Updates a named add-on of an app. + * + * Updates a named add-on of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} premierAddOnName Add-on name. + * + * @param {object} premierAddOn A JSON representation of the edited premier + * add-on. + * + * @param {string} [premierAddOn.sku] Premier add on SKU. + * + * @param {string} [premierAddOn.product] Premier add on Product. + * + * @param {string} [premierAddOn.vendor] Premier add on Vendor. + * + * @param {string} [premierAddOn.marketplacePublisher] Premier add on + * Marketplace publisher. + * + * @param {string} [premierAddOn.marketplaceOffer] Premier add on Marketplace + * offer. + * + * @param {string} [premierAddOn.kind] Kind of resource. + * + * @param {string} premierAddOn.location Resource Location. + * + * @param {object} [premierAddOn.tags] Resource tags. + * + * @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. + */ + addPremierAddOnWithHttpOperationResponse(resourceGroupName, name, premierAddOnName, premierAddOn, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._addPremierAddOn(resourceGroupName, name, premierAddOnName, premierAddOn, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Updates a named add-on of an app. + * + * Updates a named add-on of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} premierAddOnName Add-on name. + * + * @param {object} premierAddOn A JSON representation of the edited premier + * add-on. + * + * @param {string} [premierAddOn.sku] Premier add on SKU. + * + * @param {string} [premierAddOn.product] Premier add on Product. + * + * @param {string} [premierAddOn.vendor] Premier add on Vendor. + * + * @param {string} [premierAddOn.marketplacePublisher] Premier add on + * Marketplace publisher. + * + * @param {string} [premierAddOn.marketplaceOffer] Premier add on Marketplace + * offer. + * + * @param {string} [premierAddOn.kind] Kind of resource. + * + * @param {string} premierAddOn.location Resource Location. + * + * @param {object} [premierAddOn.tags] Resource tags. + * + * @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 {PremierAddOn} - 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 PremierAddOn} 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. + */ + addPremierAddOn(resourceGroupName, name, premierAddOnName, premierAddOn, 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._addPremierAddOn(resourceGroupName, name, premierAddOnName, premierAddOn, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._addPremierAddOn(resourceGroupName, name, premierAddOnName, premierAddOn, options, optionalCallback); + } + } + + /** + * @summary Delete a premier add-on from an app. + * + * Delete a premier add-on from an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} premierAddOnName Add-on name. + * + * @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. + */ + deletePremierAddOnWithHttpOperationResponse(resourceGroupName, name, premierAddOnName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._deletePremierAddOn(resourceGroupName, name, premierAddOnName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Delete a premier add-on from an app. + * + * Delete a premier add-on from an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} premierAddOnName Add-on name. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + deletePremierAddOn(resourceGroupName, name, premierAddOnName, 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._deletePremierAddOn(resourceGroupName, name, premierAddOnName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._deletePremierAddOn(resourceGroupName, name, premierAddOnName, options, optionalCallback); + } + } + + /** + * @summary Updates a named add-on of an app. + * + * Updates a named add-on of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} premierAddOnName Add-on name. + * + * @param {object} premierAddOn A JSON representation of the edited premier + * add-on. + * + * @param {string} [premierAddOn.sku] Premier add on SKU. + * + * @param {string} [premierAddOn.product] Premier add on Product. + * + * @param {string} [premierAddOn.vendor] Premier add on Vendor. + * + * @param {string} [premierAddOn.marketplacePublisher] Premier add on + * Marketplace publisher. + * + * @param {string} [premierAddOn.marketplaceOffer] Premier add on Marketplace + * offer. + * + * @param {string} [premierAddOn.kind] Kind of resource. + * + * @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. + */ + updatePremierAddOnWithHttpOperationResponse(resourceGroupName, name, premierAddOnName, premierAddOn, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._updatePremierAddOn(resourceGroupName, name, premierAddOnName, premierAddOn, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Updates a named add-on of an app. + * + * Updates a named add-on of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} premierAddOnName Add-on name. + * + * @param {object} premierAddOn A JSON representation of the edited premier + * add-on. + * + * @param {string} [premierAddOn.sku] Premier add on SKU. + * + * @param {string} [premierAddOn.product] Premier add on Product. + * + * @param {string} [premierAddOn.vendor] Premier add on Vendor. + * + * @param {string} [premierAddOn.marketplacePublisher] Premier add on + * Marketplace publisher. + * + * @param {string} [premierAddOn.marketplaceOffer] Premier add on Marketplace + * offer. + * + * @param {string} [premierAddOn.kind] Kind of resource. + * + * @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 {PremierAddOn} - 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 PremierAddOn} 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. + */ + updatePremierAddOn(resourceGroupName, name, premierAddOnName, premierAddOn, 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._updatePremierAddOn(resourceGroupName, name, premierAddOnName, premierAddOn, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._updatePremierAddOn(resourceGroupName, name, premierAddOnName, premierAddOn, options, optionalCallback); + } + } + + /** + * @summary Gets data around private site access enablement and authorized + * Virtual Networks that can access the site. + * + * Gets data around private site access enablement and authorized Virtual + * Networks that can access the site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @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. + */ + getPrivateAccessWithHttpOperationResponse(resourceGroupName, name, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._getPrivateAccess(resourceGroupName, name, 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 data around private site access enablement and authorized + * Virtual Networks that can access the site. + * + * Gets data around private site access enablement and authorized Virtual + * Networks that can access the site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @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 {PrivateAccess} - 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 PrivateAccess} 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. + */ + getPrivateAccess(resourceGroupName, name, 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._getPrivateAccess(resourceGroupName, name, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getPrivateAccess(resourceGroupName, name, options, optionalCallback); + } + } + + /** + * @summary Sets data around private site access enablement and authorized + * Virtual Networks that can access the site. + * + * Sets data around private site access enablement and authorized Virtual + * Networks that can access the site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @param {object} access The information for the private access + * + * @param {boolean} [access.enabled] Whether private access is enabled or not. + * + * @param {array} [access.virtualNetworks] The Virtual Networks (and subnets) + * allowed to access the site privately. + * + * @param {string} [access.kind] Kind of resource. + * + * @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. + */ + putPrivateAccessVnetWithHttpOperationResponse(resourceGroupName, name, access, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._putPrivateAccessVnet(resourceGroupName, name, access, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Sets data around private site access enablement and authorized + * Virtual Networks that can access the site. + * + * Sets data around private site access enablement and authorized Virtual + * Networks that can access the site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @param {object} access The information for the private access + * + * @param {boolean} [access.enabled] Whether private access is enabled or not. + * + * @param {array} [access.virtualNetworks] The Virtual Networks (and subnets) + * allowed to access the site privately. + * + * @param {string} [access.kind] Kind of resource. + * + * @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 {PrivateAccess} - 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 PrivateAccess} 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. + */ + putPrivateAccessVnet(resourceGroupName, name, access, 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._putPrivateAccessVnet(resourceGroupName, name, access, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._putPrivateAccessVnet(resourceGroupName, name, access, options, optionalCallback); + } + } + + /** + * @summary Get list of processes for a web site, or a deployment slot, or for + * a specific scaled-out instance in a web site. + * + * Get list of processes for a web site, or a deployment slot, or for a + * specific scaled-out instance in a web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @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. + */ + listProcessesWithHttpOperationResponse(resourceGroupName, name, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listProcesses(resourceGroupName, name, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Get list of processes for a web site, or a deployment slot, or for + * a specific scaled-out instance in a web site. + * + * Get list of processes for a web site, or a deployment slot, or for a + * specific scaled-out instance in a web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @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 {ProcessInfoCollection} - 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 ProcessInfoCollection} 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. + */ + listProcesses(resourceGroupName, name, 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._listProcesses(resourceGroupName, name, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listProcesses(resourceGroupName, name, options, optionalCallback); + } + } + + /** + * @summary Get process information by its ID for a specific scaled-out + * instance in a web site. + * + * Get process information by its ID for a specific scaled-out instance in a + * web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @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. + */ + getProcessWithHttpOperationResponse(resourceGroupName, name, processId, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._getProcess(resourceGroupName, name, processId, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Get process information by its ID for a specific scaled-out + * instance in a web site. + * + * Get process information by its ID for a specific scaled-out instance in a + * web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @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 {ProcessInfo} - 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 ProcessInfo} 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. + */ + getProcess(resourceGroupName, name, processId, 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._getProcess(resourceGroupName, name, processId, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getProcess(resourceGroupName, name, processId, options, optionalCallback); + } + } + + /** + * @summary Terminate a process by its ID for a web site, or a deployment slot, + * or specific scaled-out instance in a web site. + * + * Terminate a process by its ID for a web site, or a deployment slot, or + * specific scaled-out instance in a web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @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. + */ + deleteProcessWithHttpOperationResponse(resourceGroupName, name, processId, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._deleteProcess(resourceGroupName, name, processId, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Terminate a process by its ID for a web site, or a deployment slot, + * or specific scaled-out instance in a web site. + * + * Terminate a process by its ID for a web site, or a deployment slot, or + * specific scaled-out instance in a web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + deleteProcess(resourceGroupName, name, processId, 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._deleteProcess(resourceGroupName, name, processId, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._deleteProcess(resourceGroupName, name, processId, options, optionalCallback); + } + } + + /** + * @summary Get a memory dump of a process by its ID for a specific scaled-out + * instance in a web site. + * + * Get a memory dump of a process by its ID for a specific scaled-out instance + * in a web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @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. + */ + getProcessDumpWithHttpOperationResponse(resourceGroupName, name, processId, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._getProcessDump(resourceGroupName, name, processId, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Get a memory dump of a process by its ID for a specific scaled-out + * instance in a web site. + * + * Get a memory dump of a process by its ID for a specific scaled-out instance + * in a web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @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 {Object} - 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. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + getProcessDump(resourceGroupName, name, processId, 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._getProcessDump(resourceGroupName, name, processId, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getProcessDump(resourceGroupName, name, processId, options, optionalCallback); + } + } + + /** + * @summary List module information for a process by its ID for a specific + * scaled-out instance in a web site. + * + * List module information for a process by its ID for a specific scaled-out + * instance in a web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @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. + */ + listProcessModulesWithHttpOperationResponse(resourceGroupName, name, processId, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listProcessModules(resourceGroupName, name, processId, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary List module information for a process by its ID for a specific + * scaled-out instance in a web site. + * + * List module information for a process by its ID for a specific scaled-out + * instance in a web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @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 {ProcessModuleInfoCollection} - 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 ProcessModuleInfoCollection} 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. + */ + listProcessModules(resourceGroupName, name, processId, 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._listProcessModules(resourceGroupName, name, processId, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listProcessModules(resourceGroupName, name, processId, options, optionalCallback); + } + } + + /** + * @summary Get process information by its ID for a specific scaled-out + * instance in a web site. + * + * Get process information by its ID for a specific scaled-out instance in a + * web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @param {string} baseAddress Module base address. + * + * @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. + */ + getProcessModuleWithHttpOperationResponse(resourceGroupName, name, processId, baseAddress, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._getProcessModule(resourceGroupName, name, processId, baseAddress, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Get process information by its ID for a specific scaled-out + * instance in a web site. + * + * Get process information by its ID for a specific scaled-out instance in a + * web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @param {string} baseAddress Module base address. + * + * @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 {ProcessModuleInfo} - 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 ProcessModuleInfo} 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. + */ + getProcessModule(resourceGroupName, name, processId, baseAddress, 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._getProcessModule(resourceGroupName, name, processId, baseAddress, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getProcessModule(resourceGroupName, name, processId, baseAddress, options, optionalCallback); + } + } + + /** + * @summary List the threads in a process by its ID for a specific scaled-out + * instance in a web site. + * + * List the threads in a process by its ID for a specific scaled-out instance + * in a web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @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. + */ + listProcessThreadsWithHttpOperationResponse(resourceGroupName, name, processId, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listProcessThreads(resourceGroupName, name, processId, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary List the threads in a process by its ID for a specific scaled-out + * instance in a web site. + * + * List the threads in a process by its ID for a specific scaled-out instance + * in a web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @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 {ProcessThreadInfoCollection} - 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 ProcessThreadInfoCollection} 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. + */ + listProcessThreads(resourceGroupName, name, processId, 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._listProcessThreads(resourceGroupName, name, processId, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listProcessThreads(resourceGroupName, name, processId, options, optionalCallback); + } + } + + /** + * @summary Get thread information by Thread ID for a specific process, in a + * specific scaled-out instance in a web site. + * + * Get thread information by Thread ID for a specific process, in a specific + * scaled-out instance in a web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @param {string} threadId TID. + * + * @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. + */ + getProcessThreadWithHttpOperationResponse(resourceGroupName, name, processId, threadId, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._getProcessThread(resourceGroupName, name, processId, threadId, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Get thread information by Thread ID for a specific process, in a + * specific scaled-out instance in a web site. + * + * Get thread information by Thread ID for a specific process, in a specific + * scaled-out instance in a web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @param {string} threadId TID. + * + * @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 {ProcessThreadInfo} - 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 ProcessThreadInfo} 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. + */ + getProcessThread(resourceGroupName, name, processId, threadId, 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._getProcessThread(resourceGroupName, name, processId, threadId, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getProcessThread(resourceGroupName, name, processId, threadId, options, optionalCallback); + } + } + + /** + * @summary Get public certificates for an app or a deployment slot. + * + * Get public certificates for an app or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @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. + */ + listPublicCertificatesWithHttpOperationResponse(resourceGroupName, name, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listPublicCertificates(resourceGroupName, name, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Get public certificates for an app or a deployment slot. + * + * Get public certificates for an app or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @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 {PublicCertificateCollection} - 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 PublicCertificateCollection} 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. + */ + listPublicCertificates(resourceGroupName, name, 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._listPublicCertificates(resourceGroupName, name, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listPublicCertificates(resourceGroupName, name, options, optionalCallback); + } + } + + /** + * @summary Get the named public certificate for an app (or deployment slot, if + * specified). + * + * Get the named public certificate for an app (or deployment slot, if + * specified). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} publicCertificateName Public certificate name. + * + * @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. + */ + getPublicCertificateWithHttpOperationResponse(resourceGroupName, name, publicCertificateName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._getPublicCertificate(resourceGroupName, name, publicCertificateName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Get the named public certificate for an app (or deployment slot, if + * specified). + * + * Get the named public certificate for an app (or deployment slot, if + * specified). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} publicCertificateName Public certificate name. + * + * @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 {PublicCertificate} - 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 PublicCertificate} 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. + */ + getPublicCertificate(resourceGroupName, name, publicCertificateName, 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._getPublicCertificate(resourceGroupName, name, publicCertificateName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getPublicCertificate(resourceGroupName, name, publicCertificateName, options, optionalCallback); + } + } + + /** + * @summary Creates a hostname binding for an app. + * + * Creates a hostname binding for an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} publicCertificateName Public certificate name. + * + * @param {object} publicCertificate Public certificate details. This is the + * JSON representation of a PublicCertificate object. + * + * @param {buffer} [publicCertificate.blob] Public Certificate byte array + * + * @param {string} [publicCertificate.publicCertificateLocation] Public + * Certificate Location. Possible values include: 'CurrentUserMy', + * 'LocalMachineMy', 'Unknown' + * + * @param {string} [publicCertificate.kind] Kind of resource. + * + * @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. + */ + createOrUpdatePublicCertificateWithHttpOperationResponse(resourceGroupName, name, publicCertificateName, publicCertificate, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._createOrUpdatePublicCertificate(resourceGroupName, name, publicCertificateName, publicCertificate, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Creates a hostname binding for an app. + * + * Creates a hostname binding for an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} publicCertificateName Public certificate name. + * + * @param {object} publicCertificate Public certificate details. This is the + * JSON representation of a PublicCertificate object. + * + * @param {buffer} [publicCertificate.blob] Public Certificate byte array + * + * @param {string} [publicCertificate.publicCertificateLocation] Public + * Certificate Location. Possible values include: 'CurrentUserMy', + * 'LocalMachineMy', 'Unknown' + * + * @param {string} [publicCertificate.kind] Kind of resource. + * + * @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 {PublicCertificate} - 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 PublicCertificate} 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. + */ + createOrUpdatePublicCertificate(resourceGroupName, name, publicCertificateName, publicCertificate, 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._createOrUpdatePublicCertificate(resourceGroupName, name, publicCertificateName, publicCertificate, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._createOrUpdatePublicCertificate(resourceGroupName, name, publicCertificateName, publicCertificate, options, optionalCallback); + } + } + + /** + * @summary Deletes a hostname binding for an app. + * + * Deletes a hostname binding for an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} publicCertificateName Public certificate name. + * + * @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. + */ + deletePublicCertificateWithHttpOperationResponse(resourceGroupName, name, publicCertificateName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._deletePublicCertificate(resourceGroupName, name, publicCertificateName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Deletes a hostname binding for an app. + * + * Deletes a hostname binding for an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} publicCertificateName Public certificate name. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + deletePublicCertificate(resourceGroupName, name, publicCertificateName, 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._deletePublicCertificate(resourceGroupName, name, publicCertificateName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._deletePublicCertificate(resourceGroupName, name, publicCertificateName, options, optionalCallback); + } + } + + /** + * @summary Gets the publishing profile for an app (or deployment slot, if + * specified). + * + * Gets the publishing profile for an app (or deployment slot, if specified). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} publishingProfileOptions Specifies publishingProfileOptions + * for publishing profile. For example, use {"format": "FileZilla3"} to get a + * FileZilla publishing profile. + * + * @param {string} [publishingProfileOptions.format] Name of the format. Valid + * values are: + * FileZilla3 + * WebDeploy -- default + * Ftp. Possible values include: 'FileZilla3', 'WebDeploy', 'Ftp' + * + * @param {boolean} [publishingProfileOptions.includeDisasterRecoveryEndpoints] + * Include the DisasterRecover endpoint if true + * + * @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. + */ + listPublishingProfileXmlWithSecretsWithHttpOperationResponse(resourceGroupName, name, publishingProfileOptions, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listPublishingProfileXmlWithSecrets(resourceGroupName, name, publishingProfileOptions, 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 the publishing profile for an app (or deployment slot, if + * specified). + * + * Gets the publishing profile for an app (or deployment slot, if specified). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} publishingProfileOptions Specifies publishingProfileOptions + * for publishing profile. For example, use {"format": "FileZilla3"} to get a + * FileZilla publishing profile. + * + * @param {string} [publishingProfileOptions.format] Name of the format. Valid + * values are: + * FileZilla3 + * WebDeploy -- default + * Ftp. Possible values include: 'FileZilla3', 'WebDeploy', 'Ftp' + * + * @param {boolean} [publishingProfileOptions.includeDisasterRecoveryEndpoints] + * Include the DisasterRecover endpoint if true + * + * @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 {Object} - 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. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listPublishingProfileXmlWithSecrets(resourceGroupName, name, publishingProfileOptions, 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._listPublishingProfileXmlWithSecrets(resourceGroupName, name, publishingProfileOptions, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listPublishingProfileXmlWithSecrets(resourceGroupName, name, publishingProfileOptions, options, optionalCallback); + } + } + + /** + * @summary Resets the configuration settings of the current slot if they were + * previously modified by calling the API with POST. + * + * Resets the configuration settings of the current slot if they were + * previously modified by calling the API with POST. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @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. + */ + resetProductionSlotConfigWithHttpOperationResponse(resourceGroupName, name, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._resetProductionSlotConfig(resourceGroupName, name, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Resets the configuration settings of the current slot if they were + * previously modified by calling the API with POST. + * + * Resets the configuration settings of the current slot if they were + * previously modified by calling the API with POST. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + resetProductionSlotConfig(resourceGroupName, name, 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._resetProductionSlotConfig(resourceGroupName, name, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._resetProductionSlotConfig(resourceGroupName, name, options, optionalCallback); + } + } + + /** + * @summary Restarts an app (or deployment slot, if specified). + * + * Restarts an app (or deployment slot, if specified). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} [options] Optional Parameters. + * + * @param {boolean} [options.softRestart] Specify true to apply the + * configuration settings and restarts the app only if necessary. By default, + * the API always restarts and reprovisions the app. + * + * @param {boolean} [options.synchronous] Specify true to block until the app + * is restarted. By default, it is set to false, and the API responds + * immediately (asynchronous). + * + * @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. + */ + restartWithHttpOperationResponse(resourceGroupName, name, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._restart(resourceGroupName, name, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Restarts an app (or deployment slot, if specified). + * + * Restarts an app (or deployment slot, if specified). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} [options] Optional Parameters. + * + * @param {boolean} [options.softRestart] Specify true to apply the + * configuration settings and restarts the app only if necessary. By default, + * the API always restarts and reprovisions the app. + * + * @param {boolean} [options.synchronous] Specify true to block until the app + * is restarted. By default, it is set to false, and the API responds + * immediately (asynchronous). + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + restart(resourceGroupName, name, 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._restart(resourceGroupName, name, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._restart(resourceGroupName, name, options, optionalCallback); + } + } + + /** + * @summary Restores an app from a backup blob in Azure Storage. + * + * Restores an app from a backup blob in Azure Storage. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} request Information on restore request . + * + * @param {string} request.storageAccountUrl SAS URL to the container. + * + * @param {string} [request.blobName] Name of a blob which contains the backup. + * + * @param {boolean} request.overwrite true if the restore + * operation can overwrite target app; otherwise, false. + * true is needed if trying to restore over an existing app. + * + * @param {string} [request.siteName] Name of an app. + * + * @param {array} [request.databases] Collection of databases which should be + * restored. This list has to match the list of databases included in the + * backup. + * + * @param {boolean} [request.ignoreConflictingHostNames] Changes a logic when + * restoring an app with custom domains. true to remove custom + * domains automatically. If false, custom domains are added to + * the app's object when it is being restored, but that might fail due to + * conflicts during the operation. + * + * @param {boolean} [request.ignoreDatabases] Ignore the databases and only + * restore the site content + * + * @param {string} [request.appServicePlan] Specify app service plan that will + * own restored site. + * + * @param {string} [request.operationType] Operation type. Possible values + * include: 'Default', 'Clone', 'Relocation', 'Snapshot', 'CloudFS' + * + * @param {boolean} [request.adjustConnectionStrings] true if + * SiteConfig.ConnectionStrings should be set in new app; otherwise, + * false. + * + * @param {string} [request.hostingEnvironment] App Service Environment name, + * if needed (only when restoring an app to an App Service Environment). + * + * @param {string} [request.kind] Kind of resource. + * + * @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. + */ + restoreFromBackupBlobWithHttpOperationResponse(resourceGroupName, name, request, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._restoreFromBackupBlob(resourceGroupName, name, request, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Restores an app from a backup blob in Azure Storage. + * + * Restores an app from a backup blob in Azure Storage. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} request Information on restore request . + * + * @param {string} request.storageAccountUrl SAS URL to the container. + * + * @param {string} [request.blobName] Name of a blob which contains the backup. + * + * @param {boolean} request.overwrite true if the restore + * operation can overwrite target app; otherwise, false. + * true is needed if trying to restore over an existing app. + * + * @param {string} [request.siteName] Name of an app. + * + * @param {array} [request.databases] Collection of databases which should be + * restored. This list has to match the list of databases included in the + * backup. + * + * @param {boolean} [request.ignoreConflictingHostNames] Changes a logic when + * restoring an app with custom domains. true to remove custom + * domains automatically. If false, custom domains are added to + * the app's object when it is being restored, but that might fail due to + * conflicts during the operation. + * + * @param {boolean} [request.ignoreDatabases] Ignore the databases and only + * restore the site content + * + * @param {string} [request.appServicePlan] Specify app service plan that will + * own restored site. + * + * @param {string} [request.operationType] Operation type. Possible values + * include: 'Default', 'Clone', 'Relocation', 'Snapshot', 'CloudFS' + * + * @param {boolean} [request.adjustConnectionStrings] true if + * SiteConfig.ConnectionStrings should be set in new app; otherwise, + * false. + * + * @param {string} [request.hostingEnvironment] App Service Environment name, + * if needed (only when restoring an app to an App Service Environment). + * + * @param {string} [request.kind] Kind of resource. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + restoreFromBackupBlob(resourceGroupName, name, request, 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._restoreFromBackupBlob(resourceGroupName, name, request, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._restoreFromBackupBlob(resourceGroupName, name, request, options, optionalCallback); + } + } + + /** + * @summary Restores a deleted web app to this web app. + * + * Restores a deleted web app to this web app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {object} restoreRequest Deleted web app restore information. + * + * @param {string} [restoreRequest.deletedSiteId] ARM resource ID of the + * deleted app. Example: + * /subscriptions/{subId}/providers/Microsoft.Web/deletedSites/{deletedSiteId} + * + * @param {boolean} [restoreRequest.recoverConfiguration] If true, deleted site + * configuration, in addition to content, will be restored. + * + * @param {string} [restoreRequest.snapshotTime] Point in time to restore the + * deleted app from, formatted as a DateTime string. + * If unspecified, default value is the time that the app was deleted. + * + * @param {string} [restoreRequest.kind] Kind of resource. + * + * @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. + */ + restoreFromDeletedAppWithHttpOperationResponse(resourceGroupName, name, restoreRequest, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._restoreFromDeletedApp(resourceGroupName, name, restoreRequest, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Restores a deleted web app to this web app. + * + * Restores a deleted web app to this web app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {object} restoreRequest Deleted web app restore information. + * + * @param {string} [restoreRequest.deletedSiteId] ARM resource ID of the + * deleted app. Example: + * /subscriptions/{subId}/providers/Microsoft.Web/deletedSites/{deletedSiteId} + * + * @param {boolean} [restoreRequest.recoverConfiguration] If true, deleted site + * configuration, in addition to content, will be restored. + * + * @param {string} [restoreRequest.snapshotTime] Point in time to restore the + * deleted app from, formatted as a DateTime string. + * If unspecified, default value is the time that the app was deleted. + * + * @param {string} [restoreRequest.kind] Kind of resource. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + restoreFromDeletedApp(resourceGroupName, name, restoreRequest, 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._restoreFromDeletedApp(resourceGroupName, name, restoreRequest, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._restoreFromDeletedApp(resourceGroupName, name, restoreRequest, options, optionalCallback); + } + } + + /** + * @summary Restores a web app from a snapshot. + * + * Restores a web app from a snapshot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {object} restoreRequest Snapshot restore settings. Snapshot + * information can be obtained by calling GetDeletedSites or GetSiteSnapshots + * API. + * + * @param {string} [restoreRequest.snapshotTime] Point in time in which the app + * restore should be done, formatted as a DateTime string. + * + * @param {object} [restoreRequest.recoverySource] Optional. Specifies the web + * app that snapshot contents will be retrieved from. + * If empty, the targeted web app will be used as the source. + * + * @param {string} [restoreRequest.recoverySource.location] Geographical + * location of the source web app, e.g. SouthEastAsia, SouthCentralUS + * + * @param {string} [restoreRequest.recoverySource.id] ARM resource ID of the + * source app. + * /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName} + * for production slots and + * /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/slots/{slotName} + * for other slots. + * + * @param {boolean} restoreRequest.overwrite If true the restore + * operation can overwrite source app; otherwise, false. + * + * @param {boolean} [restoreRequest.recoverConfiguration] If true, site + * configuration, in addition to content, will be reverted. + * + * @param {boolean} [restoreRequest.ignoreConflictingHostNames] If true, custom + * hostname conflicts will be ignored when recovering to a target web app. + * This setting is only necessary when RecoverConfiguration is enabled. + * + * @param {string} [restoreRequest.kind] Kind of resource. + * + * @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. + */ + restoreSnapshotWithHttpOperationResponse(resourceGroupName, name, restoreRequest, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._restoreSnapshot(resourceGroupName, name, restoreRequest, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Restores a web app from a snapshot. + * + * Restores a web app from a snapshot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {object} restoreRequest Snapshot restore settings. Snapshot + * information can be obtained by calling GetDeletedSites or GetSiteSnapshots + * API. + * + * @param {string} [restoreRequest.snapshotTime] Point in time in which the app + * restore should be done, formatted as a DateTime string. + * + * @param {object} [restoreRequest.recoverySource] Optional. Specifies the web + * app that snapshot contents will be retrieved from. + * If empty, the targeted web app will be used as the source. + * + * @param {string} [restoreRequest.recoverySource.location] Geographical + * location of the source web app, e.g. SouthEastAsia, SouthCentralUS + * + * @param {string} [restoreRequest.recoverySource.id] ARM resource ID of the + * source app. + * /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName} + * for production slots and + * /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/slots/{slotName} + * for other slots. + * + * @param {boolean} restoreRequest.overwrite If true the restore + * operation can overwrite source app; otherwise, false. + * + * @param {boolean} [restoreRequest.recoverConfiguration] If true, site + * configuration, in addition to content, will be reverted. + * + * @param {boolean} [restoreRequest.ignoreConflictingHostNames] If true, custom + * hostname conflicts will be ignored when recovering to a target web app. + * This setting is only necessary when RecoverConfiguration is enabled. + * + * @param {string} [restoreRequest.kind] Kind of resource. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + restoreSnapshot(resourceGroupName, name, restoreRequest, 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._restoreSnapshot(resourceGroupName, name, restoreRequest, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._restoreSnapshot(resourceGroupName, name, restoreRequest, options, optionalCallback); + } + } + + /** + * @summary Get list of siteextensions for a web site, or a deployment slot. + * + * Get list of siteextensions for a web site, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @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. + */ + listSiteExtensionsWithHttpOperationResponse(resourceGroupName, name, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listSiteExtensions(resourceGroupName, name, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Get list of siteextensions for a web site, or a deployment slot. + * + * Get list of siteextensions for a web site, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @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 {SiteExtensionInfoCollection} - 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 SiteExtensionInfoCollection} 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. + */ + listSiteExtensions(resourceGroupName, name, 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._listSiteExtensions(resourceGroupName, name, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listSiteExtensions(resourceGroupName, name, options, optionalCallback); + } + } + + /** + * @summary Get site extension information by its ID for a web site, or a + * deployment slot. + * + * Get site extension information by its ID for a web site, or a deployment + * slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} siteExtensionId Site extension name. + * + * @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. + */ + getSiteExtensionWithHttpOperationResponse(resourceGroupName, name, siteExtensionId, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._getSiteExtension(resourceGroupName, name, siteExtensionId, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Get site extension information by its ID for a web site, or a + * deployment slot. + * + * Get site extension information by its ID for a web site, or a deployment + * slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} siteExtensionId Site extension name. + * + * @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 {SiteExtensionInfo} - 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 SiteExtensionInfo} 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. + */ + getSiteExtension(resourceGroupName, name, siteExtensionId, 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._getSiteExtension(resourceGroupName, name, siteExtensionId, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getSiteExtension(resourceGroupName, name, siteExtensionId, options, optionalCallback); + } + } + + /** + * @summary Install site extension on a web site, or a deployment slot. + * + * Install site extension on a web site, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} siteExtensionId Site extension name. + * + * @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. + */ + installSiteExtensionWithHttpOperationResponse(resourceGroupName, name, siteExtensionId, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._installSiteExtension(resourceGroupName, name, siteExtensionId, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Install site extension on a web site, or a deployment slot. + * + * Install site extension on a web site, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} siteExtensionId Site extension name. + * + * @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 {SiteExtensionInfo} - 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 SiteExtensionInfo} 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. + */ + installSiteExtension(resourceGroupName, name, siteExtensionId, 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._installSiteExtension(resourceGroupName, name, siteExtensionId, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._installSiteExtension(resourceGroupName, name, siteExtensionId, options, optionalCallback); + } + } + + /** + * @summary Remove a site extension from a web site, or a deployment slot. + * + * Remove a site extension from a web site, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} siteExtensionId Site extension name. + * + * @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. + */ + deleteSiteExtensionWithHttpOperationResponse(resourceGroupName, name, siteExtensionId, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._deleteSiteExtension(resourceGroupName, name, siteExtensionId, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Remove a site extension from a web site, or a deployment slot. + * + * Remove a site extension from a web site, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} siteExtensionId Site extension name. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + deleteSiteExtension(resourceGroupName, name, siteExtensionId, 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._deleteSiteExtension(resourceGroupName, name, siteExtensionId, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._deleteSiteExtension(resourceGroupName, name, siteExtensionId, options, optionalCallback); + } + } + + /** + * @summary Gets an app's deployment slots. + * + * Gets an app's deployment slots. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @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. + */ + listSlotsWithHttpOperationResponse(resourceGroupName, name, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listSlots(resourceGroupName, name, 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 an app's deployment slots. + * + * Gets an app's deployment slots. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @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 {WebAppCollection} - 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 WebAppCollection} 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. + */ + listSlots(resourceGroupName, name, 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._listSlots(resourceGroupName, name, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listSlots(resourceGroupName, name, options, optionalCallback); + } + } + + /** + * @summary Gets the details of a web, mobile, or API app. + * + * Gets the details of a web, mobile, or API app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. By default, this API + * returns the production slot. + * + * @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. + */ + getSlotWithHttpOperationResponse(resourceGroupName, name, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._getSlot(resourceGroupName, name, slot, 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 the details of a web, mobile, or API app. + * + * Gets the details of a web, mobile, or API app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. By default, this API + * returns the production slot. + * + * @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 {Site} - 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 Site} 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. + */ + getSlot(resourceGroupName, name, slot, 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._getSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getSlot(resourceGroupName, name, slot, options, optionalCallback); + } + } + + /** + * @summary Creates a new web, mobile, or API app in an existing resource + * group, or updates an existing app. + * + * Creates a new web, mobile, or API app in an existing resource group, or + * updates an existing app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Unique name of the app to create or update. To create + * or update a deployment slot, use the {slot} parameter. + * + * @param {object} siteEnvelope A JSON representation of the app properties. + * See example. + * + * @param {boolean} [siteEnvelope.enabled] true if the app is + * enabled; otherwise, false. Setting this value to false disables + * the app (takes the app offline). + * + * @param {array} [siteEnvelope.hostNameSslStates] Hostname SSL states are used + * to manage the SSL bindings for app's hostnames. + * + * @param {string} [siteEnvelope.serverFarmId] Resource ID of the associated + * App Service plan, formatted as: + * "/subscriptions/{subscriptionID}/resourceGroups/{groupName}/providers/Microsoft.Web/serverfarms/{appServicePlanName}". + * + * @param {boolean} [siteEnvelope.reserved] true if reserved; + * otherwise, false. + * + * @param {boolean} [siteEnvelope.isXenon] Obsolete: Hyper-V sandbox. + * + * @param {boolean} [siteEnvelope.hyperV] Hyper-V sandbox. + * + * @param {object} [siteEnvelope.siteConfig] Configuration of the app. + * + * @param {number} [siteEnvelope.siteConfig.numberOfWorkers] Number of workers. + * + * @param {array} [siteEnvelope.siteConfig.defaultDocuments] Default documents. + * + * @param {string} [siteEnvelope.siteConfig.netFrameworkVersion] .NET Framework + * version. + * + * @param {string} [siteEnvelope.siteConfig.phpVersion] Version of PHP. + * + * @param {string} [siteEnvelope.siteConfig.pythonVersion] Version of Python. + * + * @param {string} [siteEnvelope.siteConfig.nodeVersion] Version of Node.js. + * + * @param {string} [siteEnvelope.siteConfig.linuxFxVersion] Linux App Framework + * and version + * + * @param {string} [siteEnvelope.siteConfig.windowsFxVersion] Xenon App + * Framework and version + * + * @param {boolean} [siteEnvelope.siteConfig.requestTracingEnabled] + * true if request tracing is enabled; otherwise, + * false. + * + * @param {date} [siteEnvelope.siteConfig.requestTracingExpirationTime] Request + * tracing expiration time. + * + * @param {boolean} [siteEnvelope.siteConfig.remoteDebuggingEnabled] + * true if remote debugging is enabled; otherwise, + * false. + * + * @param {string} [siteEnvelope.siteConfig.remoteDebuggingVersion] Remote + * debugging version. + * + * @param {boolean} [siteEnvelope.siteConfig.httpLoggingEnabled] + * true if HTTP logging is enabled; otherwise, false. + * + * @param {number} [siteEnvelope.siteConfig.logsDirectorySizeLimit] HTTP logs + * directory size limit. + * + * @param {boolean} [siteEnvelope.siteConfig.detailedErrorLoggingEnabled] + * true if detailed error logging is enabled; otherwise, + * false. + * + * @param {string} [siteEnvelope.siteConfig.publishingUsername] Publishing user + * name. + * + * @param {array} [siteEnvelope.siteConfig.appSettings] Application settings. + * + * @param {object} [siteEnvelope.siteConfig.azureStorageAccounts] User-provided + * Azure storage accounts. + * + * @param {array} [siteEnvelope.siteConfig.connectionStrings] Connection + * strings. + * + * @param {array} [siteEnvelope.siteConfig.handlerMappings] Handler mappings. + * + * @param {string} [siteEnvelope.siteConfig.documentRoot] Document root. + * + * @param {string} [siteEnvelope.siteConfig.scmType] SCM type. Possible values + * include: 'None', 'Dropbox', 'Tfs', 'LocalGit', 'GitHub', 'CodePlexGit', + * 'CodePlexHg', 'BitbucketGit', 'BitbucketHg', 'ExternalGit', 'ExternalHg', + * 'OneDrive', 'VSO' + * + * @param {boolean} [siteEnvelope.siteConfig.use32BitWorkerProcess] + * true to use 32-bit worker process; otherwise, + * false. + * + * @param {boolean} [siteEnvelope.siteConfig.webSocketsEnabled] + * true if WebSocket is enabled; otherwise, false. + * + * @param {boolean} [siteEnvelope.siteConfig.alwaysOn] true if + * Always On is enabled; otherwise, false. + * + * @param {string} [siteEnvelope.siteConfig.javaVersion] Java version. + * + * @param {string} [siteEnvelope.siteConfig.javaContainer] Java container. + * + * @param {string} [siteEnvelope.siteConfig.javaContainerVersion] Java + * container version. + * + * @param {string} [siteEnvelope.siteConfig.appCommandLine] App command line to + * launch. + * + * @param {string} [siteEnvelope.siteConfig.managedPipelineMode] Managed + * pipeline mode. Possible values include: 'Integrated', 'Classic' + * + * @param {array} [siteEnvelope.siteConfig.virtualApplications] Virtual + * applications. + * + * @param {string} [siteEnvelope.siteConfig.loadBalancing] Site load balancing. + * Possible values include: 'WeightedRoundRobin', 'LeastRequests', + * 'LeastResponseTime', 'WeightedTotalTraffic', 'RequestHash' + * + * @param {object} [siteEnvelope.siteConfig.experiments] This is work around + * for polymophic types. + * + * @param {array} [siteEnvelope.siteConfig.experiments.rampUpRules] List of + * ramp-up rules. + * + * @param {object} [siteEnvelope.siteConfig.limits] Site limits. + * + * @param {number} [siteEnvelope.siteConfig.limits.maxPercentageCpu] Maximum + * allowed CPU usage percentage. + * + * @param {number} [siteEnvelope.siteConfig.limits.maxMemoryInMb] Maximum + * allowed memory usage in MB. + * + * @param {number} [siteEnvelope.siteConfig.limits.maxDiskSizeInMb] Maximum + * allowed disk size usage in MB. + * + * @param {boolean} [siteEnvelope.siteConfig.autoHealEnabled] true + * if Auto Heal is enabled; otherwise, false. + * + * @param {object} [siteEnvelope.siteConfig.autoHealRules] Auto Heal rules. + * + * @param {object} [siteEnvelope.siteConfig.autoHealRules.triggers] Conditions + * that describe when to execute the auto-heal actions. + * + * @param {object} [siteEnvelope.siteConfig.autoHealRules.triggers.requests] A + * rule based on total requests. + * + * @param {number} + * [siteEnvelope.siteConfig.autoHealRules.triggers.requests.count] Request + * Count. + * + * @param {string} + * [siteEnvelope.siteConfig.autoHealRules.triggers.requests.timeInterval] Time + * interval. + * + * @param {number} + * [siteEnvelope.siteConfig.autoHealRules.triggers.privateBytesInKB] A rule + * based on private bytes. + * + * @param {array} [siteEnvelope.siteConfig.autoHealRules.triggers.statusCodes] + * A rule based on status codes. + * + * @param {object} + * [siteEnvelope.siteConfig.autoHealRules.triggers.slowRequests] A rule based + * on request execution time. + * + * @param {string} + * [siteEnvelope.siteConfig.autoHealRules.triggers.slowRequests.timeTaken] Time + * taken. + * + * @param {number} + * [siteEnvelope.siteConfig.autoHealRules.triggers.slowRequests.count] Request + * Count. + * + * @param {string} + * [siteEnvelope.siteConfig.autoHealRules.triggers.slowRequests.timeInterval] + * Time interval. + * + * @param {object} [siteEnvelope.siteConfig.autoHealRules.actions] Actions to + * be executed when a rule is triggered. + * + * @param {string} [siteEnvelope.siteConfig.autoHealRules.actions.actionType] + * Predefined action to be taken. Possible values include: 'Recycle', + * 'LogEvent', 'CustomAction' + * + * @param {object} [siteEnvelope.siteConfig.autoHealRules.actions.customAction] + * Custom action to be taken. + * + * @param {string} + * [siteEnvelope.siteConfig.autoHealRules.actions.customAction.exe] Executable + * to be run. + * + * @param {string} + * [siteEnvelope.siteConfig.autoHealRules.actions.customAction.parameters] + * Parameters for the executable. + * + * @param {string} + * [siteEnvelope.siteConfig.autoHealRules.actions.minProcessExecutionTime] + * Minimum time the process must execute + * before taking the action + * + * @param {string} [siteEnvelope.siteConfig.tracingOptions] Tracing options. + * + * @param {string} [siteEnvelope.siteConfig.vnetName] Virtual Network name. + * + * @param {object} [siteEnvelope.siteConfig.cors] Cross-Origin Resource Sharing + * (CORS) settings. + * + * @param {array} [siteEnvelope.siteConfig.cors.allowedOrigins] Gets or sets + * the list of origins that should be allowed to make cross-origin + * calls (for example: http://example.com:12345). Use "*" to allow all. + * + * @param {object} [siteEnvelope.siteConfig.push] Push endpoint settings. + * + * @param {boolean} siteEnvelope.siteConfig.push.isPushEnabled Gets or sets a + * flag indicating whether the Push endpoint is enabled. + * + * @param {string} [siteEnvelope.siteConfig.push.tagWhitelistJson] Gets or sets + * a JSON string containing a list of tags that are whitelisted for use by the + * push registration endpoint. + * + * @param {string} [siteEnvelope.siteConfig.push.tagsRequiringAuth] Gets or + * sets a JSON string containing a list of tags that require user + * authentication to be used in the push registration endpoint. + * Tags can consist of alphanumeric characters and the following: + * '_', '@', '#', '.', ':', '-'. + * Validation should be performed at the PushRequestHandler. + * + * @param {string} [siteEnvelope.siteConfig.push.dynamicTagsJson] Gets or sets + * a JSON string containing a list of dynamic tags that will be evaluated from + * user claims in the push registration endpoint. + * + * @param {string} [siteEnvelope.siteConfig.push.kind] Kind of resource. + * + * @param {object} [siteEnvelope.siteConfig.apiDefinition] Information about + * the formal API definition for the app. + * + * @param {string} [siteEnvelope.siteConfig.apiDefinition.url] The URL of the + * API definition. + * + * @param {string} [siteEnvelope.siteConfig.autoSwapSlotName] Auto-swap slot + * name. + * + * @param {boolean} [siteEnvelope.siteConfig.localMySqlEnabled] + * true to enable local MySQL; otherwise, false. + * + * @param {number} [siteEnvelope.siteConfig.managedServiceIdentityId] Managed + * Service Identity Id + * + * @param {number} [siteEnvelope.siteConfig.xManagedServiceIdentityId] Explicit + * Managed Service Identity Id + * + * @param {array} [siteEnvelope.siteConfig.ipSecurityRestrictions] IP security + * restrictions. + * + * @param {boolean} [siteEnvelope.siteConfig.http20Enabled] Http20Enabled: + * configures a web site to allow clients to connect over http2.0 + * + * @param {string} [siteEnvelope.siteConfig.minTlsVersion] MinTlsVersion: + * configures the minimum version of TLS required for SSL requests. Possible + * values include: '1.0', '1.1', '1.2' + * + * @param {string} [siteEnvelope.siteConfig.ftpsState] State of FTP / FTPS + * service. Possible values include: 'AllAllowed', 'FtpsOnly', 'Disabled' + * + * @param {number} [siteEnvelope.siteConfig.reservedInstanceCount] Number of + * reserved instances. + * This setting only applies to the Consumption Plan + * + * @param {boolean} [siteEnvelope.scmSiteAlsoStopped] true to stop + * SCM (KUDU) site when the app is stopped; otherwise, false. The + * default is false. + * + * @param {object} [siteEnvelope.hostingEnvironmentProfile] App Service + * Environment to use for the app. + * + * @param {string} [siteEnvelope.hostingEnvironmentProfile.id] Resource ID of + * the App Service Environment. + * + * @param {boolean} [siteEnvelope.clientAffinityEnabled] true to + * enable client affinity; false to stop sending session affinity + * cookies, which route client requests in the same session to the same + * instance. Default is true. + * + * @param {boolean} [siteEnvelope.clientCertEnabled] true to + * enable client certificate authentication (TLS mutual authentication); + * otherwise, false. Default is false. + * + * @param {boolean} [siteEnvelope.hostNamesDisabled] true to + * disable the public hostnames of the app; otherwise, false. + * If true, the app is only accessible via API management process. + * + * @param {number} [siteEnvelope.containerSize] Size of the function container. + * + * @param {number} [siteEnvelope.dailyMemoryTimeQuota] Maximum allowed daily + * memory-time quota (applicable on dynamic apps only). + * + * @param {object} [siteEnvelope.cloningInfo] If specified during app creation, + * the app is cloned from a source app. + * + * @param {uuid} [siteEnvelope.cloningInfo.correlationId] Correlation ID of + * cloning operation. This ID ties multiple cloning operations + * together to use the same snapshot. + * + * @param {boolean} [siteEnvelope.cloningInfo.overwrite] true to + * overwrite destination app; otherwise, false. + * + * @param {boolean} [siteEnvelope.cloningInfo.cloneCustomHostNames] + * true to clone custom hostnames from source app; otherwise, + * false. + * + * @param {boolean} [siteEnvelope.cloningInfo.cloneSourceControl] + * true to clone source control from source app; otherwise, + * false. + * + * @param {string} siteEnvelope.cloningInfo.sourceWebAppId ARM resource ID of + * the source app. App resource ID is of the form + * /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName} + * for production slots and + * /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/slots/{slotName} + * for other slots. + * + * @param {string} [siteEnvelope.cloningInfo.hostingEnvironment] App Service + * Environment. + * + * @param {object} [siteEnvelope.cloningInfo.appSettingsOverrides] Application + * setting overrides for cloned app. If specified, these settings override the + * settings cloned + * from source app. Otherwise, application settings from source app are + * retained. + * + * @param {boolean} [siteEnvelope.cloningInfo.configureLoadBalancing] + * true to configure load balancing for source and destination + * app. + * + * @param {string} [siteEnvelope.cloningInfo.trafficManagerProfileId] ARM + * resource ID of the Traffic Manager profile to use, if it exists. Traffic + * Manager resource ID is of the form + * /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/trafficManagerProfiles/{profileName}. + * + * @param {string} [siteEnvelope.cloningInfo.trafficManagerProfileName] Name of + * Traffic Manager profile to create. This is only needed if Traffic Manager + * profile does not already exist. + * + * @param {boolean} [siteEnvelope.httpsOnly] HttpsOnly: configures a web site + * to accept only https requests. Issues redirect for + * http requests + * + * @param {object} [siteEnvelope.identity] + * + * @param {string} [siteEnvelope.identity.type] Type of managed service + * identity. Possible values include: 'SystemAssigned', 'UserAssigned' + * + * @param {array} [siteEnvelope.identity.identityIds] Array of UserAssigned + * managed service identities. + * + * @param {string} [siteEnvelope.kind] Kind of resource. + * + * @param {string} siteEnvelope.location Resource Location. + * + * @param {object} [siteEnvelope.tags] Resource tags. + * + * @param {string} slot Name of the deployment slot to create or update. By + * default, this API attempts to create or modify the production slot. + * + * @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. + */ + createOrUpdateSlotWithHttpOperationResponse(resourceGroupName, name, siteEnvelope, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._createOrUpdateSlot(resourceGroupName, name, siteEnvelope, slot, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Creates a new web, mobile, or API app in an existing resource + * group, or updates an existing app. + * + * Creates a new web, mobile, or API app in an existing resource group, or + * updates an existing app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Unique name of the app to create or update. To create + * or update a deployment slot, use the {slot} parameter. + * + * @param {object} siteEnvelope A JSON representation of the app properties. + * See example. + * + * @param {boolean} [siteEnvelope.enabled] true if the app is + * enabled; otherwise, false. Setting this value to false disables + * the app (takes the app offline). + * + * @param {array} [siteEnvelope.hostNameSslStates] Hostname SSL states are used + * to manage the SSL bindings for app's hostnames. + * + * @param {string} [siteEnvelope.serverFarmId] Resource ID of the associated + * App Service plan, formatted as: + * "/subscriptions/{subscriptionID}/resourceGroups/{groupName}/providers/Microsoft.Web/serverfarms/{appServicePlanName}". + * + * @param {boolean} [siteEnvelope.reserved] true if reserved; + * otherwise, false. + * + * @param {boolean} [siteEnvelope.isXenon] Obsolete: Hyper-V sandbox. + * + * @param {boolean} [siteEnvelope.hyperV] Hyper-V sandbox. + * + * @param {object} [siteEnvelope.siteConfig] Configuration of the app. + * + * @param {number} [siteEnvelope.siteConfig.numberOfWorkers] Number of workers. + * + * @param {array} [siteEnvelope.siteConfig.defaultDocuments] Default documents. + * + * @param {string} [siteEnvelope.siteConfig.netFrameworkVersion] .NET Framework + * version. + * + * @param {string} [siteEnvelope.siteConfig.phpVersion] Version of PHP. + * + * @param {string} [siteEnvelope.siteConfig.pythonVersion] Version of Python. + * + * @param {string} [siteEnvelope.siteConfig.nodeVersion] Version of Node.js. + * + * @param {string} [siteEnvelope.siteConfig.linuxFxVersion] Linux App Framework + * and version + * + * @param {string} [siteEnvelope.siteConfig.windowsFxVersion] Xenon App + * Framework and version + * + * @param {boolean} [siteEnvelope.siteConfig.requestTracingEnabled] + * true if request tracing is enabled; otherwise, + * false. + * + * @param {date} [siteEnvelope.siteConfig.requestTracingExpirationTime] Request + * tracing expiration time. + * + * @param {boolean} [siteEnvelope.siteConfig.remoteDebuggingEnabled] + * true if remote debugging is enabled; otherwise, + * false. + * + * @param {string} [siteEnvelope.siteConfig.remoteDebuggingVersion] Remote + * debugging version. + * + * @param {boolean} [siteEnvelope.siteConfig.httpLoggingEnabled] + * true if HTTP logging is enabled; otherwise, false. + * + * @param {number} [siteEnvelope.siteConfig.logsDirectorySizeLimit] HTTP logs + * directory size limit. + * + * @param {boolean} [siteEnvelope.siteConfig.detailedErrorLoggingEnabled] + * true if detailed error logging is enabled; otherwise, + * false. + * + * @param {string} [siteEnvelope.siteConfig.publishingUsername] Publishing user + * name. + * + * @param {array} [siteEnvelope.siteConfig.appSettings] Application settings. + * + * @param {object} [siteEnvelope.siteConfig.azureStorageAccounts] User-provided + * Azure storage accounts. + * + * @param {array} [siteEnvelope.siteConfig.connectionStrings] Connection + * strings. + * + * @param {array} [siteEnvelope.siteConfig.handlerMappings] Handler mappings. + * + * @param {string} [siteEnvelope.siteConfig.documentRoot] Document root. + * + * @param {string} [siteEnvelope.siteConfig.scmType] SCM type. Possible values + * include: 'None', 'Dropbox', 'Tfs', 'LocalGit', 'GitHub', 'CodePlexGit', + * 'CodePlexHg', 'BitbucketGit', 'BitbucketHg', 'ExternalGit', 'ExternalHg', + * 'OneDrive', 'VSO' + * + * @param {boolean} [siteEnvelope.siteConfig.use32BitWorkerProcess] + * true to use 32-bit worker process; otherwise, + * false. + * + * @param {boolean} [siteEnvelope.siteConfig.webSocketsEnabled] + * true if WebSocket is enabled; otherwise, false. + * + * @param {boolean} [siteEnvelope.siteConfig.alwaysOn] true if + * Always On is enabled; otherwise, false. + * + * @param {string} [siteEnvelope.siteConfig.javaVersion] Java version. + * + * @param {string} [siteEnvelope.siteConfig.javaContainer] Java container. + * + * @param {string} [siteEnvelope.siteConfig.javaContainerVersion] Java + * container version. + * + * @param {string} [siteEnvelope.siteConfig.appCommandLine] App command line to + * launch. + * + * @param {string} [siteEnvelope.siteConfig.managedPipelineMode] Managed + * pipeline mode. Possible values include: 'Integrated', 'Classic' + * + * @param {array} [siteEnvelope.siteConfig.virtualApplications] Virtual + * applications. + * + * @param {string} [siteEnvelope.siteConfig.loadBalancing] Site load balancing. + * Possible values include: 'WeightedRoundRobin', 'LeastRequests', + * 'LeastResponseTime', 'WeightedTotalTraffic', 'RequestHash' + * + * @param {object} [siteEnvelope.siteConfig.experiments] This is work around + * for polymophic types. + * + * @param {array} [siteEnvelope.siteConfig.experiments.rampUpRules] List of + * ramp-up rules. + * + * @param {object} [siteEnvelope.siteConfig.limits] Site limits. + * + * @param {number} [siteEnvelope.siteConfig.limits.maxPercentageCpu] Maximum + * allowed CPU usage percentage. + * + * @param {number} [siteEnvelope.siteConfig.limits.maxMemoryInMb] Maximum + * allowed memory usage in MB. + * + * @param {number} [siteEnvelope.siteConfig.limits.maxDiskSizeInMb] Maximum + * allowed disk size usage in MB. + * + * @param {boolean} [siteEnvelope.siteConfig.autoHealEnabled] true + * if Auto Heal is enabled; otherwise, false. + * + * @param {object} [siteEnvelope.siteConfig.autoHealRules] Auto Heal rules. + * + * @param {object} [siteEnvelope.siteConfig.autoHealRules.triggers] Conditions + * that describe when to execute the auto-heal actions. + * + * @param {object} [siteEnvelope.siteConfig.autoHealRules.triggers.requests] A + * rule based on total requests. + * + * @param {number} + * [siteEnvelope.siteConfig.autoHealRules.triggers.requests.count] Request + * Count. + * + * @param {string} + * [siteEnvelope.siteConfig.autoHealRules.triggers.requests.timeInterval] Time + * interval. + * + * @param {number} + * [siteEnvelope.siteConfig.autoHealRules.triggers.privateBytesInKB] A rule + * based on private bytes. + * + * @param {array} [siteEnvelope.siteConfig.autoHealRules.triggers.statusCodes] + * A rule based on status codes. + * + * @param {object} + * [siteEnvelope.siteConfig.autoHealRules.triggers.slowRequests] A rule based + * on request execution time. + * + * @param {string} + * [siteEnvelope.siteConfig.autoHealRules.triggers.slowRequests.timeTaken] Time + * taken. + * + * @param {number} + * [siteEnvelope.siteConfig.autoHealRules.triggers.slowRequests.count] Request + * Count. + * + * @param {string} + * [siteEnvelope.siteConfig.autoHealRules.triggers.slowRequests.timeInterval] + * Time interval. + * + * @param {object} [siteEnvelope.siteConfig.autoHealRules.actions] Actions to + * be executed when a rule is triggered. + * + * @param {string} [siteEnvelope.siteConfig.autoHealRules.actions.actionType] + * Predefined action to be taken. Possible values include: 'Recycle', + * 'LogEvent', 'CustomAction' + * + * @param {object} [siteEnvelope.siteConfig.autoHealRules.actions.customAction] + * Custom action to be taken. + * + * @param {string} + * [siteEnvelope.siteConfig.autoHealRules.actions.customAction.exe] Executable + * to be run. + * + * @param {string} + * [siteEnvelope.siteConfig.autoHealRules.actions.customAction.parameters] + * Parameters for the executable. + * + * @param {string} + * [siteEnvelope.siteConfig.autoHealRules.actions.minProcessExecutionTime] + * Minimum time the process must execute + * before taking the action + * + * @param {string} [siteEnvelope.siteConfig.tracingOptions] Tracing options. + * + * @param {string} [siteEnvelope.siteConfig.vnetName] Virtual Network name. + * + * @param {object} [siteEnvelope.siteConfig.cors] Cross-Origin Resource Sharing + * (CORS) settings. + * + * @param {array} [siteEnvelope.siteConfig.cors.allowedOrigins] Gets or sets + * the list of origins that should be allowed to make cross-origin + * calls (for example: http://example.com:12345). Use "*" to allow all. + * + * @param {object} [siteEnvelope.siteConfig.push] Push endpoint settings. + * + * @param {boolean} siteEnvelope.siteConfig.push.isPushEnabled Gets or sets a + * flag indicating whether the Push endpoint is enabled. + * + * @param {string} [siteEnvelope.siteConfig.push.tagWhitelistJson] Gets or sets + * a JSON string containing a list of tags that are whitelisted for use by the + * push registration endpoint. + * + * @param {string} [siteEnvelope.siteConfig.push.tagsRequiringAuth] Gets or + * sets a JSON string containing a list of tags that require user + * authentication to be used in the push registration endpoint. + * Tags can consist of alphanumeric characters and the following: + * '_', '@', '#', '.', ':', '-'. + * Validation should be performed at the PushRequestHandler. + * + * @param {string} [siteEnvelope.siteConfig.push.dynamicTagsJson] Gets or sets + * a JSON string containing a list of dynamic tags that will be evaluated from + * user claims in the push registration endpoint. + * + * @param {string} [siteEnvelope.siteConfig.push.kind] Kind of resource. + * + * @param {object} [siteEnvelope.siteConfig.apiDefinition] Information about + * the formal API definition for the app. + * + * @param {string} [siteEnvelope.siteConfig.apiDefinition.url] The URL of the + * API definition. + * + * @param {string} [siteEnvelope.siteConfig.autoSwapSlotName] Auto-swap slot + * name. + * + * @param {boolean} [siteEnvelope.siteConfig.localMySqlEnabled] + * true to enable local MySQL; otherwise, false. + * + * @param {number} [siteEnvelope.siteConfig.managedServiceIdentityId] Managed + * Service Identity Id + * + * @param {number} [siteEnvelope.siteConfig.xManagedServiceIdentityId] Explicit + * Managed Service Identity Id + * + * @param {array} [siteEnvelope.siteConfig.ipSecurityRestrictions] IP security + * restrictions. + * + * @param {boolean} [siteEnvelope.siteConfig.http20Enabled] Http20Enabled: + * configures a web site to allow clients to connect over http2.0 + * + * @param {string} [siteEnvelope.siteConfig.minTlsVersion] MinTlsVersion: + * configures the minimum version of TLS required for SSL requests. Possible + * values include: '1.0', '1.1', '1.2' + * + * @param {string} [siteEnvelope.siteConfig.ftpsState] State of FTP / FTPS + * service. Possible values include: 'AllAllowed', 'FtpsOnly', 'Disabled' + * + * @param {number} [siteEnvelope.siteConfig.reservedInstanceCount] Number of + * reserved instances. + * This setting only applies to the Consumption Plan + * + * @param {boolean} [siteEnvelope.scmSiteAlsoStopped] true to stop + * SCM (KUDU) site when the app is stopped; otherwise, false. The + * default is false. + * + * @param {object} [siteEnvelope.hostingEnvironmentProfile] App Service + * Environment to use for the app. + * + * @param {string} [siteEnvelope.hostingEnvironmentProfile.id] Resource ID of + * the App Service Environment. + * + * @param {boolean} [siteEnvelope.clientAffinityEnabled] true to + * enable client affinity; false to stop sending session affinity + * cookies, which route client requests in the same session to the same + * instance. Default is true. + * + * @param {boolean} [siteEnvelope.clientCertEnabled] true to + * enable client certificate authentication (TLS mutual authentication); + * otherwise, false. Default is false. + * + * @param {boolean} [siteEnvelope.hostNamesDisabled] true to + * disable the public hostnames of the app; otherwise, false. + * If true, the app is only accessible via API management process. + * + * @param {number} [siteEnvelope.containerSize] Size of the function container. + * + * @param {number} [siteEnvelope.dailyMemoryTimeQuota] Maximum allowed daily + * memory-time quota (applicable on dynamic apps only). + * + * @param {object} [siteEnvelope.cloningInfo] If specified during app creation, + * the app is cloned from a source app. + * + * @param {uuid} [siteEnvelope.cloningInfo.correlationId] Correlation ID of + * cloning operation. This ID ties multiple cloning operations + * together to use the same snapshot. + * + * @param {boolean} [siteEnvelope.cloningInfo.overwrite] true to + * overwrite destination app; otherwise, false. + * + * @param {boolean} [siteEnvelope.cloningInfo.cloneCustomHostNames] + * true to clone custom hostnames from source app; otherwise, + * false. + * + * @param {boolean} [siteEnvelope.cloningInfo.cloneSourceControl] + * true to clone source control from source app; otherwise, + * false. + * + * @param {string} siteEnvelope.cloningInfo.sourceWebAppId ARM resource ID of + * the source app. App resource ID is of the form + * /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName} + * for production slots and + * /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/slots/{slotName} + * for other slots. + * + * @param {string} [siteEnvelope.cloningInfo.hostingEnvironment] App Service + * Environment. + * + * @param {object} [siteEnvelope.cloningInfo.appSettingsOverrides] Application + * setting overrides for cloned app. If specified, these settings override the + * settings cloned + * from source app. Otherwise, application settings from source app are + * retained. + * + * @param {boolean} [siteEnvelope.cloningInfo.configureLoadBalancing] + * true to configure load balancing for source and destination + * app. + * + * @param {string} [siteEnvelope.cloningInfo.trafficManagerProfileId] ARM + * resource ID of the Traffic Manager profile to use, if it exists. Traffic + * Manager resource ID is of the form + * /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/trafficManagerProfiles/{profileName}. + * + * @param {string} [siteEnvelope.cloningInfo.trafficManagerProfileName] Name of + * Traffic Manager profile to create. This is only needed if Traffic Manager + * profile does not already exist. + * + * @param {boolean} [siteEnvelope.httpsOnly] HttpsOnly: configures a web site + * to accept only https requests. Issues redirect for + * http requests + * + * @param {object} [siteEnvelope.identity] + * + * @param {string} [siteEnvelope.identity.type] Type of managed service + * identity. Possible values include: 'SystemAssigned', 'UserAssigned' + * + * @param {array} [siteEnvelope.identity.identityIds] Array of UserAssigned + * managed service identities. + * + * @param {string} [siteEnvelope.kind] Kind of resource. + * + * @param {string} siteEnvelope.location Resource Location. + * + * @param {object} [siteEnvelope.tags] Resource tags. + * + * @param {string} slot Name of the deployment slot to create or update. By + * default, this API attempts to create or modify the production slot. + * + * @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 {Site} - 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 Site} 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. + */ + createOrUpdateSlot(resourceGroupName, name, siteEnvelope, slot, 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._createOrUpdateSlot(resourceGroupName, name, siteEnvelope, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._createOrUpdateSlot(resourceGroupName, name, siteEnvelope, slot, options, optionalCallback); + } + } + + /** + * @summary Deletes a web, mobile, or API app, or one of the deployment slots. + * + * Deletes a web, mobile, or API app, or one of the deployment slots. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app to delete. + * + * @param {string} slot Name of the deployment slot to delete. By default, the + * API deletes the production slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {boolean} [options.deleteMetrics] If true, web app metrics are also + * deleted. + * + * @param {boolean} [options.deleteEmptyServerFarm] Specify true if the App + * Service plan will be empty after app deletion and you want to delete the + * empty App Service plan. By default, the empty App Service plan is not + * deleted. + * + * @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. + */ + deleteSlotWithHttpOperationResponse(resourceGroupName, name, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._deleteSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Deletes a web, mobile, or API app, or one of the deployment slots. + * + * Deletes a web, mobile, or API app, or one of the deployment slots. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app to delete. + * + * @param {string} slot Name of the deployment slot to delete. By default, the + * API deletes the production slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {boolean} [options.deleteMetrics] If true, web app metrics are also + * deleted. + * + * @param {boolean} [options.deleteEmptyServerFarm] Specify true if the App + * Service plan will be empty after app deletion and you want to delete the + * empty App Service plan. By default, the empty App Service plan is not + * deleted. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + deleteSlot(resourceGroupName, name, slot, 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._deleteSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._deleteSlot(resourceGroupName, name, slot, options, optionalCallback); + } + } + + /** + * @summary Creates a new web, mobile, or API app in an existing resource + * group, or updates an existing app. + * + * Creates a new web, mobile, or API app in an existing resource group, or + * updates an existing app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Unique name of the app to create or update. To create + * or update a deployment slot, use the {slot} parameter. + * + * @param {object} siteEnvelope A JSON representation of the app properties. + * See example. + * + * @param {boolean} [siteEnvelope.enabled] true if the app is + * enabled; otherwise, false. Setting this value to false disables + * the app (takes the app offline). + * + * @param {array} [siteEnvelope.hostNameSslStates] Hostname SSL states are used + * to manage the SSL bindings for app's hostnames. + * + * @param {string} [siteEnvelope.serverFarmId] Resource ID of the associated + * App Service plan, formatted as: + * "/subscriptions/{subscriptionID}/resourceGroups/{groupName}/providers/Microsoft.Web/serverfarms/{appServicePlanName}". + * + * @param {boolean} [siteEnvelope.reserved] true if reserved; + * otherwise, false. + * + * @param {boolean} [siteEnvelope.isXenon] Obsolete: Hyper-V sandbox. + * + * @param {boolean} [siteEnvelope.hyperV] Hyper-V sandbox. + * + * @param {object} [siteEnvelope.siteConfig] Configuration of the app. + * + * @param {number} [siteEnvelope.siteConfig.numberOfWorkers] Number of workers. + * + * @param {array} [siteEnvelope.siteConfig.defaultDocuments] Default documents. + * + * @param {string} [siteEnvelope.siteConfig.netFrameworkVersion] .NET Framework + * version. + * + * @param {string} [siteEnvelope.siteConfig.phpVersion] Version of PHP. + * + * @param {string} [siteEnvelope.siteConfig.pythonVersion] Version of Python. + * + * @param {string} [siteEnvelope.siteConfig.nodeVersion] Version of Node.js. + * + * @param {string} [siteEnvelope.siteConfig.linuxFxVersion] Linux App Framework + * and version + * + * @param {string} [siteEnvelope.siteConfig.windowsFxVersion] Xenon App + * Framework and version + * + * @param {boolean} [siteEnvelope.siteConfig.requestTracingEnabled] + * true if request tracing is enabled; otherwise, + * false. + * + * @param {date} [siteEnvelope.siteConfig.requestTracingExpirationTime] Request + * tracing expiration time. + * + * @param {boolean} [siteEnvelope.siteConfig.remoteDebuggingEnabled] + * true if remote debugging is enabled; otherwise, + * false. + * + * @param {string} [siteEnvelope.siteConfig.remoteDebuggingVersion] Remote + * debugging version. + * + * @param {boolean} [siteEnvelope.siteConfig.httpLoggingEnabled] + * true if HTTP logging is enabled; otherwise, false. + * + * @param {number} [siteEnvelope.siteConfig.logsDirectorySizeLimit] HTTP logs + * directory size limit. + * + * @param {boolean} [siteEnvelope.siteConfig.detailedErrorLoggingEnabled] + * true if detailed error logging is enabled; otherwise, + * false. + * + * @param {string} [siteEnvelope.siteConfig.publishingUsername] Publishing user + * name. + * + * @param {array} [siteEnvelope.siteConfig.appSettings] Application settings. + * + * @param {object} [siteEnvelope.siteConfig.azureStorageAccounts] User-provided + * Azure storage accounts. + * + * @param {array} [siteEnvelope.siteConfig.connectionStrings] Connection + * strings. + * + * @param {array} [siteEnvelope.siteConfig.handlerMappings] Handler mappings. + * + * @param {string} [siteEnvelope.siteConfig.documentRoot] Document root. + * + * @param {string} [siteEnvelope.siteConfig.scmType] SCM type. Possible values + * include: 'None', 'Dropbox', 'Tfs', 'LocalGit', 'GitHub', 'CodePlexGit', + * 'CodePlexHg', 'BitbucketGit', 'BitbucketHg', 'ExternalGit', 'ExternalHg', + * 'OneDrive', 'VSO' + * + * @param {boolean} [siteEnvelope.siteConfig.use32BitWorkerProcess] + * true to use 32-bit worker process; otherwise, + * false. + * + * @param {boolean} [siteEnvelope.siteConfig.webSocketsEnabled] + * true if WebSocket is enabled; otherwise, false. + * + * @param {boolean} [siteEnvelope.siteConfig.alwaysOn] true if + * Always On is enabled; otherwise, false. + * + * @param {string} [siteEnvelope.siteConfig.javaVersion] Java version. + * + * @param {string} [siteEnvelope.siteConfig.javaContainer] Java container. + * + * @param {string} [siteEnvelope.siteConfig.javaContainerVersion] Java + * container version. + * + * @param {string} [siteEnvelope.siteConfig.appCommandLine] App command line to + * launch. + * + * @param {string} [siteEnvelope.siteConfig.managedPipelineMode] Managed + * pipeline mode. Possible values include: 'Integrated', 'Classic' + * + * @param {array} [siteEnvelope.siteConfig.virtualApplications] Virtual + * applications. + * + * @param {string} [siteEnvelope.siteConfig.loadBalancing] Site load balancing. + * Possible values include: 'WeightedRoundRobin', 'LeastRequests', + * 'LeastResponseTime', 'WeightedTotalTraffic', 'RequestHash' + * + * @param {object} [siteEnvelope.siteConfig.experiments] This is work around + * for polymophic types. + * + * @param {array} [siteEnvelope.siteConfig.experiments.rampUpRules] List of + * ramp-up rules. + * + * @param {object} [siteEnvelope.siteConfig.limits] Site limits. + * + * @param {number} [siteEnvelope.siteConfig.limits.maxPercentageCpu] Maximum + * allowed CPU usage percentage. + * + * @param {number} [siteEnvelope.siteConfig.limits.maxMemoryInMb] Maximum + * allowed memory usage in MB. + * + * @param {number} [siteEnvelope.siteConfig.limits.maxDiskSizeInMb] Maximum + * allowed disk size usage in MB. + * + * @param {boolean} [siteEnvelope.siteConfig.autoHealEnabled] true + * if Auto Heal is enabled; otherwise, false. + * + * @param {object} [siteEnvelope.siteConfig.autoHealRules] Auto Heal rules. + * + * @param {object} [siteEnvelope.siteConfig.autoHealRules.triggers] Conditions + * that describe when to execute the auto-heal actions. + * + * @param {object} [siteEnvelope.siteConfig.autoHealRules.triggers.requests] A + * rule based on total requests. + * + * @param {number} + * [siteEnvelope.siteConfig.autoHealRules.triggers.requests.count] Request + * Count. + * + * @param {string} + * [siteEnvelope.siteConfig.autoHealRules.triggers.requests.timeInterval] Time + * interval. + * + * @param {number} + * [siteEnvelope.siteConfig.autoHealRules.triggers.privateBytesInKB] A rule + * based on private bytes. + * + * @param {array} [siteEnvelope.siteConfig.autoHealRules.triggers.statusCodes] + * A rule based on status codes. + * + * @param {object} + * [siteEnvelope.siteConfig.autoHealRules.triggers.slowRequests] A rule based + * on request execution time. + * + * @param {string} + * [siteEnvelope.siteConfig.autoHealRules.triggers.slowRequests.timeTaken] Time + * taken. + * + * @param {number} + * [siteEnvelope.siteConfig.autoHealRules.triggers.slowRequests.count] Request + * Count. + * + * @param {string} + * [siteEnvelope.siteConfig.autoHealRules.triggers.slowRequests.timeInterval] + * Time interval. + * + * @param {object} [siteEnvelope.siteConfig.autoHealRules.actions] Actions to + * be executed when a rule is triggered. + * + * @param {string} [siteEnvelope.siteConfig.autoHealRules.actions.actionType] + * Predefined action to be taken. Possible values include: 'Recycle', + * 'LogEvent', 'CustomAction' + * + * @param {object} [siteEnvelope.siteConfig.autoHealRules.actions.customAction] + * Custom action to be taken. + * + * @param {string} + * [siteEnvelope.siteConfig.autoHealRules.actions.customAction.exe] Executable + * to be run. + * + * @param {string} + * [siteEnvelope.siteConfig.autoHealRules.actions.customAction.parameters] + * Parameters for the executable. + * + * @param {string} + * [siteEnvelope.siteConfig.autoHealRules.actions.minProcessExecutionTime] + * Minimum time the process must execute + * before taking the action + * + * @param {string} [siteEnvelope.siteConfig.tracingOptions] Tracing options. + * + * @param {string} [siteEnvelope.siteConfig.vnetName] Virtual Network name. + * + * @param {object} [siteEnvelope.siteConfig.cors] Cross-Origin Resource Sharing + * (CORS) settings. + * + * @param {array} [siteEnvelope.siteConfig.cors.allowedOrigins] Gets or sets + * the list of origins that should be allowed to make cross-origin + * calls (for example: http://example.com:12345). Use "*" to allow all. + * + * @param {object} [siteEnvelope.siteConfig.push] Push endpoint settings. + * + * @param {boolean} siteEnvelope.siteConfig.push.isPushEnabled Gets or sets a + * flag indicating whether the Push endpoint is enabled. + * + * @param {string} [siteEnvelope.siteConfig.push.tagWhitelistJson] Gets or sets + * a JSON string containing a list of tags that are whitelisted for use by the + * push registration endpoint. + * + * @param {string} [siteEnvelope.siteConfig.push.tagsRequiringAuth] Gets or + * sets a JSON string containing a list of tags that require user + * authentication to be used in the push registration endpoint. + * Tags can consist of alphanumeric characters and the following: + * '_', '@', '#', '.', ':', '-'. + * Validation should be performed at the PushRequestHandler. + * + * @param {string} [siteEnvelope.siteConfig.push.dynamicTagsJson] Gets or sets + * a JSON string containing a list of dynamic tags that will be evaluated from + * user claims in the push registration endpoint. + * + * @param {string} [siteEnvelope.siteConfig.push.kind] Kind of resource. + * + * @param {object} [siteEnvelope.siteConfig.apiDefinition] Information about + * the formal API definition for the app. + * + * @param {string} [siteEnvelope.siteConfig.apiDefinition.url] The URL of the + * API definition. + * + * @param {string} [siteEnvelope.siteConfig.autoSwapSlotName] Auto-swap slot + * name. + * + * @param {boolean} [siteEnvelope.siteConfig.localMySqlEnabled] + * true to enable local MySQL; otherwise, false. + * + * @param {number} [siteEnvelope.siteConfig.managedServiceIdentityId] Managed + * Service Identity Id + * + * @param {number} [siteEnvelope.siteConfig.xManagedServiceIdentityId] Explicit + * Managed Service Identity Id + * + * @param {array} [siteEnvelope.siteConfig.ipSecurityRestrictions] IP security + * restrictions. + * + * @param {boolean} [siteEnvelope.siteConfig.http20Enabled] Http20Enabled: + * configures a web site to allow clients to connect over http2.0 + * + * @param {string} [siteEnvelope.siteConfig.minTlsVersion] MinTlsVersion: + * configures the minimum version of TLS required for SSL requests. Possible + * values include: '1.0', '1.1', '1.2' + * + * @param {string} [siteEnvelope.siteConfig.ftpsState] State of FTP / FTPS + * service. Possible values include: 'AllAllowed', 'FtpsOnly', 'Disabled' + * + * @param {number} [siteEnvelope.siteConfig.reservedInstanceCount] Number of + * reserved instances. + * This setting only applies to the Consumption Plan + * + * @param {boolean} [siteEnvelope.scmSiteAlsoStopped] true to stop + * SCM (KUDU) site when the app is stopped; otherwise, false. The + * default is false. + * + * @param {object} [siteEnvelope.hostingEnvironmentProfile] App Service + * Environment to use for the app. + * + * @param {string} [siteEnvelope.hostingEnvironmentProfile.id] Resource ID of + * the App Service Environment. + * + * @param {boolean} [siteEnvelope.clientAffinityEnabled] true to + * enable client affinity; false to stop sending session affinity + * cookies, which route client requests in the same session to the same + * instance. Default is true. + * + * @param {boolean} [siteEnvelope.clientCertEnabled] true to + * enable client certificate authentication (TLS mutual authentication); + * otherwise, false. Default is false. + * + * @param {boolean} [siteEnvelope.hostNamesDisabled] true to + * disable the public hostnames of the app; otherwise, false. + * If true, the app is only accessible via API management process. + * + * @param {number} [siteEnvelope.containerSize] Size of the function container. + * + * @param {number} [siteEnvelope.dailyMemoryTimeQuota] Maximum allowed daily + * memory-time quota (applicable on dynamic apps only). + * + * @param {object} [siteEnvelope.cloningInfo] If specified during app creation, + * the app is cloned from a source app. + * + * @param {uuid} [siteEnvelope.cloningInfo.correlationId] Correlation ID of + * cloning operation. This ID ties multiple cloning operations + * together to use the same snapshot. + * + * @param {boolean} [siteEnvelope.cloningInfo.overwrite] true to + * overwrite destination app; otherwise, false. + * + * @param {boolean} [siteEnvelope.cloningInfo.cloneCustomHostNames] + * true to clone custom hostnames from source app; otherwise, + * false. + * + * @param {boolean} [siteEnvelope.cloningInfo.cloneSourceControl] + * true to clone source control from source app; otherwise, + * false. + * + * @param {string} siteEnvelope.cloningInfo.sourceWebAppId ARM resource ID of + * the source app. App resource ID is of the form + * /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName} + * for production slots and + * /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/slots/{slotName} + * for other slots. + * + * @param {string} [siteEnvelope.cloningInfo.hostingEnvironment] App Service + * Environment. + * + * @param {object} [siteEnvelope.cloningInfo.appSettingsOverrides] Application + * setting overrides for cloned app. If specified, these settings override the + * settings cloned + * from source app. Otherwise, application settings from source app are + * retained. + * + * @param {boolean} [siteEnvelope.cloningInfo.configureLoadBalancing] + * true to configure load balancing for source and destination + * app. + * + * @param {string} [siteEnvelope.cloningInfo.trafficManagerProfileId] ARM + * resource ID of the Traffic Manager profile to use, if it exists. Traffic + * Manager resource ID is of the form + * /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/trafficManagerProfiles/{profileName}. + * + * @param {string} [siteEnvelope.cloningInfo.trafficManagerProfileName] Name of + * Traffic Manager profile to create. This is only needed if Traffic Manager + * profile does not already exist. + * + * @param {boolean} [siteEnvelope.httpsOnly] HttpsOnly: configures a web site + * to accept only https requests. Issues redirect for + * http requests + * + * @param {string} [siteEnvelope.kind] Kind of resource. + * + * @param {string} slot Name of the deployment slot to create or update. By + * default, this API attempts to create or modify the production slot. + * + * @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. + */ + updateSlotWithHttpOperationResponse(resourceGroupName, name, siteEnvelope, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._updateSlot(resourceGroupName, name, siteEnvelope, slot, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Creates a new web, mobile, or API app in an existing resource + * group, or updates an existing app. + * + * Creates a new web, mobile, or API app in an existing resource group, or + * updates an existing app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Unique name of the app to create or update. To create + * or update a deployment slot, use the {slot} parameter. + * + * @param {object} siteEnvelope A JSON representation of the app properties. + * See example. + * + * @param {boolean} [siteEnvelope.enabled] true if the app is + * enabled; otherwise, false. Setting this value to false disables + * the app (takes the app offline). + * + * @param {array} [siteEnvelope.hostNameSslStates] Hostname SSL states are used + * to manage the SSL bindings for app's hostnames. + * + * @param {string} [siteEnvelope.serverFarmId] Resource ID of the associated + * App Service plan, formatted as: + * "/subscriptions/{subscriptionID}/resourceGroups/{groupName}/providers/Microsoft.Web/serverfarms/{appServicePlanName}". + * + * @param {boolean} [siteEnvelope.reserved] true if reserved; + * otherwise, false. + * + * @param {boolean} [siteEnvelope.isXenon] Obsolete: Hyper-V sandbox. + * + * @param {boolean} [siteEnvelope.hyperV] Hyper-V sandbox. + * + * @param {object} [siteEnvelope.siteConfig] Configuration of the app. + * + * @param {number} [siteEnvelope.siteConfig.numberOfWorkers] Number of workers. + * + * @param {array} [siteEnvelope.siteConfig.defaultDocuments] Default documents. + * + * @param {string} [siteEnvelope.siteConfig.netFrameworkVersion] .NET Framework + * version. + * + * @param {string} [siteEnvelope.siteConfig.phpVersion] Version of PHP. + * + * @param {string} [siteEnvelope.siteConfig.pythonVersion] Version of Python. + * + * @param {string} [siteEnvelope.siteConfig.nodeVersion] Version of Node.js. + * + * @param {string} [siteEnvelope.siteConfig.linuxFxVersion] Linux App Framework + * and version + * + * @param {string} [siteEnvelope.siteConfig.windowsFxVersion] Xenon App + * Framework and version + * + * @param {boolean} [siteEnvelope.siteConfig.requestTracingEnabled] + * true if request tracing is enabled; otherwise, + * false. + * + * @param {date} [siteEnvelope.siteConfig.requestTracingExpirationTime] Request + * tracing expiration time. + * + * @param {boolean} [siteEnvelope.siteConfig.remoteDebuggingEnabled] + * true if remote debugging is enabled; otherwise, + * false. + * + * @param {string} [siteEnvelope.siteConfig.remoteDebuggingVersion] Remote + * debugging version. + * + * @param {boolean} [siteEnvelope.siteConfig.httpLoggingEnabled] + * true if HTTP logging is enabled; otherwise, false. + * + * @param {number} [siteEnvelope.siteConfig.logsDirectorySizeLimit] HTTP logs + * directory size limit. + * + * @param {boolean} [siteEnvelope.siteConfig.detailedErrorLoggingEnabled] + * true if detailed error logging is enabled; otherwise, + * false. + * + * @param {string} [siteEnvelope.siteConfig.publishingUsername] Publishing user + * name. + * + * @param {array} [siteEnvelope.siteConfig.appSettings] Application settings. + * + * @param {object} [siteEnvelope.siteConfig.azureStorageAccounts] User-provided + * Azure storage accounts. + * + * @param {array} [siteEnvelope.siteConfig.connectionStrings] Connection + * strings. + * + * @param {array} [siteEnvelope.siteConfig.handlerMappings] Handler mappings. + * + * @param {string} [siteEnvelope.siteConfig.documentRoot] Document root. + * + * @param {string} [siteEnvelope.siteConfig.scmType] SCM type. Possible values + * include: 'None', 'Dropbox', 'Tfs', 'LocalGit', 'GitHub', 'CodePlexGit', + * 'CodePlexHg', 'BitbucketGit', 'BitbucketHg', 'ExternalGit', 'ExternalHg', + * 'OneDrive', 'VSO' + * + * @param {boolean} [siteEnvelope.siteConfig.use32BitWorkerProcess] + * true to use 32-bit worker process; otherwise, + * false. + * + * @param {boolean} [siteEnvelope.siteConfig.webSocketsEnabled] + * true if WebSocket is enabled; otherwise, false. + * + * @param {boolean} [siteEnvelope.siteConfig.alwaysOn] true if + * Always On is enabled; otherwise, false. + * + * @param {string} [siteEnvelope.siteConfig.javaVersion] Java version. + * + * @param {string} [siteEnvelope.siteConfig.javaContainer] Java container. + * + * @param {string} [siteEnvelope.siteConfig.javaContainerVersion] Java + * container version. + * + * @param {string} [siteEnvelope.siteConfig.appCommandLine] App command line to + * launch. + * + * @param {string} [siteEnvelope.siteConfig.managedPipelineMode] Managed + * pipeline mode. Possible values include: 'Integrated', 'Classic' + * + * @param {array} [siteEnvelope.siteConfig.virtualApplications] Virtual + * applications. + * + * @param {string} [siteEnvelope.siteConfig.loadBalancing] Site load balancing. + * Possible values include: 'WeightedRoundRobin', 'LeastRequests', + * 'LeastResponseTime', 'WeightedTotalTraffic', 'RequestHash' + * + * @param {object} [siteEnvelope.siteConfig.experiments] This is work around + * for polymophic types. + * + * @param {array} [siteEnvelope.siteConfig.experiments.rampUpRules] List of + * ramp-up rules. + * + * @param {object} [siteEnvelope.siteConfig.limits] Site limits. + * + * @param {number} [siteEnvelope.siteConfig.limits.maxPercentageCpu] Maximum + * allowed CPU usage percentage. + * + * @param {number} [siteEnvelope.siteConfig.limits.maxMemoryInMb] Maximum + * allowed memory usage in MB. + * + * @param {number} [siteEnvelope.siteConfig.limits.maxDiskSizeInMb] Maximum + * allowed disk size usage in MB. + * + * @param {boolean} [siteEnvelope.siteConfig.autoHealEnabled] true + * if Auto Heal is enabled; otherwise, false. + * + * @param {object} [siteEnvelope.siteConfig.autoHealRules] Auto Heal rules. + * + * @param {object} [siteEnvelope.siteConfig.autoHealRules.triggers] Conditions + * that describe when to execute the auto-heal actions. + * + * @param {object} [siteEnvelope.siteConfig.autoHealRules.triggers.requests] A + * rule based on total requests. + * + * @param {number} + * [siteEnvelope.siteConfig.autoHealRules.triggers.requests.count] Request + * Count. + * + * @param {string} + * [siteEnvelope.siteConfig.autoHealRules.triggers.requests.timeInterval] Time + * interval. + * + * @param {number} + * [siteEnvelope.siteConfig.autoHealRules.triggers.privateBytesInKB] A rule + * based on private bytes. + * + * @param {array} [siteEnvelope.siteConfig.autoHealRules.triggers.statusCodes] + * A rule based on status codes. + * + * @param {object} + * [siteEnvelope.siteConfig.autoHealRules.triggers.slowRequests] A rule based + * on request execution time. + * + * @param {string} + * [siteEnvelope.siteConfig.autoHealRules.triggers.slowRequests.timeTaken] Time + * taken. + * + * @param {number} + * [siteEnvelope.siteConfig.autoHealRules.triggers.slowRequests.count] Request + * Count. + * + * @param {string} + * [siteEnvelope.siteConfig.autoHealRules.triggers.slowRequests.timeInterval] + * Time interval. + * + * @param {object} [siteEnvelope.siteConfig.autoHealRules.actions] Actions to + * be executed when a rule is triggered. + * + * @param {string} [siteEnvelope.siteConfig.autoHealRules.actions.actionType] + * Predefined action to be taken. Possible values include: 'Recycle', + * 'LogEvent', 'CustomAction' + * + * @param {object} [siteEnvelope.siteConfig.autoHealRules.actions.customAction] + * Custom action to be taken. + * + * @param {string} + * [siteEnvelope.siteConfig.autoHealRules.actions.customAction.exe] Executable + * to be run. + * + * @param {string} + * [siteEnvelope.siteConfig.autoHealRules.actions.customAction.parameters] + * Parameters for the executable. + * + * @param {string} + * [siteEnvelope.siteConfig.autoHealRules.actions.minProcessExecutionTime] + * Minimum time the process must execute + * before taking the action + * + * @param {string} [siteEnvelope.siteConfig.tracingOptions] Tracing options. + * + * @param {string} [siteEnvelope.siteConfig.vnetName] Virtual Network name. + * + * @param {object} [siteEnvelope.siteConfig.cors] Cross-Origin Resource Sharing + * (CORS) settings. + * + * @param {array} [siteEnvelope.siteConfig.cors.allowedOrigins] Gets or sets + * the list of origins that should be allowed to make cross-origin + * calls (for example: http://example.com:12345). Use "*" to allow all. + * + * @param {object} [siteEnvelope.siteConfig.push] Push endpoint settings. + * + * @param {boolean} siteEnvelope.siteConfig.push.isPushEnabled Gets or sets a + * flag indicating whether the Push endpoint is enabled. + * + * @param {string} [siteEnvelope.siteConfig.push.tagWhitelistJson] Gets or sets + * a JSON string containing a list of tags that are whitelisted for use by the + * push registration endpoint. + * + * @param {string} [siteEnvelope.siteConfig.push.tagsRequiringAuth] Gets or + * sets a JSON string containing a list of tags that require user + * authentication to be used in the push registration endpoint. + * Tags can consist of alphanumeric characters and the following: + * '_', '@', '#', '.', ':', '-'. + * Validation should be performed at the PushRequestHandler. + * + * @param {string} [siteEnvelope.siteConfig.push.dynamicTagsJson] Gets or sets + * a JSON string containing a list of dynamic tags that will be evaluated from + * user claims in the push registration endpoint. + * + * @param {string} [siteEnvelope.siteConfig.push.kind] Kind of resource. + * + * @param {object} [siteEnvelope.siteConfig.apiDefinition] Information about + * the formal API definition for the app. + * + * @param {string} [siteEnvelope.siteConfig.apiDefinition.url] The URL of the + * API definition. + * + * @param {string} [siteEnvelope.siteConfig.autoSwapSlotName] Auto-swap slot + * name. + * + * @param {boolean} [siteEnvelope.siteConfig.localMySqlEnabled] + * true to enable local MySQL; otherwise, false. + * + * @param {number} [siteEnvelope.siteConfig.managedServiceIdentityId] Managed + * Service Identity Id + * + * @param {number} [siteEnvelope.siteConfig.xManagedServiceIdentityId] Explicit + * Managed Service Identity Id + * + * @param {array} [siteEnvelope.siteConfig.ipSecurityRestrictions] IP security + * restrictions. + * + * @param {boolean} [siteEnvelope.siteConfig.http20Enabled] Http20Enabled: + * configures a web site to allow clients to connect over http2.0 + * + * @param {string} [siteEnvelope.siteConfig.minTlsVersion] MinTlsVersion: + * configures the minimum version of TLS required for SSL requests. Possible + * values include: '1.0', '1.1', '1.2' + * + * @param {string} [siteEnvelope.siteConfig.ftpsState] State of FTP / FTPS + * service. Possible values include: 'AllAllowed', 'FtpsOnly', 'Disabled' + * + * @param {number} [siteEnvelope.siteConfig.reservedInstanceCount] Number of + * reserved instances. + * This setting only applies to the Consumption Plan + * + * @param {boolean} [siteEnvelope.scmSiteAlsoStopped] true to stop + * SCM (KUDU) site when the app is stopped; otherwise, false. The + * default is false. + * + * @param {object} [siteEnvelope.hostingEnvironmentProfile] App Service + * Environment to use for the app. + * + * @param {string} [siteEnvelope.hostingEnvironmentProfile.id] Resource ID of + * the App Service Environment. + * + * @param {boolean} [siteEnvelope.clientAffinityEnabled] true to + * enable client affinity; false to stop sending session affinity + * cookies, which route client requests in the same session to the same + * instance. Default is true. + * + * @param {boolean} [siteEnvelope.clientCertEnabled] true to + * enable client certificate authentication (TLS mutual authentication); + * otherwise, false. Default is false. + * + * @param {boolean} [siteEnvelope.hostNamesDisabled] true to + * disable the public hostnames of the app; otherwise, false. + * If true, the app is only accessible via API management process. + * + * @param {number} [siteEnvelope.containerSize] Size of the function container. + * + * @param {number} [siteEnvelope.dailyMemoryTimeQuota] Maximum allowed daily + * memory-time quota (applicable on dynamic apps only). + * + * @param {object} [siteEnvelope.cloningInfo] If specified during app creation, + * the app is cloned from a source app. + * + * @param {uuid} [siteEnvelope.cloningInfo.correlationId] Correlation ID of + * cloning operation. This ID ties multiple cloning operations + * together to use the same snapshot. + * + * @param {boolean} [siteEnvelope.cloningInfo.overwrite] true to + * overwrite destination app; otherwise, false. + * + * @param {boolean} [siteEnvelope.cloningInfo.cloneCustomHostNames] + * true to clone custom hostnames from source app; otherwise, + * false. + * + * @param {boolean} [siteEnvelope.cloningInfo.cloneSourceControl] + * true to clone source control from source app; otherwise, + * false. + * + * @param {string} siteEnvelope.cloningInfo.sourceWebAppId ARM resource ID of + * the source app. App resource ID is of the form + * /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName} + * for production slots and + * /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/slots/{slotName} + * for other slots. + * + * @param {string} [siteEnvelope.cloningInfo.hostingEnvironment] App Service + * Environment. + * + * @param {object} [siteEnvelope.cloningInfo.appSettingsOverrides] Application + * setting overrides for cloned app. If specified, these settings override the + * settings cloned + * from source app. Otherwise, application settings from source app are + * retained. + * + * @param {boolean} [siteEnvelope.cloningInfo.configureLoadBalancing] + * true to configure load balancing for source and destination + * app. + * + * @param {string} [siteEnvelope.cloningInfo.trafficManagerProfileId] ARM + * resource ID of the Traffic Manager profile to use, if it exists. Traffic + * Manager resource ID is of the form + * /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/trafficManagerProfiles/{profileName}. + * + * @param {string} [siteEnvelope.cloningInfo.trafficManagerProfileName] Name of + * Traffic Manager profile to create. This is only needed if Traffic Manager + * profile does not already exist. + * + * @param {boolean} [siteEnvelope.httpsOnly] HttpsOnly: configures a web site + * to accept only https requests. Issues redirect for + * http requests + * + * @param {string} [siteEnvelope.kind] Kind of resource. + * + * @param {string} slot Name of the deployment slot to create or update. By + * default, this API attempts to create or modify the production slot. + * + * @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 {Site} - 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 Site} 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. + */ + updateSlot(resourceGroupName, name, siteEnvelope, slot, 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._updateSlot(resourceGroupName, name, siteEnvelope, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._updateSlot(resourceGroupName, name, siteEnvelope, slot, options, optionalCallback); + } + } + + /** + * @summary Analyze a custom hostname. + * + * Analyze a custom hostname. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {string} slot Name of web app slot. If not specified then will + * default to production slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.hostName] Custom hostname. + * + * @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. + */ + analyzeCustomHostnameSlotWithHttpOperationResponse(resourceGroupName, name, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._analyzeCustomHostnameSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Analyze a custom hostname. + * + * Analyze a custom hostname. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {string} slot Name of web app slot. If not specified then will + * default to production slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.hostName] Custom hostname. + * + * @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 {CustomHostnameAnalysisResult} - 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 CustomHostnameAnalysisResult} 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. + */ + analyzeCustomHostnameSlot(resourceGroupName, name, slot, 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._analyzeCustomHostnameSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._analyzeCustomHostnameSlot(resourceGroupName, name, slot, options, optionalCallback); + } + } + + /** + * @summary Applies the configuration settings from the target slot onto the + * current slot. + * + * Applies the configuration settings from the target slot onto the current + * slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} slotSwapEntity JSON object that contains the target slot + * name. See example. + * + * @param {string} slotSwapEntity.targetSlot Destination deployment slot during + * swap operation. + * + * @param {boolean} slotSwapEntity.preserveVnet true to preserve + * Virtual Network to the slot during swap; otherwise, false. + * + * @param {string} slot Name of the source slot. If a slot is not specified, + * the production slot is used as the source slot. + * + * @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. + */ + applySlotConfigurationSlotWithHttpOperationResponse(resourceGroupName, name, slotSwapEntity, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._applySlotConfigurationSlot(resourceGroupName, name, slotSwapEntity, slot, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Applies the configuration settings from the target slot onto the + * current slot. + * + * Applies the configuration settings from the target slot onto the current + * slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} slotSwapEntity JSON object that contains the target slot + * name. See example. + * + * @param {string} slotSwapEntity.targetSlot Destination deployment slot during + * swap operation. + * + * @param {boolean} slotSwapEntity.preserveVnet true to preserve + * Virtual Network to the slot during swap; otherwise, false. + * + * @param {string} slot Name of the source slot. If a slot is not specified, + * the production slot is used as the source slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + applySlotConfigurationSlot(resourceGroupName, name, slotSwapEntity, slot, 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._applySlotConfigurationSlot(resourceGroupName, name, slotSwapEntity, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._applySlotConfigurationSlot(resourceGroupName, name, slotSwapEntity, slot, options, optionalCallback); + } + } + + /** + * @summary Creates a backup of an app. + * + * Creates a backup of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} request Backup configuration. You can use the JSON response + * from the POST action as input here. + * + * @param {string} [request.backupName] Name of the backup. + * + * @param {boolean} [request.enabled] True if the backup schedule is enabled + * (must be included in that case), false if the backup schedule should be + * disabled. + * + * @param {string} request.storageAccountUrl SAS URL to the container. + * + * @param {object} [request.backupSchedule] Schedule for the backup if it is + * executed periodically. + * + * @param {number} request.backupSchedule.frequencyInterval How often the + * backup should be executed (e.g. for weekly backup, this should be set to 7 + * and FrequencyUnit should be set to Day) + * + * @param {string} request.backupSchedule.frequencyUnit The unit of time for + * how often the backup should be executed (e.g. for weekly backup, this should + * be set to Day and FrequencyInterval should be set to 7). Possible values + * include: 'Day', 'Hour' + * + * @param {boolean} request.backupSchedule.keepAtLeastOneBackup True if the + * retention policy should always keep at least one backup in the storage + * account, regardless how old it is; false otherwise. + * + * @param {number} request.backupSchedule.retentionPeriodInDays After how many + * days backups should be deleted. + * + * @param {date} [request.backupSchedule.startTime] When the schedule should + * start working. + * + * @param {array} [request.databases] Databases included in the backup. + * + * @param {string} [request.kind] Kind of resource. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will create a backup for the production slot. + * + * @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. + */ + backupSlotWithHttpOperationResponse(resourceGroupName, name, request, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._backupSlot(resourceGroupName, name, request, slot, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Creates a backup of an app. + * + * Creates a backup of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} request Backup configuration. You can use the JSON response + * from the POST action as input here. + * + * @param {string} [request.backupName] Name of the backup. + * + * @param {boolean} [request.enabled] True if the backup schedule is enabled + * (must be included in that case), false if the backup schedule should be + * disabled. + * + * @param {string} request.storageAccountUrl SAS URL to the container. + * + * @param {object} [request.backupSchedule] Schedule for the backup if it is + * executed periodically. + * + * @param {number} request.backupSchedule.frequencyInterval How often the + * backup should be executed (e.g. for weekly backup, this should be set to 7 + * and FrequencyUnit should be set to Day) + * + * @param {string} request.backupSchedule.frequencyUnit The unit of time for + * how often the backup should be executed (e.g. for weekly backup, this should + * be set to Day and FrequencyInterval should be set to 7). Possible values + * include: 'Day', 'Hour' + * + * @param {boolean} request.backupSchedule.keepAtLeastOneBackup True if the + * retention policy should always keep at least one backup in the storage + * account, regardless how old it is; false otherwise. + * + * @param {number} request.backupSchedule.retentionPeriodInDays After how many + * days backups should be deleted. + * + * @param {date} [request.backupSchedule.startTime] When the schedule should + * start working. + * + * @param {array} [request.databases] Databases included in the backup. + * + * @param {string} [request.kind] Kind of resource. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will create a backup for the production slot. + * + * @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 {BackupItem} - 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 BackupItem} 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. + */ + backupSlot(resourceGroupName, name, request, slot, 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._backupSlot(resourceGroupName, name, request, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._backupSlot(resourceGroupName, name, request, slot, options, optionalCallback); + } + } + + /** + * @summary Gets existing backups of an app. + * + * Gets existing backups of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will get backups of the production slot. + * + * @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. + */ + listBackupsSlotWithHttpOperationResponse(resourceGroupName, name, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listBackupsSlot(resourceGroupName, name, slot, 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 existing backups of an app. + * + * Gets existing backups of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will get backups of the production slot. + * + * @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 {BackupItemCollection} - 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 BackupItemCollection} 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. + */ + listBackupsSlot(resourceGroupName, name, slot, 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._listBackupsSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listBackupsSlot(resourceGroupName, name, slot, options, optionalCallback); + } + } + + /** + * @summary Gets a backup of an app by its ID. + * + * Gets a backup of an app by its ID. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} backupId ID of the backup. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will get a backup of the production slot. + * + * @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. + */ + getBackupStatusSlotWithHttpOperationResponse(resourceGroupName, name, backupId, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._getBackupStatusSlot(resourceGroupName, name, backupId, slot, 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 backup of an app by its ID. + * + * Gets a backup of an app by its ID. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} backupId ID of the backup. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will get a backup of the production slot. + * + * @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 {BackupItem} - 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 BackupItem} 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. + */ + getBackupStatusSlot(resourceGroupName, name, backupId, slot, 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._getBackupStatusSlot(resourceGroupName, name, backupId, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getBackupStatusSlot(resourceGroupName, name, backupId, slot, options, optionalCallback); + } + } + + /** + * @summary Deletes a backup of an app by its ID. + * + * Deletes a backup of an app by its ID. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} backupId ID of the backup. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will delete a backup of the production slot. + * + * @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. + */ + deleteBackupSlotWithHttpOperationResponse(resourceGroupName, name, backupId, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._deleteBackupSlot(resourceGroupName, name, backupId, slot, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Deletes a backup of an app by its ID. + * + * Deletes a backup of an app by its ID. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} backupId ID of the backup. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will delete a backup of the production slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + deleteBackupSlot(resourceGroupName, name, backupId, slot, 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._deleteBackupSlot(resourceGroupName, name, backupId, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._deleteBackupSlot(resourceGroupName, name, backupId, slot, options, optionalCallback); + } + } + + /** + * @summary Gets status of a web app backup that may be in progress, including + * secrets associated with the backup, such as the Azure Storage SAS URL. Also + * can be used to update the SAS URL for the backup if a new URL is passed in + * the request body. + * + * Gets status of a web app backup that may be in progress, including secrets + * associated with the backup, such as the Azure Storage SAS URL. Also can be + * used to update the SAS URL for the backup if a new URL is passed in the + * request body. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {string} backupId ID of backup. + * + * @param {object} request Information on backup request. + * + * @param {string} [request.backupName] Name of the backup. + * + * @param {boolean} [request.enabled] True if the backup schedule is enabled + * (must be included in that case), false if the backup schedule should be + * disabled. + * + * @param {string} request.storageAccountUrl SAS URL to the container. + * + * @param {object} [request.backupSchedule] Schedule for the backup if it is + * executed periodically. + * + * @param {number} request.backupSchedule.frequencyInterval How often the + * backup should be executed (e.g. for weekly backup, this should be set to 7 + * and FrequencyUnit should be set to Day) + * + * @param {string} request.backupSchedule.frequencyUnit The unit of time for + * how often the backup should be executed (e.g. for weekly backup, this should + * be set to Day and FrequencyInterval should be set to 7). Possible values + * include: 'Day', 'Hour' + * + * @param {boolean} request.backupSchedule.keepAtLeastOneBackup True if the + * retention policy should always keep at least one backup in the storage + * account, regardless how old it is; false otherwise. + * + * @param {number} request.backupSchedule.retentionPeriodInDays After how many + * days backups should be deleted. + * + * @param {date} [request.backupSchedule.startTime] When the schedule should + * start working. + * + * @param {array} [request.databases] Databases included in the backup. + * + * @param {string} [request.kind] Kind of resource. + * + * @param {string} slot Name of web app slot. If not specified then will + * default to production slot. + * + * @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. + */ + listBackupStatusSecretsSlotWithHttpOperationResponse(resourceGroupName, name, backupId, request, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listBackupStatusSecretsSlot(resourceGroupName, name, backupId, request, slot, 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 status of a web app backup that may be in progress, including + * secrets associated with the backup, such as the Azure Storage SAS URL. Also + * can be used to update the SAS URL for the backup if a new URL is passed in + * the request body. + * + * Gets status of a web app backup that may be in progress, including secrets + * associated with the backup, such as the Azure Storage SAS URL. Also can be + * used to update the SAS URL for the backup if a new URL is passed in the + * request body. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {string} backupId ID of backup. + * + * @param {object} request Information on backup request. + * + * @param {string} [request.backupName] Name of the backup. + * + * @param {boolean} [request.enabled] True if the backup schedule is enabled + * (must be included in that case), false if the backup schedule should be + * disabled. + * + * @param {string} request.storageAccountUrl SAS URL to the container. + * + * @param {object} [request.backupSchedule] Schedule for the backup if it is + * executed periodically. + * + * @param {number} request.backupSchedule.frequencyInterval How often the + * backup should be executed (e.g. for weekly backup, this should be set to 7 + * and FrequencyUnit should be set to Day) + * + * @param {string} request.backupSchedule.frequencyUnit The unit of time for + * how often the backup should be executed (e.g. for weekly backup, this should + * be set to Day and FrequencyInterval should be set to 7). Possible values + * include: 'Day', 'Hour' + * + * @param {boolean} request.backupSchedule.keepAtLeastOneBackup True if the + * retention policy should always keep at least one backup in the storage + * account, regardless how old it is; false otherwise. + * + * @param {number} request.backupSchedule.retentionPeriodInDays After how many + * days backups should be deleted. + * + * @param {date} [request.backupSchedule.startTime] When the schedule should + * start working. + * + * @param {array} [request.databases] Databases included in the backup. + * + * @param {string} [request.kind] Kind of resource. + * + * @param {string} slot Name of web app slot. If not specified then will + * default to production slot. + * + * @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 {BackupItem} - 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 BackupItem} 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. + */ + listBackupStatusSecretsSlot(resourceGroupName, name, backupId, request, slot, 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._listBackupStatusSecretsSlot(resourceGroupName, name, backupId, request, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listBackupStatusSecretsSlot(resourceGroupName, name, backupId, request, slot, options, optionalCallback); + } + } + + /** + * @summary Restores a specific backup to another app (or deployment slot, if + * specified). + * + * Restores a specific backup to another app (or deployment slot, if + * specified). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} backupId ID of the backup. + * + * @param {object} request Information on restore request . + * + * @param {string} request.storageAccountUrl SAS URL to the container. + * + * @param {string} [request.blobName] Name of a blob which contains the backup. + * + * @param {boolean} request.overwrite true if the restore + * operation can overwrite target app; otherwise, false. + * true is needed if trying to restore over an existing app. + * + * @param {string} [request.siteName] Name of an app. + * + * @param {array} [request.databases] Collection of databases which should be + * restored. This list has to match the list of databases included in the + * backup. + * + * @param {boolean} [request.ignoreConflictingHostNames] Changes a logic when + * restoring an app with custom domains. true to remove custom + * domains automatically. If false, custom domains are added to + * the app's object when it is being restored, but that might fail due to + * conflicts during the operation. + * + * @param {boolean} [request.ignoreDatabases] Ignore the databases and only + * restore the site content + * + * @param {string} [request.appServicePlan] Specify app service plan that will + * own restored site. + * + * @param {string} [request.operationType] Operation type. Possible values + * include: 'Default', 'Clone', 'Relocation', 'Snapshot', 'CloudFS' + * + * @param {boolean} [request.adjustConnectionStrings] true if + * SiteConfig.ConnectionStrings should be set in new app; otherwise, + * false. + * + * @param {string} [request.hostingEnvironment] App Service Environment name, + * if needed (only when restoring an app to an App Service Environment). + * + * @param {string} [request.kind] Kind of resource. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will restore a backup of the production slot. + * + * @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. + */ + restoreSlotWithHttpOperationResponse(resourceGroupName, name, backupId, request, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._restoreSlot(resourceGroupName, name, backupId, request, slot, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Restores a specific backup to another app (or deployment slot, if + * specified). + * + * Restores a specific backup to another app (or deployment slot, if + * specified). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} backupId ID of the backup. + * + * @param {object} request Information on restore request . + * + * @param {string} request.storageAccountUrl SAS URL to the container. + * + * @param {string} [request.blobName] Name of a blob which contains the backup. + * + * @param {boolean} request.overwrite true if the restore + * operation can overwrite target app; otherwise, false. + * true is needed if trying to restore over an existing app. + * + * @param {string} [request.siteName] Name of an app. + * + * @param {array} [request.databases] Collection of databases which should be + * restored. This list has to match the list of databases included in the + * backup. + * + * @param {boolean} [request.ignoreConflictingHostNames] Changes a logic when + * restoring an app with custom domains. true to remove custom + * domains automatically. If false, custom domains are added to + * the app's object when it is being restored, but that might fail due to + * conflicts during the operation. + * + * @param {boolean} [request.ignoreDatabases] Ignore the databases and only + * restore the site content + * + * @param {string} [request.appServicePlan] Specify app service plan that will + * own restored site. + * + * @param {string} [request.operationType] Operation type. Possible values + * include: 'Default', 'Clone', 'Relocation', 'Snapshot', 'CloudFS' + * + * @param {boolean} [request.adjustConnectionStrings] true if + * SiteConfig.ConnectionStrings should be set in new app; otherwise, + * false. + * + * @param {string} [request.hostingEnvironment] App Service Environment name, + * if needed (only when restoring an app to an App Service Environment). + * + * @param {string} [request.kind] Kind of resource. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will restore a backup of the production slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + restoreSlot(resourceGroupName, name, backupId, request, slot, 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._restoreSlot(resourceGroupName, name, backupId, request, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._restoreSlot(resourceGroupName, name, backupId, request, slot, options, optionalCallback); + } + } + + /** + * @summary List the configurations of an app + * + * List the configurations of an app + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will return configuration for the production slot. + * + * @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. + */ + listConfigurationsSlotWithHttpOperationResponse(resourceGroupName, name, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listConfigurationsSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary List the configurations of an app + * + * List the configurations of an app + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will return configuration for the production slot. + * + * @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 {SiteConfigResourceCollection} - 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 SiteConfigResourceCollection} 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. + */ + listConfigurationsSlot(resourceGroupName, name, slot, 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._listConfigurationsSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listConfigurationsSlot(resourceGroupName, name, slot, options, optionalCallback); + } + } + + /** + * @summary Replaces the application settings of an app. + * + * Replaces the application settings of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} appSettings Application settings of the app. + * + * @param {object} [appSettings.properties] Settings. + * + * @param {string} [appSettings.kind] Kind of resource. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will update the application settings for the production + * slot. + * + * @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. + */ + updateApplicationSettingsSlotWithHttpOperationResponse(resourceGroupName, name, appSettings, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._updateApplicationSettingsSlot(resourceGroupName, name, appSettings, slot, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Replaces the application settings of an app. + * + * Replaces the application settings of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} appSettings Application settings of the app. + * + * @param {object} [appSettings.properties] Settings. + * + * @param {string} [appSettings.kind] Kind of resource. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will update the application settings for the production + * slot. + * + * @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 {StringDictionary} - 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 StringDictionary} 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. + */ + updateApplicationSettingsSlot(resourceGroupName, name, appSettings, slot, 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._updateApplicationSettingsSlot(resourceGroupName, name, appSettings, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._updateApplicationSettingsSlot(resourceGroupName, name, appSettings, slot, options, optionalCallback); + } + } + + /** + * @summary Gets the application settings of an app. + * + * Gets the application settings of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will get the application settings for the production + * slot. + * + * @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. + */ + listApplicationSettingsSlotWithHttpOperationResponse(resourceGroupName, name, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listApplicationSettingsSlot(resourceGroupName, name, slot, 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 the application settings of an app. + * + * Gets the application settings of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will get the application settings for the production + * slot. + * + * @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 {StringDictionary} - 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 StringDictionary} 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. + */ + listApplicationSettingsSlot(resourceGroupName, name, slot, 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._listApplicationSettingsSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listApplicationSettingsSlot(resourceGroupName, name, slot, options, optionalCallback); + } + } + + /** + * @summary Updates the Authentication / Authorization settings associated with + * web app. + * + * Updates the Authentication / Authorization settings associated with web app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {object} siteAuthSettings Auth settings associated with web app. + * + * @param {boolean} [siteAuthSettings.enabled] true if the + * Authentication / Authorization feature is enabled for the current app; + * otherwise, false. + * + * @param {string} [siteAuthSettings.runtimeVersion] The RuntimeVersion of the + * Authentication / Authorization feature in use for the current app. + * The setting in this value can control the behavior of certain features in + * the Authentication / Authorization module. + * + * @param {string} [siteAuthSettings.unauthenticatedClientAction] The action to + * take when an unauthenticated client attempts to access the app. Possible + * values include: 'RedirectToLoginPage', 'AllowAnonymous' + * + * @param {boolean} [siteAuthSettings.tokenStoreEnabled] true to + * durably store platform-specific security tokens that are obtained during + * login flows; otherwise, false. + * The default is false. + * + * @param {array} [siteAuthSettings.allowedExternalRedirectUrls] External URLs + * that can be redirected to as part of logging in or logging out of the app. + * Note that the query string part of the URL is ignored. + * This is an advanced setting typically only needed by Windows Store + * application backends. + * Note that URLs within the current domain are always implicitly allowed. + * + * @param {string} [siteAuthSettings.defaultProvider] The default + * authentication provider to use when multiple providers are configured. + * This setting is only needed if multiple providers are configured and the + * unauthenticated client + * action is set to "RedirectToLoginPage". Possible values include: + * 'AzureActiveDirectory', 'Facebook', 'Google', 'MicrosoftAccount', 'Twitter' + * + * @param {number} [siteAuthSettings.tokenRefreshExtensionHours] The number of + * hours after session token expiration that a session token can be used to + * call the token refresh API. The default is 72 hours. + * + * @param {string} [siteAuthSettings.clientId] The Client ID of this relying + * party application, known as the client_id. + * This setting is required for enabling OpenID Connection authentication with + * Azure Active Directory or + * other 3rd party OpenID Connect providers. + * More information on OpenID Connect: + * http://openid.net/specs/openid-connect-core-1_0.html + * + * @param {string} [siteAuthSettings.clientSecret] The Client Secret of this + * relying party application (in Azure Active Directory, this is also referred + * to as the Key). + * This setting is optional. If no client secret is configured, the OpenID + * Connect implicit auth flow is used to authenticate end users. + * Otherwise, the OpenID Connect Authorization Code Flow is used to + * authenticate end users. + * More information on OpenID Connect: + * http://openid.net/specs/openid-connect-core-1_0.html + * + * @param {string} [siteAuthSettings.issuer] The OpenID Connect Issuer URI that + * represents the entity which issues access tokens for this application. + * When using Azure Active Directory, this value is the URI of the directory + * tenant, e.g. https://sts.windows.net/{tenant-guid}/. + * This URI is a case-sensitive identifier for the token issuer. + * More information on OpenID Connect Discovery: + * http://openid.net/specs/openid-connect-discovery-1_0.html + * + * @param {boolean} [siteAuthSettings.validateIssuer] Gets a value indicating + * whether the issuer should be a valid HTTPS url and be validated as such. + * + * @param {array} [siteAuthSettings.allowedAudiences] Allowed audience values + * to consider when validating JWTs issued by + * Azure Active Directory. Note that the ClientID value is always + * considered an + * allowed audience, regardless of this setting. + * + * @param {array} [siteAuthSettings.additionalLoginParams] Login parameters to + * send to the OpenID Connect authorization endpoint when + * a user logs in. Each parameter must be in the form "key=value". + * + * @param {string} [siteAuthSettings.googleClientId] The OpenID Connect Client + * ID for the Google web application. + * This setting is required for enabling Google Sign-In. + * Google Sign-In documentation: + * https://developers.google.com/identity/sign-in/web/ + * + * @param {string} [siteAuthSettings.googleClientSecret] The client secret + * associated with the Google web application. + * This setting is required for enabling Google Sign-In. + * Google Sign-In documentation: + * https://developers.google.com/identity/sign-in/web/ + * + * @param {array} [siteAuthSettings.googleOAuthScopes] The OAuth 2.0 scopes + * that will be requested as part of Google Sign-In authentication. + * This setting is optional. If not specified, "openid", "profile", and "email" + * are used as default scopes. + * Google Sign-In documentation: + * https://developers.google.com/identity/sign-in/web/ + * + * @param {string} [siteAuthSettings.facebookAppId] The App ID of the Facebook + * app used for login. + * This setting is required for enabling Facebook Login. + * Facebook Login documentation: + * https://developers.facebook.com/docs/facebook-login + * + * @param {string} [siteAuthSettings.facebookAppSecret] The App Secret of the + * Facebook app used for Facebook Login. + * This setting is required for enabling Facebook Login. + * Facebook Login documentation: + * https://developers.facebook.com/docs/facebook-login + * + * @param {array} [siteAuthSettings.facebookOAuthScopes] The OAuth 2.0 scopes + * that will be requested as part of Facebook Login authentication. + * This setting is optional. + * Facebook Login documentation: + * https://developers.facebook.com/docs/facebook-login + * + * @param {string} [siteAuthSettings.twitterConsumerKey] The OAuth 1.0a + * consumer key of the Twitter application used for sign-in. + * This setting is required for enabling Twitter Sign-In. + * Twitter Sign-In documentation: https://dev.twitter.com/web/sign-in + * + * @param {string} [siteAuthSettings.twitterConsumerSecret] The OAuth 1.0a + * consumer secret of the Twitter application used for sign-in. + * This setting is required for enabling Twitter Sign-In. + * Twitter Sign-In documentation: https://dev.twitter.com/web/sign-in + * + * @param {string} [siteAuthSettings.microsoftAccountClientId] The OAuth 2.0 + * client ID that was created for the app used for authentication. + * This setting is required for enabling Microsoft Account authentication. + * Microsoft Account OAuth documentation: + * https://dev.onedrive.com/auth/msa_oauth.htm + * + * @param {string} [siteAuthSettings.microsoftAccountClientSecret] The OAuth + * 2.0 client secret that was created for the app used for authentication. + * This setting is required for enabling Microsoft Account authentication. + * Microsoft Account OAuth documentation: + * https://dev.onedrive.com/auth/msa_oauth.htm + * + * @param {array} [siteAuthSettings.microsoftAccountOAuthScopes] The OAuth 2.0 + * scopes that will be requested as part of Microsoft Account authentication. + * This setting is optional. If not specified, "wl.basic" is used as the + * default scope. + * Microsoft Account Scopes and permissions documentation: + * https://msdn.microsoft.com/en-us/library/dn631845.aspx + * + * @param {string} [siteAuthSettings.kind] Kind of resource. + * + * @param {string} slot Name of web app slot. If not specified then will + * default to production slot. + * + * @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. + */ + updateAuthSettingsSlotWithHttpOperationResponse(resourceGroupName, name, siteAuthSettings, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._updateAuthSettingsSlot(resourceGroupName, name, siteAuthSettings, slot, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Updates the Authentication / Authorization settings associated with + * web app. + * + * Updates the Authentication / Authorization settings associated with web app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {object} siteAuthSettings Auth settings associated with web app. + * + * @param {boolean} [siteAuthSettings.enabled] true if the + * Authentication / Authorization feature is enabled for the current app; + * otherwise, false. + * + * @param {string} [siteAuthSettings.runtimeVersion] The RuntimeVersion of the + * Authentication / Authorization feature in use for the current app. + * The setting in this value can control the behavior of certain features in + * the Authentication / Authorization module. + * + * @param {string} [siteAuthSettings.unauthenticatedClientAction] The action to + * take when an unauthenticated client attempts to access the app. Possible + * values include: 'RedirectToLoginPage', 'AllowAnonymous' + * + * @param {boolean} [siteAuthSettings.tokenStoreEnabled] true to + * durably store platform-specific security tokens that are obtained during + * login flows; otherwise, false. + * The default is false. + * + * @param {array} [siteAuthSettings.allowedExternalRedirectUrls] External URLs + * that can be redirected to as part of logging in or logging out of the app. + * Note that the query string part of the URL is ignored. + * This is an advanced setting typically only needed by Windows Store + * application backends. + * Note that URLs within the current domain are always implicitly allowed. + * + * @param {string} [siteAuthSettings.defaultProvider] The default + * authentication provider to use when multiple providers are configured. + * This setting is only needed if multiple providers are configured and the + * unauthenticated client + * action is set to "RedirectToLoginPage". Possible values include: + * 'AzureActiveDirectory', 'Facebook', 'Google', 'MicrosoftAccount', 'Twitter' + * + * @param {number} [siteAuthSettings.tokenRefreshExtensionHours] The number of + * hours after session token expiration that a session token can be used to + * call the token refresh API. The default is 72 hours. + * + * @param {string} [siteAuthSettings.clientId] The Client ID of this relying + * party application, known as the client_id. + * This setting is required for enabling OpenID Connection authentication with + * Azure Active Directory or + * other 3rd party OpenID Connect providers. + * More information on OpenID Connect: + * http://openid.net/specs/openid-connect-core-1_0.html + * + * @param {string} [siteAuthSettings.clientSecret] The Client Secret of this + * relying party application (in Azure Active Directory, this is also referred + * to as the Key). + * This setting is optional. If no client secret is configured, the OpenID + * Connect implicit auth flow is used to authenticate end users. + * Otherwise, the OpenID Connect Authorization Code Flow is used to + * authenticate end users. + * More information on OpenID Connect: + * http://openid.net/specs/openid-connect-core-1_0.html + * + * @param {string} [siteAuthSettings.issuer] The OpenID Connect Issuer URI that + * represents the entity which issues access tokens for this application. + * When using Azure Active Directory, this value is the URI of the directory + * tenant, e.g. https://sts.windows.net/{tenant-guid}/. + * This URI is a case-sensitive identifier for the token issuer. + * More information on OpenID Connect Discovery: + * http://openid.net/specs/openid-connect-discovery-1_0.html + * + * @param {boolean} [siteAuthSettings.validateIssuer] Gets a value indicating + * whether the issuer should be a valid HTTPS url and be validated as such. + * + * @param {array} [siteAuthSettings.allowedAudiences] Allowed audience values + * to consider when validating JWTs issued by + * Azure Active Directory. Note that the ClientID value is always + * considered an + * allowed audience, regardless of this setting. + * + * @param {array} [siteAuthSettings.additionalLoginParams] Login parameters to + * send to the OpenID Connect authorization endpoint when + * a user logs in. Each parameter must be in the form "key=value". + * + * @param {string} [siteAuthSettings.googleClientId] The OpenID Connect Client + * ID for the Google web application. + * This setting is required for enabling Google Sign-In. + * Google Sign-In documentation: + * https://developers.google.com/identity/sign-in/web/ + * + * @param {string} [siteAuthSettings.googleClientSecret] The client secret + * associated with the Google web application. + * This setting is required for enabling Google Sign-In. + * Google Sign-In documentation: + * https://developers.google.com/identity/sign-in/web/ + * + * @param {array} [siteAuthSettings.googleOAuthScopes] The OAuth 2.0 scopes + * that will be requested as part of Google Sign-In authentication. + * This setting is optional. If not specified, "openid", "profile", and "email" + * are used as default scopes. + * Google Sign-In documentation: + * https://developers.google.com/identity/sign-in/web/ + * + * @param {string} [siteAuthSettings.facebookAppId] The App ID of the Facebook + * app used for login. + * This setting is required for enabling Facebook Login. + * Facebook Login documentation: + * https://developers.facebook.com/docs/facebook-login + * + * @param {string} [siteAuthSettings.facebookAppSecret] The App Secret of the + * Facebook app used for Facebook Login. + * This setting is required for enabling Facebook Login. + * Facebook Login documentation: + * https://developers.facebook.com/docs/facebook-login + * + * @param {array} [siteAuthSettings.facebookOAuthScopes] The OAuth 2.0 scopes + * that will be requested as part of Facebook Login authentication. + * This setting is optional. + * Facebook Login documentation: + * https://developers.facebook.com/docs/facebook-login + * + * @param {string} [siteAuthSettings.twitterConsumerKey] The OAuth 1.0a + * consumer key of the Twitter application used for sign-in. + * This setting is required for enabling Twitter Sign-In. + * Twitter Sign-In documentation: https://dev.twitter.com/web/sign-in + * + * @param {string} [siteAuthSettings.twitterConsumerSecret] The OAuth 1.0a + * consumer secret of the Twitter application used for sign-in. + * This setting is required for enabling Twitter Sign-In. + * Twitter Sign-In documentation: https://dev.twitter.com/web/sign-in + * + * @param {string} [siteAuthSettings.microsoftAccountClientId] The OAuth 2.0 + * client ID that was created for the app used for authentication. + * This setting is required for enabling Microsoft Account authentication. + * Microsoft Account OAuth documentation: + * https://dev.onedrive.com/auth/msa_oauth.htm + * + * @param {string} [siteAuthSettings.microsoftAccountClientSecret] The OAuth + * 2.0 client secret that was created for the app used for authentication. + * This setting is required for enabling Microsoft Account authentication. + * Microsoft Account OAuth documentation: + * https://dev.onedrive.com/auth/msa_oauth.htm + * + * @param {array} [siteAuthSettings.microsoftAccountOAuthScopes] The OAuth 2.0 + * scopes that will be requested as part of Microsoft Account authentication. + * This setting is optional. If not specified, "wl.basic" is used as the + * default scope. + * Microsoft Account Scopes and permissions documentation: + * https://msdn.microsoft.com/en-us/library/dn631845.aspx + * + * @param {string} [siteAuthSettings.kind] Kind of resource. + * + * @param {string} slot Name of web app slot. If not specified then will + * default to production slot. + * + * @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 {SiteAuthSettings} - 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 SiteAuthSettings} 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. + */ + updateAuthSettingsSlot(resourceGroupName, name, siteAuthSettings, slot, 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._updateAuthSettingsSlot(resourceGroupName, name, siteAuthSettings, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._updateAuthSettingsSlot(resourceGroupName, name, siteAuthSettings, slot, options, optionalCallback); + } + } + + /** + * @summary Gets the Authentication/Authorization settings of an app. + * + * Gets the Authentication/Authorization settings of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will get the settings for the production slot. + * + * @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. + */ + getAuthSettingsSlotWithHttpOperationResponse(resourceGroupName, name, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._getAuthSettingsSlot(resourceGroupName, name, slot, 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 the Authentication/Authorization settings of an app. + * + * Gets the Authentication/Authorization settings of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will get the settings for the production slot. + * + * @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 {SiteAuthSettings} - 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 SiteAuthSettings} 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. + */ + getAuthSettingsSlot(resourceGroupName, name, slot, 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._getAuthSettingsSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getAuthSettingsSlot(resourceGroupName, name, slot, options, optionalCallback); + } + } + + /** + * @summary Updates the Azure storage account configurations of an app. + * + * Updates the Azure storage account configurations of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} azureStorageAccounts Azure storage accounts of the app. + * + * @param {object} [azureStorageAccounts.properties] Azure storage accounts. + * + * @param {string} [azureStorageAccounts.kind] Kind of resource. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will update the Azure storage account configurations for + * the production slot. + * + * @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. + */ + updateAzureStorageAccountsSlotWithHttpOperationResponse(resourceGroupName, name, azureStorageAccounts, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._updateAzureStorageAccountsSlot(resourceGroupName, name, azureStorageAccounts, slot, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Updates the Azure storage account configurations of an app. + * + * Updates the Azure storage account configurations of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} azureStorageAccounts Azure storage accounts of the app. + * + * @param {object} [azureStorageAccounts.properties] Azure storage accounts. + * + * @param {string} [azureStorageAccounts.kind] Kind of resource. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will update the Azure storage account configurations for + * the production slot. + * + * @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 {AzureStoragePropertyDictionaryResource} - 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 AzureStoragePropertyDictionaryResource} 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. + */ + updateAzureStorageAccountsSlot(resourceGroupName, name, azureStorageAccounts, slot, 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._updateAzureStorageAccountsSlot(resourceGroupName, name, azureStorageAccounts, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._updateAzureStorageAccountsSlot(resourceGroupName, name, azureStorageAccounts, slot, options, optionalCallback); + } + } + + /** + * @summary Gets the Azure storage account configurations of an app. + * + * Gets the Azure storage account configurations of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will update the Azure storage account configurations for + * the production slot. + * + * @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. + */ + listAzureStorageAccountsSlotWithHttpOperationResponse(resourceGroupName, name, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listAzureStorageAccountsSlot(resourceGroupName, name, slot, 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 the Azure storage account configurations of an app. + * + * Gets the Azure storage account configurations of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will update the Azure storage account configurations for + * the production slot. + * + * @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 {AzureStoragePropertyDictionaryResource} - 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 AzureStoragePropertyDictionaryResource} 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. + */ + listAzureStorageAccountsSlot(resourceGroupName, name, slot, 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._listAzureStorageAccountsSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listAzureStorageAccountsSlot(resourceGroupName, name, slot, options, optionalCallback); + } + } + + /** + * @summary Updates the backup configuration of an app. + * + * Updates the backup configuration of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} request Edited backup configuration. + * + * @param {string} [request.backupName] Name of the backup. + * + * @param {boolean} [request.enabled] True if the backup schedule is enabled + * (must be included in that case), false if the backup schedule should be + * disabled. + * + * @param {string} request.storageAccountUrl SAS URL to the container. + * + * @param {object} [request.backupSchedule] Schedule for the backup if it is + * executed periodically. + * + * @param {number} request.backupSchedule.frequencyInterval How often the + * backup should be executed (e.g. for weekly backup, this should be set to 7 + * and FrequencyUnit should be set to Day) + * + * @param {string} request.backupSchedule.frequencyUnit The unit of time for + * how often the backup should be executed (e.g. for weekly backup, this should + * be set to Day and FrequencyInterval should be set to 7). Possible values + * include: 'Day', 'Hour' + * + * @param {boolean} request.backupSchedule.keepAtLeastOneBackup True if the + * retention policy should always keep at least one backup in the storage + * account, regardless how old it is; false otherwise. + * + * @param {number} request.backupSchedule.retentionPeriodInDays After how many + * days backups should be deleted. + * + * @param {date} [request.backupSchedule.startTime] When the schedule should + * start working. + * + * @param {array} [request.databases] Databases included in the backup. + * + * @param {string} [request.kind] Kind of resource. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will update the backup configuration for the production + * slot. + * + * @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. + */ + updateBackupConfigurationSlotWithHttpOperationResponse(resourceGroupName, name, request, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._updateBackupConfigurationSlot(resourceGroupName, name, request, slot, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Updates the backup configuration of an app. + * + * Updates the backup configuration of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} request Edited backup configuration. + * + * @param {string} [request.backupName] Name of the backup. + * + * @param {boolean} [request.enabled] True if the backup schedule is enabled + * (must be included in that case), false if the backup schedule should be + * disabled. + * + * @param {string} request.storageAccountUrl SAS URL to the container. + * + * @param {object} [request.backupSchedule] Schedule for the backup if it is + * executed periodically. + * + * @param {number} request.backupSchedule.frequencyInterval How often the + * backup should be executed (e.g. for weekly backup, this should be set to 7 + * and FrequencyUnit should be set to Day) + * + * @param {string} request.backupSchedule.frequencyUnit The unit of time for + * how often the backup should be executed (e.g. for weekly backup, this should + * be set to Day and FrequencyInterval should be set to 7). Possible values + * include: 'Day', 'Hour' + * + * @param {boolean} request.backupSchedule.keepAtLeastOneBackup True if the + * retention policy should always keep at least one backup in the storage + * account, regardless how old it is; false otherwise. + * + * @param {number} request.backupSchedule.retentionPeriodInDays After how many + * days backups should be deleted. + * + * @param {date} [request.backupSchedule.startTime] When the schedule should + * start working. + * + * @param {array} [request.databases] Databases included in the backup. + * + * @param {string} [request.kind] Kind of resource. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will update the backup configuration for the production + * slot. + * + * @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 {BackupRequest} - 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 BackupRequest} 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. + */ + updateBackupConfigurationSlot(resourceGroupName, name, request, slot, 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._updateBackupConfigurationSlot(resourceGroupName, name, request, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._updateBackupConfigurationSlot(resourceGroupName, name, request, slot, options, optionalCallback); + } + } + + /** + * @summary Deletes the backup configuration of an app. + * + * Deletes the backup configuration of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will delete the backup configuration for the production + * slot. + * + * @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. + */ + deleteBackupConfigurationSlotWithHttpOperationResponse(resourceGroupName, name, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._deleteBackupConfigurationSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Deletes the backup configuration of an app. + * + * Deletes the backup configuration of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will delete the backup configuration for the production + * slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + deleteBackupConfigurationSlot(resourceGroupName, name, slot, 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._deleteBackupConfigurationSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._deleteBackupConfigurationSlot(resourceGroupName, name, slot, options, optionalCallback); + } + } + + /** + * @summary Gets the backup configuration of an app. + * + * Gets the backup configuration of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will get the backup configuration for the production + * slot. + * + * @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. + */ + getBackupConfigurationSlotWithHttpOperationResponse(resourceGroupName, name, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._getBackupConfigurationSlot(resourceGroupName, name, slot, 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 the backup configuration of an app. + * + * Gets the backup configuration of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will get the backup configuration for the production + * slot. + * + * @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 {BackupRequest} - 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 BackupRequest} 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. + */ + getBackupConfigurationSlot(resourceGroupName, name, slot, 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._getBackupConfigurationSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getBackupConfigurationSlot(resourceGroupName, name, slot, options, optionalCallback); + } + } + + /** + * @summary Replaces the connection strings of an app. + * + * Replaces the connection strings of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} connectionStrings Connection strings of the app or + * deployment slot. See example. + * + * @param {object} [connectionStrings.properties] Connection strings. + * + * @param {string} [connectionStrings.kind] Kind of resource. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will update the connection settings for the production + * slot. + * + * @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. + */ + updateConnectionStringsSlotWithHttpOperationResponse(resourceGroupName, name, connectionStrings, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._updateConnectionStringsSlot(resourceGroupName, name, connectionStrings, slot, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Replaces the connection strings of an app. + * + * Replaces the connection strings of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} connectionStrings Connection strings of the app or + * deployment slot. See example. + * + * @param {object} [connectionStrings.properties] Connection strings. + * + * @param {string} [connectionStrings.kind] Kind of resource. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will update the connection settings for the production + * slot. + * + * @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 {ConnectionStringDictionary} - 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 ConnectionStringDictionary} 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. + */ + updateConnectionStringsSlot(resourceGroupName, name, connectionStrings, slot, 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._updateConnectionStringsSlot(resourceGroupName, name, connectionStrings, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._updateConnectionStringsSlot(resourceGroupName, name, connectionStrings, slot, options, optionalCallback); + } + } + + /** + * @summary Gets the connection strings of an app. + * + * Gets the connection strings of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will get the connection settings for the production slot. + * + * @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. + */ + listConnectionStringsSlotWithHttpOperationResponse(resourceGroupName, name, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listConnectionStringsSlot(resourceGroupName, name, slot, 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 the connection strings of an app. + * + * Gets the connection strings of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will get the connection settings for the production slot. + * + * @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 {ConnectionStringDictionary} - 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 ConnectionStringDictionary} 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. + */ + listConnectionStringsSlot(resourceGroupName, name, slot, 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._listConnectionStringsSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listConnectionStringsSlot(resourceGroupName, name, slot, options, optionalCallback); + } + } + + /** + * @summary Gets the logging configuration of an app. + * + * Gets the logging configuration of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will get the logging configuration for the production + * slot. + * + * @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. + */ + getDiagnosticLogsConfigurationSlotWithHttpOperationResponse(resourceGroupName, name, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._getDiagnosticLogsConfigurationSlot(resourceGroupName, name, slot, 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 the logging configuration of an app. + * + * Gets the logging configuration of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will get the logging configuration for the production + * slot. + * + * @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 {SiteLogsConfig} - 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 SiteLogsConfig} 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. + */ + getDiagnosticLogsConfigurationSlot(resourceGroupName, name, slot, 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._getDiagnosticLogsConfigurationSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getDiagnosticLogsConfigurationSlot(resourceGroupName, name, slot, options, optionalCallback); + } + } + + /** + * @summary Updates the logging configuration of an app. + * + * Updates the logging configuration of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} siteLogsConfig A SiteLogsConfig JSON object that contains + * the logging configuration to change in the "properties" property. + * + * @param {object} [siteLogsConfig.applicationLogs] Application logs + * configuration. + * + * @param {object} [siteLogsConfig.applicationLogs.fileSystem] Application logs + * to file system configuration. + * + * @param {string} [siteLogsConfig.applicationLogs.fileSystem.level] Log level. + * Possible values include: 'Off', 'Verbose', 'Information', 'Warning', 'Error' + * + * @param {object} [siteLogsConfig.applicationLogs.azureTableStorage] + * Application logs to azure table storage configuration. + * + * @param {string} [siteLogsConfig.applicationLogs.azureTableStorage.level] Log + * level. Possible values include: 'Off', 'Verbose', 'Information', 'Warning', + * 'Error' + * + * @param {string} siteLogsConfig.applicationLogs.azureTableStorage.sasUrl SAS + * URL to an Azure table with add/query/delete permissions. + * + * @param {object} [siteLogsConfig.applicationLogs.azureBlobStorage] + * Application logs to blob storage configuration. + * + * @param {string} [siteLogsConfig.applicationLogs.azureBlobStorage.level] Log + * level. Possible values include: 'Off', 'Verbose', 'Information', 'Warning', + * 'Error' + * + * @param {string} [siteLogsConfig.applicationLogs.azureBlobStorage.sasUrl] SAS + * url to a azure blob container with read/write/list/delete permissions. + * + * @param {number} + * [siteLogsConfig.applicationLogs.azureBlobStorage.retentionInDays] Retention + * in days. + * Remove blobs older than X days. + * 0 or lower means no retention. + * + * @param {object} [siteLogsConfig.httpLogs] HTTP logs configuration. + * + * @param {object} [siteLogsConfig.httpLogs.fileSystem] Http logs to file + * system configuration. + * + * @param {number} [siteLogsConfig.httpLogs.fileSystem.retentionInMb] Maximum + * size in megabytes that http log files can use. + * When reached old log files will be removed to make space for new ones. + * Value can range between 25 and 100. + * + * @param {number} [siteLogsConfig.httpLogs.fileSystem.retentionInDays] + * Retention in days. + * Remove files older than X days. + * 0 or lower means no retention. + * + * @param {boolean} [siteLogsConfig.httpLogs.fileSystem.enabled] True if + * configuration is enabled, false if it is disabled and null if configuration + * is not set. + * + * @param {object} [siteLogsConfig.httpLogs.azureBlobStorage] Http logs to + * azure blob storage configuration. + * + * @param {string} [siteLogsConfig.httpLogs.azureBlobStorage.sasUrl] SAS url to + * a azure blob container with read/write/list/delete permissions. + * + * @param {number} [siteLogsConfig.httpLogs.azureBlobStorage.retentionInDays] + * Retention in days. + * Remove blobs older than X days. + * 0 or lower means no retention. + * + * @param {boolean} [siteLogsConfig.httpLogs.azureBlobStorage.enabled] True if + * configuration is enabled, false if it is disabled and null if configuration + * is not set. + * + * @param {object} [siteLogsConfig.failedRequestsTracing] Failed requests + * tracing configuration. + * + * @param {object} [siteLogsConfig.detailedErrorMessages] Detailed error + * messages configuration. + * + * @param {boolean} [siteLogsConfig.detailedErrorMessages.enabled] True if + * configuration is enabled, false if it is disabled and null if configuration + * is not set. + * + * @param {string} [siteLogsConfig.kind] Kind of resource. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will update the logging configuration for the production + * slot. + * + * @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. + */ + updateDiagnosticLogsConfigSlotWithHttpOperationResponse(resourceGroupName, name, siteLogsConfig, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._updateDiagnosticLogsConfigSlot(resourceGroupName, name, siteLogsConfig, slot, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Updates the logging configuration of an app. + * + * Updates the logging configuration of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} siteLogsConfig A SiteLogsConfig JSON object that contains + * the logging configuration to change in the "properties" property. + * + * @param {object} [siteLogsConfig.applicationLogs] Application logs + * configuration. + * + * @param {object} [siteLogsConfig.applicationLogs.fileSystem] Application logs + * to file system configuration. + * + * @param {string} [siteLogsConfig.applicationLogs.fileSystem.level] Log level. + * Possible values include: 'Off', 'Verbose', 'Information', 'Warning', 'Error' + * + * @param {object} [siteLogsConfig.applicationLogs.azureTableStorage] + * Application logs to azure table storage configuration. + * + * @param {string} [siteLogsConfig.applicationLogs.azureTableStorage.level] Log + * level. Possible values include: 'Off', 'Verbose', 'Information', 'Warning', + * 'Error' + * + * @param {string} siteLogsConfig.applicationLogs.azureTableStorage.sasUrl SAS + * URL to an Azure table with add/query/delete permissions. + * + * @param {object} [siteLogsConfig.applicationLogs.azureBlobStorage] + * Application logs to blob storage configuration. + * + * @param {string} [siteLogsConfig.applicationLogs.azureBlobStorage.level] Log + * level. Possible values include: 'Off', 'Verbose', 'Information', 'Warning', + * 'Error' + * + * @param {string} [siteLogsConfig.applicationLogs.azureBlobStorage.sasUrl] SAS + * url to a azure blob container with read/write/list/delete permissions. + * + * @param {number} + * [siteLogsConfig.applicationLogs.azureBlobStorage.retentionInDays] Retention + * in days. + * Remove blobs older than X days. + * 0 or lower means no retention. + * + * @param {object} [siteLogsConfig.httpLogs] HTTP logs configuration. + * + * @param {object} [siteLogsConfig.httpLogs.fileSystem] Http logs to file + * system configuration. + * + * @param {number} [siteLogsConfig.httpLogs.fileSystem.retentionInMb] Maximum + * size in megabytes that http log files can use. + * When reached old log files will be removed to make space for new ones. + * Value can range between 25 and 100. + * + * @param {number} [siteLogsConfig.httpLogs.fileSystem.retentionInDays] + * Retention in days. + * Remove files older than X days. + * 0 or lower means no retention. + * + * @param {boolean} [siteLogsConfig.httpLogs.fileSystem.enabled] True if + * configuration is enabled, false if it is disabled and null if configuration + * is not set. + * + * @param {object} [siteLogsConfig.httpLogs.azureBlobStorage] Http logs to + * azure blob storage configuration. + * + * @param {string} [siteLogsConfig.httpLogs.azureBlobStorage.sasUrl] SAS url to + * a azure blob container with read/write/list/delete permissions. + * + * @param {number} [siteLogsConfig.httpLogs.azureBlobStorage.retentionInDays] + * Retention in days. + * Remove blobs older than X days. + * 0 or lower means no retention. + * + * @param {boolean} [siteLogsConfig.httpLogs.azureBlobStorage.enabled] True if + * configuration is enabled, false if it is disabled and null if configuration + * is not set. + * + * @param {object} [siteLogsConfig.failedRequestsTracing] Failed requests + * tracing configuration. + * + * @param {object} [siteLogsConfig.detailedErrorMessages] Detailed error + * messages configuration. + * + * @param {boolean} [siteLogsConfig.detailedErrorMessages.enabled] True if + * configuration is enabled, false if it is disabled and null if configuration + * is not set. + * + * @param {string} [siteLogsConfig.kind] Kind of resource. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will update the logging configuration for the production + * slot. + * + * @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 {SiteLogsConfig} - 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 SiteLogsConfig} 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. + */ + updateDiagnosticLogsConfigSlot(resourceGroupName, name, siteLogsConfig, slot, 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._updateDiagnosticLogsConfigSlot(resourceGroupName, name, siteLogsConfig, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._updateDiagnosticLogsConfigSlot(resourceGroupName, name, siteLogsConfig, slot, options, optionalCallback); + } + } + + /** + * @summary Replaces the metadata of an app. + * + * Replaces the metadata of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} metadata Edited metadata of the app or deployment slot. See + * example. + * + * @param {object} [metadata.properties] Settings. + * + * @param {string} [metadata.kind] Kind of resource. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will update the metadata for the production slot. + * + * @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. + */ + updateMetadataSlotWithHttpOperationResponse(resourceGroupName, name, metadata, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._updateMetadataSlot(resourceGroupName, name, metadata, slot, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Replaces the metadata of an app. + * + * Replaces the metadata of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} metadata Edited metadata of the app or deployment slot. See + * example. + * + * @param {object} [metadata.properties] Settings. + * + * @param {string} [metadata.kind] Kind of resource. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will update the metadata for the production slot. + * + * @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 {StringDictionary} - 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 StringDictionary} 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. + */ + updateMetadataSlot(resourceGroupName, name, metadata, slot, 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._updateMetadataSlot(resourceGroupName, name, metadata, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._updateMetadataSlot(resourceGroupName, name, metadata, slot, options, optionalCallback); + } + } + + /** + * @summary Gets the metadata of an app. + * + * Gets the metadata of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will get the metadata for the production slot. + * + * @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. + */ + listMetadataSlotWithHttpOperationResponse(resourceGroupName, name, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listMetadataSlot(resourceGroupName, name, slot, 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 the metadata of an app. + * + * Gets the metadata of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will get the metadata for the production slot. + * + * @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 {StringDictionary} - 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 StringDictionary} 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. + */ + listMetadataSlot(resourceGroupName, name, slot, 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._listMetadataSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listMetadataSlot(resourceGroupName, name, slot, options, optionalCallback); + } + } + + /** + * @summary Gets the Git/FTP publishing credentials of an app. + * + * Gets the Git/FTP publishing credentials of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will get the publishing credentials for the production + * slot. + * + * @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. + */ + listPublishingCredentialsSlotWithHttpOperationResponse(resourceGroupName, name, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listPublishingCredentialsSlot(resourceGroupName, name, slot, 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 the Git/FTP publishing credentials of an app. + * + * Gets the Git/FTP publishing credentials of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will get the publishing credentials for the production + * slot. + * + * @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 {User} - 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 User} 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. + */ + listPublishingCredentialsSlot(resourceGroupName, name, slot, 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._listPublishingCredentialsSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listPublishingCredentialsSlot(resourceGroupName, name, slot, options, optionalCallback); + } + } + + /** + * @summary Updates the Push settings associated with web app. + * + * Updates the Push settings associated with web app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {object} pushSettings Push settings associated with web app. + * + * @param {boolean} pushSettings.isPushEnabled Gets or sets a flag indicating + * whether the Push endpoint is enabled. + * + * @param {string} [pushSettings.tagWhitelistJson] Gets or sets a JSON string + * containing a list of tags that are whitelisted for use by the push + * registration endpoint. + * + * @param {string} [pushSettings.tagsRequiringAuth] Gets or sets a JSON string + * containing a list of tags that require user authentication to be used in the + * push registration endpoint. + * Tags can consist of alphanumeric characters and the following: + * '_', '@', '#', '.', ':', '-'. + * Validation should be performed at the PushRequestHandler. + * + * @param {string} [pushSettings.dynamicTagsJson] Gets or sets a JSON string + * containing a list of dynamic tags that will be evaluated from user claims in + * the push registration endpoint. + * + * @param {string} [pushSettings.kind] Kind of resource. + * + * @param {string} slot Name of web app slot. If not specified then will + * default to production slot. + * + * @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. + */ + updateSitePushSettingsSlotWithHttpOperationResponse(resourceGroupName, name, pushSettings, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._updateSitePushSettingsSlot(resourceGroupName, name, pushSettings, slot, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Updates the Push settings associated with web app. + * + * Updates the Push settings associated with web app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {object} pushSettings Push settings associated with web app. + * + * @param {boolean} pushSettings.isPushEnabled Gets or sets a flag indicating + * whether the Push endpoint is enabled. + * + * @param {string} [pushSettings.tagWhitelistJson] Gets or sets a JSON string + * containing a list of tags that are whitelisted for use by the push + * registration endpoint. + * + * @param {string} [pushSettings.tagsRequiringAuth] Gets or sets a JSON string + * containing a list of tags that require user authentication to be used in the + * push registration endpoint. + * Tags can consist of alphanumeric characters and the following: + * '_', '@', '#', '.', ':', '-'. + * Validation should be performed at the PushRequestHandler. + * + * @param {string} [pushSettings.dynamicTagsJson] Gets or sets a JSON string + * containing a list of dynamic tags that will be evaluated from user claims in + * the push registration endpoint. + * + * @param {string} [pushSettings.kind] Kind of resource. + * + * @param {string} slot Name of web app slot. If not specified then will + * default to production slot. + * + * @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 {PushSettings} - 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 PushSettings} 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. + */ + updateSitePushSettingsSlot(resourceGroupName, name, pushSettings, slot, 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._updateSitePushSettingsSlot(resourceGroupName, name, pushSettings, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._updateSitePushSettingsSlot(resourceGroupName, name, pushSettings, slot, options, optionalCallback); + } + } + + /** + * @summary Gets the Push settings associated with web app. + * + * Gets the Push settings associated with web app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {string} slot Name of web app slot. If not specified then will + * default to production slot. + * + * @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. + */ + listSitePushSettingsSlotWithHttpOperationResponse(resourceGroupName, name, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listSitePushSettingsSlot(resourceGroupName, name, slot, 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 the Push settings associated with web app. + * + * Gets the Push settings associated with web app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {string} slot Name of web app slot. If not specified then will + * default to production slot. + * + * @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 {PushSettings} - 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 PushSettings} 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. + */ + listSitePushSettingsSlot(resourceGroupName, name, slot, 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._listSitePushSettingsSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listSitePushSettingsSlot(resourceGroupName, name, slot, options, optionalCallback); + } + } + + /** + * @summary Gets a Swift Virtual Network connection. + * + * Gets a Swift Virtual Network connection. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will get a gateway for the production slot's Virtual + * Network. + * + * @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. + */ + getSwiftVirtualNetworkConnectionSlotWithHttpOperationResponse(resourceGroupName, name, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._getSwiftVirtualNetworkConnectionSlot(resourceGroupName, name, slot, 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 Swift Virtual Network connection. + * + * Gets a Swift Virtual Network connection. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will get a gateway for the production slot's Virtual + * Network. + * + * @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 {SwiftVirtualNetwork} - 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 SwiftVirtualNetwork} 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. + */ + getSwiftVirtualNetworkConnectionSlot(resourceGroupName, name, slot, 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._getSwiftVirtualNetworkConnectionSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getSwiftVirtualNetworkConnectionSlot(resourceGroupName, name, slot, options, optionalCallback); + } + } + + /** + * @summary Integrates this Web App with a Virtual Network. This requires that + * 1) "swiftSupported" is true when doing a GET against this resource, and 2) + * that the target Subnet has already been delegated, and is not + * in use by another App Service Plan other than the one this App is in. + * + * Integrates this Web App with a Virtual Network. This requires that 1) + * "swiftSupported" is true when doing a GET against this resource, and 2) that + * the target Subnet has already been delegated, and is not + * in use by another App Service Plan other than the one this App is in. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} connectionEnvelope Properties of the Virtual Network + * connection. See example. + * + * @param {string} [connectionEnvelope.subnetResourceId] The Virtual Network + * subnet's resource ID. This is the subnet that this Web App will join. This + * subnet must have a delegation to Microsoft.Web/serverFarms defined first. + * + * @param {boolean} [connectionEnvelope.swiftSupported] A flag that specifies + * if the scale unit this Web App is on supports Swift integration. + * + * @param {string} [connectionEnvelope.kind] Kind of resource. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will add or update connections for the production slot. + * + * @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. + */ + createOrUpdateSwiftVirtualNetworkConnectionSlotWithHttpOperationResponse(resourceGroupName, name, connectionEnvelope, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._createOrUpdateSwiftVirtualNetworkConnectionSlot(resourceGroupName, name, connectionEnvelope, slot, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Integrates this Web App with a Virtual Network. This requires that + * 1) "swiftSupported" is true when doing a GET against this resource, and 2) + * that the target Subnet has already been delegated, and is not + * in use by another App Service Plan other than the one this App is in. + * + * Integrates this Web App with a Virtual Network. This requires that 1) + * "swiftSupported" is true when doing a GET against this resource, and 2) that + * the target Subnet has already been delegated, and is not + * in use by another App Service Plan other than the one this App is in. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} connectionEnvelope Properties of the Virtual Network + * connection. See example. + * + * @param {string} [connectionEnvelope.subnetResourceId] The Virtual Network + * subnet's resource ID. This is the subnet that this Web App will join. This + * subnet must have a delegation to Microsoft.Web/serverFarms defined first. + * + * @param {boolean} [connectionEnvelope.swiftSupported] A flag that specifies + * if the scale unit this Web App is on supports Swift integration. + * + * @param {string} [connectionEnvelope.kind] Kind of resource. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will add or update connections for the production slot. + * + * @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 {SwiftVirtualNetwork} - 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 SwiftVirtualNetwork} 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. + */ + createOrUpdateSwiftVirtualNetworkConnectionSlot(resourceGroupName, name, connectionEnvelope, slot, 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._createOrUpdateSwiftVirtualNetworkConnectionSlot(resourceGroupName, name, connectionEnvelope, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._createOrUpdateSwiftVirtualNetworkConnectionSlot(resourceGroupName, name, connectionEnvelope, slot, options, optionalCallback); + } + } + + /** + * @summary Deletes a Swift Virtual Network connection from an app (or + * deployment slot). + * + * Deletes a Swift Virtual Network connection from an app (or deployment slot). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will delete the connection for the production slot. + * + * @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. + */ + deleteSwiftVirtualNetworkSlotWithHttpOperationResponse(resourceGroupName, name, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._deleteSwiftVirtualNetworkSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Deletes a Swift Virtual Network connection from an app (or + * deployment slot). + * + * Deletes a Swift Virtual Network connection from an app (or deployment slot). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will delete the connection for the production slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + deleteSwiftVirtualNetworkSlot(resourceGroupName, name, slot, 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._deleteSwiftVirtualNetworkSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._deleteSwiftVirtualNetworkSlot(resourceGroupName, name, slot, options, optionalCallback); + } + } + + /** + * @summary Integrates this Web App with a Virtual Network. This requires that + * 1) "swiftSupported" is true when doing a GET against this resource, and 2) + * that the target Subnet has already been delegated, and is not + * in use by another App Service Plan other than the one this App is in. + * + * Integrates this Web App with a Virtual Network. This requires that 1) + * "swiftSupported" is true when doing a GET against this resource, and 2) that + * the target Subnet has already been delegated, and is not + * in use by another App Service Plan other than the one this App is in. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} connectionEnvelope Properties of the Virtual Network + * connection. See example. + * + * @param {string} [connectionEnvelope.subnetResourceId] The Virtual Network + * subnet's resource ID. This is the subnet that this Web App will join. This + * subnet must have a delegation to Microsoft.Web/serverFarms defined first. + * + * @param {boolean} [connectionEnvelope.swiftSupported] A flag that specifies + * if the scale unit this Web App is on supports Swift integration. + * + * @param {string} [connectionEnvelope.kind] Kind of resource. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will add or update connections for the production slot. + * + * @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. + */ + updateSwiftVirtualNetworkConnectionSlotWithHttpOperationResponse(resourceGroupName, name, connectionEnvelope, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._updateSwiftVirtualNetworkConnectionSlot(resourceGroupName, name, connectionEnvelope, slot, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Integrates this Web App with a Virtual Network. This requires that + * 1) "swiftSupported" is true when doing a GET against this resource, and 2) + * that the target Subnet has already been delegated, and is not + * in use by another App Service Plan other than the one this App is in. + * + * Integrates this Web App with a Virtual Network. This requires that 1) + * "swiftSupported" is true when doing a GET against this resource, and 2) that + * the target Subnet has already been delegated, and is not + * in use by another App Service Plan other than the one this App is in. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} connectionEnvelope Properties of the Virtual Network + * connection. See example. + * + * @param {string} [connectionEnvelope.subnetResourceId] The Virtual Network + * subnet's resource ID. This is the subnet that this Web App will join. This + * subnet must have a delegation to Microsoft.Web/serverFarms defined first. + * + * @param {boolean} [connectionEnvelope.swiftSupported] A flag that specifies + * if the scale unit this Web App is on supports Swift integration. + * + * @param {string} [connectionEnvelope.kind] Kind of resource. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will add or update connections for the production slot. + * + * @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 {SwiftVirtualNetwork} - 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 SwiftVirtualNetwork} 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. + */ + updateSwiftVirtualNetworkConnectionSlot(resourceGroupName, name, connectionEnvelope, slot, 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._updateSwiftVirtualNetworkConnectionSlot(resourceGroupName, name, connectionEnvelope, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._updateSwiftVirtualNetworkConnectionSlot(resourceGroupName, name, connectionEnvelope, slot, options, optionalCallback); + } + } + + /** + * @summary Gets the configuration of an app, such as platform version and + * bitness, default documents, virtual applications, Always On, etc. + * + * Gets the configuration of an app, such as platform version and bitness, + * default documents, virtual applications, Always On, etc. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will return configuration for the production slot. + * + * @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. + */ + getConfigurationSlotWithHttpOperationResponse(resourceGroupName, name, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._getConfigurationSlot(resourceGroupName, name, slot, 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 the configuration of an app, such as platform version and + * bitness, default documents, virtual applications, Always On, etc. + * + * Gets the configuration of an app, such as platform version and bitness, + * default documents, virtual applications, Always On, etc. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will return configuration for the production slot. + * + * @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 {SiteConfigResource} - 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 SiteConfigResource} 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. + */ + getConfigurationSlot(resourceGroupName, name, slot, 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._getConfigurationSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getConfigurationSlot(resourceGroupName, name, slot, options, optionalCallback); + } + } + + /** + * @summary Updates the configuration of an app. + * + * Updates the configuration of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} siteConfig JSON representation of a SiteConfig object. See + * example. + * + * @param {number} [siteConfig.numberOfWorkers] Number of workers. + * + * @param {array} [siteConfig.defaultDocuments] Default documents. + * + * @param {string} [siteConfig.netFrameworkVersion] .NET Framework version. + * + * @param {string} [siteConfig.phpVersion] Version of PHP. + * + * @param {string} [siteConfig.pythonVersion] Version of Python. + * + * @param {string} [siteConfig.nodeVersion] Version of Node.js. + * + * @param {string} [siteConfig.linuxFxVersion] Linux App Framework and version + * + * @param {string} [siteConfig.windowsFxVersion] Xenon App Framework and + * version + * + * @param {boolean} [siteConfig.requestTracingEnabled] true if + * request tracing is enabled; otherwise, false. + * + * @param {date} [siteConfig.requestTracingExpirationTime] Request tracing + * expiration time. + * + * @param {boolean} [siteConfig.remoteDebuggingEnabled] true if + * remote debugging is enabled; otherwise, false. + * + * @param {string} [siteConfig.remoteDebuggingVersion] Remote debugging + * version. + * + * @param {boolean} [siteConfig.httpLoggingEnabled] true if HTTP + * logging is enabled; otherwise, false. + * + * @param {number} [siteConfig.logsDirectorySizeLimit] HTTP logs directory size + * limit. + * + * @param {boolean} [siteConfig.detailedErrorLoggingEnabled] true + * if detailed error logging is enabled; otherwise, false. + * + * @param {string} [siteConfig.publishingUsername] Publishing user name. + * + * @param {array} [siteConfig.appSettings] Application settings. + * + * @param {object} [siteConfig.azureStorageAccounts] User-provided Azure + * storage accounts. + * + * @param {array} [siteConfig.connectionStrings] Connection strings. + * + * @param {array} [siteConfig.handlerMappings] Handler mappings. + * + * @param {string} [siteConfig.documentRoot] Document root. + * + * @param {string} [siteConfig.scmType] SCM type. Possible values include: + * 'None', 'Dropbox', 'Tfs', 'LocalGit', 'GitHub', 'CodePlexGit', 'CodePlexHg', + * 'BitbucketGit', 'BitbucketHg', 'ExternalGit', 'ExternalHg', 'OneDrive', + * 'VSO' + * + * @param {boolean} [siteConfig.use32BitWorkerProcess] true to use + * 32-bit worker process; otherwise, false. + * + * @param {boolean} [siteConfig.webSocketsEnabled] true if + * WebSocket is enabled; otherwise, false. + * + * @param {boolean} [siteConfig.alwaysOn] true if Always On is + * enabled; otherwise, false. + * + * @param {string} [siteConfig.javaVersion] Java version. + * + * @param {string} [siteConfig.javaContainer] Java container. + * + * @param {string} [siteConfig.javaContainerVersion] Java container version. + * + * @param {string} [siteConfig.appCommandLine] App command line to launch. + * + * @param {string} [siteConfig.managedPipelineMode] Managed pipeline mode. + * Possible values include: 'Integrated', 'Classic' + * + * @param {array} [siteConfig.virtualApplications] Virtual applications. + * + * @param {string} [siteConfig.loadBalancing] Site load balancing. Possible + * values include: 'WeightedRoundRobin', 'LeastRequests', 'LeastResponseTime', + * 'WeightedTotalTraffic', 'RequestHash' + * + * @param {object} [siteConfig.experiments] This is work around for polymophic + * types. + * + * @param {array} [siteConfig.experiments.rampUpRules] List of ramp-up rules. + * + * @param {object} [siteConfig.limits] Site limits. + * + * @param {number} [siteConfig.limits.maxPercentageCpu] Maximum allowed CPU + * usage percentage. + * + * @param {number} [siteConfig.limits.maxMemoryInMb] Maximum allowed memory + * usage in MB. + * + * @param {number} [siteConfig.limits.maxDiskSizeInMb] Maximum allowed disk + * size usage in MB. + * + * @param {boolean} [siteConfig.autoHealEnabled] true if Auto Heal + * is enabled; otherwise, false. + * + * @param {object} [siteConfig.autoHealRules] Auto Heal rules. + * + * @param {object} [siteConfig.autoHealRules.triggers] Conditions that describe + * when to execute the auto-heal actions. + * + * @param {object} [siteConfig.autoHealRules.triggers.requests] A rule based on + * total requests. + * + * @param {number} [siteConfig.autoHealRules.triggers.requests.count] Request + * Count. + * + * @param {string} [siteConfig.autoHealRules.triggers.requests.timeInterval] + * Time interval. + * + * @param {number} [siteConfig.autoHealRules.triggers.privateBytesInKB] A rule + * based on private bytes. + * + * @param {array} [siteConfig.autoHealRules.triggers.statusCodes] A rule based + * on status codes. + * + * @param {object} [siteConfig.autoHealRules.triggers.slowRequests] A rule + * based on request execution time. + * + * @param {string} [siteConfig.autoHealRules.triggers.slowRequests.timeTaken] + * Time taken. + * + * @param {number} [siteConfig.autoHealRules.triggers.slowRequests.count] + * Request Count. + * + * @param {string} + * [siteConfig.autoHealRules.triggers.slowRequests.timeInterval] Time interval. + * + * @param {object} [siteConfig.autoHealRules.actions] Actions to be executed + * when a rule is triggered. + * + * @param {string} [siteConfig.autoHealRules.actions.actionType] Predefined + * action to be taken. Possible values include: 'Recycle', 'LogEvent', + * 'CustomAction' + * + * @param {object} [siteConfig.autoHealRules.actions.customAction] Custom + * action to be taken. + * + * @param {string} [siteConfig.autoHealRules.actions.customAction.exe] + * Executable to be run. + * + * @param {string} [siteConfig.autoHealRules.actions.customAction.parameters] + * Parameters for the executable. + * + * @param {string} [siteConfig.autoHealRules.actions.minProcessExecutionTime] + * Minimum time the process must execute + * before taking the action + * + * @param {string} [siteConfig.tracingOptions] Tracing options. + * + * @param {string} [siteConfig.vnetName] Virtual Network name. + * + * @param {object} [siteConfig.cors] Cross-Origin Resource Sharing (CORS) + * settings. + * + * @param {array} [siteConfig.cors.allowedOrigins] Gets or sets the list of + * origins that should be allowed to make cross-origin + * calls (for example: http://example.com:12345). Use "*" to allow all. + * + * @param {object} [siteConfig.push] Push endpoint settings. + * + * @param {boolean} siteConfig.push.isPushEnabled Gets or sets a flag + * indicating whether the Push endpoint is enabled. + * + * @param {string} [siteConfig.push.tagWhitelistJson] Gets or sets a JSON + * string containing a list of tags that are whitelisted for use by the push + * registration endpoint. + * + * @param {string} [siteConfig.push.tagsRequiringAuth] Gets or sets a JSON + * string containing a list of tags that require user authentication to be used + * in the push registration endpoint. + * Tags can consist of alphanumeric characters and the following: + * '_', '@', '#', '.', ':', '-'. + * Validation should be performed at the PushRequestHandler. + * + * @param {string} [siteConfig.push.dynamicTagsJson] Gets or sets a JSON string + * containing a list of dynamic tags that will be evaluated from user claims in + * the push registration endpoint. + * + * @param {string} [siteConfig.push.kind] Kind of resource. + * + * @param {object} [siteConfig.apiDefinition] Information about the formal API + * definition for the app. + * + * @param {string} [siteConfig.apiDefinition.url] The URL of the API + * definition. + * + * @param {string} [siteConfig.autoSwapSlotName] Auto-swap slot name. + * + * @param {boolean} [siteConfig.localMySqlEnabled] true to enable + * local MySQL; otherwise, false. + * + * @param {number} [siteConfig.managedServiceIdentityId] Managed Service + * Identity Id + * + * @param {number} [siteConfig.xManagedServiceIdentityId] Explicit Managed + * Service Identity Id + * + * @param {array} [siteConfig.ipSecurityRestrictions] IP security restrictions. + * + * @param {boolean} [siteConfig.http20Enabled] Http20Enabled: configures a web + * site to allow clients to connect over http2.0 + * + * @param {string} [siteConfig.minTlsVersion] MinTlsVersion: configures the + * minimum version of TLS required for SSL requests. Possible values include: + * '1.0', '1.1', '1.2' + * + * @param {string} [siteConfig.ftpsState] State of FTP / FTPS service. Possible + * values include: 'AllAllowed', 'FtpsOnly', 'Disabled' + * + * @param {number} [siteConfig.reservedInstanceCount] Number of reserved + * instances. + * This setting only applies to the Consumption Plan + * + * @param {string} [siteConfig.kind] Kind of resource. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will update configuration for the production slot. + * + * @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. + */ + createOrUpdateConfigurationSlotWithHttpOperationResponse(resourceGroupName, name, siteConfig, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._createOrUpdateConfigurationSlot(resourceGroupName, name, siteConfig, slot, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Updates the configuration of an app. + * + * Updates the configuration of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} siteConfig JSON representation of a SiteConfig object. See + * example. + * + * @param {number} [siteConfig.numberOfWorkers] Number of workers. + * + * @param {array} [siteConfig.defaultDocuments] Default documents. + * + * @param {string} [siteConfig.netFrameworkVersion] .NET Framework version. + * + * @param {string} [siteConfig.phpVersion] Version of PHP. + * + * @param {string} [siteConfig.pythonVersion] Version of Python. + * + * @param {string} [siteConfig.nodeVersion] Version of Node.js. + * + * @param {string} [siteConfig.linuxFxVersion] Linux App Framework and version + * + * @param {string} [siteConfig.windowsFxVersion] Xenon App Framework and + * version + * + * @param {boolean} [siteConfig.requestTracingEnabled] true if + * request tracing is enabled; otherwise, false. + * + * @param {date} [siteConfig.requestTracingExpirationTime] Request tracing + * expiration time. + * + * @param {boolean} [siteConfig.remoteDebuggingEnabled] true if + * remote debugging is enabled; otherwise, false. + * + * @param {string} [siteConfig.remoteDebuggingVersion] Remote debugging + * version. + * + * @param {boolean} [siteConfig.httpLoggingEnabled] true if HTTP + * logging is enabled; otherwise, false. + * + * @param {number} [siteConfig.logsDirectorySizeLimit] HTTP logs directory size + * limit. + * + * @param {boolean} [siteConfig.detailedErrorLoggingEnabled] true + * if detailed error logging is enabled; otherwise, false. + * + * @param {string} [siteConfig.publishingUsername] Publishing user name. + * + * @param {array} [siteConfig.appSettings] Application settings. + * + * @param {object} [siteConfig.azureStorageAccounts] User-provided Azure + * storage accounts. + * + * @param {array} [siteConfig.connectionStrings] Connection strings. + * + * @param {array} [siteConfig.handlerMappings] Handler mappings. + * + * @param {string} [siteConfig.documentRoot] Document root. + * + * @param {string} [siteConfig.scmType] SCM type. Possible values include: + * 'None', 'Dropbox', 'Tfs', 'LocalGit', 'GitHub', 'CodePlexGit', 'CodePlexHg', + * 'BitbucketGit', 'BitbucketHg', 'ExternalGit', 'ExternalHg', 'OneDrive', + * 'VSO' + * + * @param {boolean} [siteConfig.use32BitWorkerProcess] true to use + * 32-bit worker process; otherwise, false. + * + * @param {boolean} [siteConfig.webSocketsEnabled] true if + * WebSocket is enabled; otherwise, false. + * + * @param {boolean} [siteConfig.alwaysOn] true if Always On is + * enabled; otherwise, false. + * + * @param {string} [siteConfig.javaVersion] Java version. + * + * @param {string} [siteConfig.javaContainer] Java container. + * + * @param {string} [siteConfig.javaContainerVersion] Java container version. + * + * @param {string} [siteConfig.appCommandLine] App command line to launch. + * + * @param {string} [siteConfig.managedPipelineMode] Managed pipeline mode. + * Possible values include: 'Integrated', 'Classic' + * + * @param {array} [siteConfig.virtualApplications] Virtual applications. + * + * @param {string} [siteConfig.loadBalancing] Site load balancing. Possible + * values include: 'WeightedRoundRobin', 'LeastRequests', 'LeastResponseTime', + * 'WeightedTotalTraffic', 'RequestHash' + * + * @param {object} [siteConfig.experiments] This is work around for polymophic + * types. + * + * @param {array} [siteConfig.experiments.rampUpRules] List of ramp-up rules. + * + * @param {object} [siteConfig.limits] Site limits. + * + * @param {number} [siteConfig.limits.maxPercentageCpu] Maximum allowed CPU + * usage percentage. + * + * @param {number} [siteConfig.limits.maxMemoryInMb] Maximum allowed memory + * usage in MB. + * + * @param {number} [siteConfig.limits.maxDiskSizeInMb] Maximum allowed disk + * size usage in MB. + * + * @param {boolean} [siteConfig.autoHealEnabled] true if Auto Heal + * is enabled; otherwise, false. + * + * @param {object} [siteConfig.autoHealRules] Auto Heal rules. + * + * @param {object} [siteConfig.autoHealRules.triggers] Conditions that describe + * when to execute the auto-heal actions. + * + * @param {object} [siteConfig.autoHealRules.triggers.requests] A rule based on + * total requests. + * + * @param {number} [siteConfig.autoHealRules.triggers.requests.count] Request + * Count. + * + * @param {string} [siteConfig.autoHealRules.triggers.requests.timeInterval] + * Time interval. + * + * @param {number} [siteConfig.autoHealRules.triggers.privateBytesInKB] A rule + * based on private bytes. + * + * @param {array} [siteConfig.autoHealRules.triggers.statusCodes] A rule based + * on status codes. + * + * @param {object} [siteConfig.autoHealRules.triggers.slowRequests] A rule + * based on request execution time. + * + * @param {string} [siteConfig.autoHealRules.triggers.slowRequests.timeTaken] + * Time taken. + * + * @param {number} [siteConfig.autoHealRules.triggers.slowRequests.count] + * Request Count. + * + * @param {string} + * [siteConfig.autoHealRules.triggers.slowRequests.timeInterval] Time interval. + * + * @param {object} [siteConfig.autoHealRules.actions] Actions to be executed + * when a rule is triggered. + * + * @param {string} [siteConfig.autoHealRules.actions.actionType] Predefined + * action to be taken. Possible values include: 'Recycle', 'LogEvent', + * 'CustomAction' + * + * @param {object} [siteConfig.autoHealRules.actions.customAction] Custom + * action to be taken. + * + * @param {string} [siteConfig.autoHealRules.actions.customAction.exe] + * Executable to be run. + * + * @param {string} [siteConfig.autoHealRules.actions.customAction.parameters] + * Parameters for the executable. + * + * @param {string} [siteConfig.autoHealRules.actions.minProcessExecutionTime] + * Minimum time the process must execute + * before taking the action + * + * @param {string} [siteConfig.tracingOptions] Tracing options. + * + * @param {string} [siteConfig.vnetName] Virtual Network name. + * + * @param {object} [siteConfig.cors] Cross-Origin Resource Sharing (CORS) + * settings. + * + * @param {array} [siteConfig.cors.allowedOrigins] Gets or sets the list of + * origins that should be allowed to make cross-origin + * calls (for example: http://example.com:12345). Use "*" to allow all. + * + * @param {object} [siteConfig.push] Push endpoint settings. + * + * @param {boolean} siteConfig.push.isPushEnabled Gets or sets a flag + * indicating whether the Push endpoint is enabled. + * + * @param {string} [siteConfig.push.tagWhitelistJson] Gets or sets a JSON + * string containing a list of tags that are whitelisted for use by the push + * registration endpoint. + * + * @param {string} [siteConfig.push.tagsRequiringAuth] Gets or sets a JSON + * string containing a list of tags that require user authentication to be used + * in the push registration endpoint. + * Tags can consist of alphanumeric characters and the following: + * '_', '@', '#', '.', ':', '-'. + * Validation should be performed at the PushRequestHandler. + * + * @param {string} [siteConfig.push.dynamicTagsJson] Gets or sets a JSON string + * containing a list of dynamic tags that will be evaluated from user claims in + * the push registration endpoint. + * + * @param {string} [siteConfig.push.kind] Kind of resource. + * + * @param {object} [siteConfig.apiDefinition] Information about the formal API + * definition for the app. + * + * @param {string} [siteConfig.apiDefinition.url] The URL of the API + * definition. + * + * @param {string} [siteConfig.autoSwapSlotName] Auto-swap slot name. + * + * @param {boolean} [siteConfig.localMySqlEnabled] true to enable + * local MySQL; otherwise, false. + * + * @param {number} [siteConfig.managedServiceIdentityId] Managed Service + * Identity Id + * + * @param {number} [siteConfig.xManagedServiceIdentityId] Explicit Managed + * Service Identity Id + * + * @param {array} [siteConfig.ipSecurityRestrictions] IP security restrictions. + * + * @param {boolean} [siteConfig.http20Enabled] Http20Enabled: configures a web + * site to allow clients to connect over http2.0 + * + * @param {string} [siteConfig.minTlsVersion] MinTlsVersion: configures the + * minimum version of TLS required for SSL requests. Possible values include: + * '1.0', '1.1', '1.2' + * + * @param {string} [siteConfig.ftpsState] State of FTP / FTPS service. Possible + * values include: 'AllAllowed', 'FtpsOnly', 'Disabled' + * + * @param {number} [siteConfig.reservedInstanceCount] Number of reserved + * instances. + * This setting only applies to the Consumption Plan + * + * @param {string} [siteConfig.kind] Kind of resource. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will update configuration for the production slot. + * + * @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 {SiteConfigResource} - 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 SiteConfigResource} 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. + */ + createOrUpdateConfigurationSlot(resourceGroupName, name, siteConfig, slot, 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._createOrUpdateConfigurationSlot(resourceGroupName, name, siteConfig, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._createOrUpdateConfigurationSlot(resourceGroupName, name, siteConfig, slot, options, optionalCallback); + } + } + + /** + * @summary Updates the configuration of an app. + * + * Updates the configuration of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} siteConfig JSON representation of a SiteConfig object. See + * example. + * + * @param {number} [siteConfig.numberOfWorkers] Number of workers. + * + * @param {array} [siteConfig.defaultDocuments] Default documents. + * + * @param {string} [siteConfig.netFrameworkVersion] .NET Framework version. + * + * @param {string} [siteConfig.phpVersion] Version of PHP. + * + * @param {string} [siteConfig.pythonVersion] Version of Python. + * + * @param {string} [siteConfig.nodeVersion] Version of Node.js. + * + * @param {string} [siteConfig.linuxFxVersion] Linux App Framework and version + * + * @param {string} [siteConfig.windowsFxVersion] Xenon App Framework and + * version + * + * @param {boolean} [siteConfig.requestTracingEnabled] true if + * request tracing is enabled; otherwise, false. + * + * @param {date} [siteConfig.requestTracingExpirationTime] Request tracing + * expiration time. + * + * @param {boolean} [siteConfig.remoteDebuggingEnabled] true if + * remote debugging is enabled; otherwise, false. + * + * @param {string} [siteConfig.remoteDebuggingVersion] Remote debugging + * version. + * + * @param {boolean} [siteConfig.httpLoggingEnabled] true if HTTP + * logging is enabled; otherwise, false. + * + * @param {number} [siteConfig.logsDirectorySizeLimit] HTTP logs directory size + * limit. + * + * @param {boolean} [siteConfig.detailedErrorLoggingEnabled] true + * if detailed error logging is enabled; otherwise, false. + * + * @param {string} [siteConfig.publishingUsername] Publishing user name. + * + * @param {array} [siteConfig.appSettings] Application settings. + * + * @param {object} [siteConfig.azureStorageAccounts] User-provided Azure + * storage accounts. + * + * @param {array} [siteConfig.connectionStrings] Connection strings. + * + * @param {array} [siteConfig.handlerMappings] Handler mappings. + * + * @param {string} [siteConfig.documentRoot] Document root. + * + * @param {string} [siteConfig.scmType] SCM type. Possible values include: + * 'None', 'Dropbox', 'Tfs', 'LocalGit', 'GitHub', 'CodePlexGit', 'CodePlexHg', + * 'BitbucketGit', 'BitbucketHg', 'ExternalGit', 'ExternalHg', 'OneDrive', + * 'VSO' + * + * @param {boolean} [siteConfig.use32BitWorkerProcess] true to use + * 32-bit worker process; otherwise, false. + * + * @param {boolean} [siteConfig.webSocketsEnabled] true if + * WebSocket is enabled; otherwise, false. + * + * @param {boolean} [siteConfig.alwaysOn] true if Always On is + * enabled; otherwise, false. + * + * @param {string} [siteConfig.javaVersion] Java version. + * + * @param {string} [siteConfig.javaContainer] Java container. + * + * @param {string} [siteConfig.javaContainerVersion] Java container version. + * + * @param {string} [siteConfig.appCommandLine] App command line to launch. + * + * @param {string} [siteConfig.managedPipelineMode] Managed pipeline mode. + * Possible values include: 'Integrated', 'Classic' + * + * @param {array} [siteConfig.virtualApplications] Virtual applications. + * + * @param {string} [siteConfig.loadBalancing] Site load balancing. Possible + * values include: 'WeightedRoundRobin', 'LeastRequests', 'LeastResponseTime', + * 'WeightedTotalTraffic', 'RequestHash' + * + * @param {object} [siteConfig.experiments] This is work around for polymophic + * types. + * + * @param {array} [siteConfig.experiments.rampUpRules] List of ramp-up rules. + * + * @param {object} [siteConfig.limits] Site limits. + * + * @param {number} [siteConfig.limits.maxPercentageCpu] Maximum allowed CPU + * usage percentage. + * + * @param {number} [siteConfig.limits.maxMemoryInMb] Maximum allowed memory + * usage in MB. + * + * @param {number} [siteConfig.limits.maxDiskSizeInMb] Maximum allowed disk + * size usage in MB. + * + * @param {boolean} [siteConfig.autoHealEnabled] true if Auto Heal + * is enabled; otherwise, false. + * + * @param {object} [siteConfig.autoHealRules] Auto Heal rules. + * + * @param {object} [siteConfig.autoHealRules.triggers] Conditions that describe + * when to execute the auto-heal actions. + * + * @param {object} [siteConfig.autoHealRules.triggers.requests] A rule based on + * total requests. + * + * @param {number} [siteConfig.autoHealRules.triggers.requests.count] Request + * Count. + * + * @param {string} [siteConfig.autoHealRules.triggers.requests.timeInterval] + * Time interval. + * + * @param {number} [siteConfig.autoHealRules.triggers.privateBytesInKB] A rule + * based on private bytes. + * + * @param {array} [siteConfig.autoHealRules.triggers.statusCodes] A rule based + * on status codes. + * + * @param {object} [siteConfig.autoHealRules.triggers.slowRequests] A rule + * based on request execution time. + * + * @param {string} [siteConfig.autoHealRules.triggers.slowRequests.timeTaken] + * Time taken. + * + * @param {number} [siteConfig.autoHealRules.triggers.slowRequests.count] + * Request Count. + * + * @param {string} + * [siteConfig.autoHealRules.triggers.slowRequests.timeInterval] Time interval. + * + * @param {object} [siteConfig.autoHealRules.actions] Actions to be executed + * when a rule is triggered. + * + * @param {string} [siteConfig.autoHealRules.actions.actionType] Predefined + * action to be taken. Possible values include: 'Recycle', 'LogEvent', + * 'CustomAction' + * + * @param {object} [siteConfig.autoHealRules.actions.customAction] Custom + * action to be taken. + * + * @param {string} [siteConfig.autoHealRules.actions.customAction.exe] + * Executable to be run. + * + * @param {string} [siteConfig.autoHealRules.actions.customAction.parameters] + * Parameters for the executable. + * + * @param {string} [siteConfig.autoHealRules.actions.minProcessExecutionTime] + * Minimum time the process must execute + * before taking the action + * + * @param {string} [siteConfig.tracingOptions] Tracing options. + * + * @param {string} [siteConfig.vnetName] Virtual Network name. + * + * @param {object} [siteConfig.cors] Cross-Origin Resource Sharing (CORS) + * settings. + * + * @param {array} [siteConfig.cors.allowedOrigins] Gets or sets the list of + * origins that should be allowed to make cross-origin + * calls (for example: http://example.com:12345). Use "*" to allow all. + * + * @param {object} [siteConfig.push] Push endpoint settings. + * + * @param {boolean} siteConfig.push.isPushEnabled Gets or sets a flag + * indicating whether the Push endpoint is enabled. + * + * @param {string} [siteConfig.push.tagWhitelistJson] Gets or sets a JSON + * string containing a list of tags that are whitelisted for use by the push + * registration endpoint. + * + * @param {string} [siteConfig.push.tagsRequiringAuth] Gets or sets a JSON + * string containing a list of tags that require user authentication to be used + * in the push registration endpoint. + * Tags can consist of alphanumeric characters and the following: + * '_', '@', '#', '.', ':', '-'. + * Validation should be performed at the PushRequestHandler. + * + * @param {string} [siteConfig.push.dynamicTagsJson] Gets or sets a JSON string + * containing a list of dynamic tags that will be evaluated from user claims in + * the push registration endpoint. + * + * @param {string} [siteConfig.push.kind] Kind of resource. + * + * @param {object} [siteConfig.apiDefinition] Information about the formal API + * definition for the app. + * + * @param {string} [siteConfig.apiDefinition.url] The URL of the API + * definition. + * + * @param {string} [siteConfig.autoSwapSlotName] Auto-swap slot name. + * + * @param {boolean} [siteConfig.localMySqlEnabled] true to enable + * local MySQL; otherwise, false. + * + * @param {number} [siteConfig.managedServiceIdentityId] Managed Service + * Identity Id + * + * @param {number} [siteConfig.xManagedServiceIdentityId] Explicit Managed + * Service Identity Id + * + * @param {array} [siteConfig.ipSecurityRestrictions] IP security restrictions. + * + * @param {boolean} [siteConfig.http20Enabled] Http20Enabled: configures a web + * site to allow clients to connect over http2.0 + * + * @param {string} [siteConfig.minTlsVersion] MinTlsVersion: configures the + * minimum version of TLS required for SSL requests. Possible values include: + * '1.0', '1.1', '1.2' + * + * @param {string} [siteConfig.ftpsState] State of FTP / FTPS service. Possible + * values include: 'AllAllowed', 'FtpsOnly', 'Disabled' + * + * @param {number} [siteConfig.reservedInstanceCount] Number of reserved + * instances. + * This setting only applies to the Consumption Plan + * + * @param {string} [siteConfig.kind] Kind of resource. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will update configuration for the production slot. + * + * @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. + */ + updateConfigurationSlotWithHttpOperationResponse(resourceGroupName, name, siteConfig, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._updateConfigurationSlot(resourceGroupName, name, siteConfig, slot, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Updates the configuration of an app. + * + * Updates the configuration of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} siteConfig JSON representation of a SiteConfig object. See + * example. + * + * @param {number} [siteConfig.numberOfWorkers] Number of workers. + * + * @param {array} [siteConfig.defaultDocuments] Default documents. + * + * @param {string} [siteConfig.netFrameworkVersion] .NET Framework version. + * + * @param {string} [siteConfig.phpVersion] Version of PHP. + * + * @param {string} [siteConfig.pythonVersion] Version of Python. + * + * @param {string} [siteConfig.nodeVersion] Version of Node.js. + * + * @param {string} [siteConfig.linuxFxVersion] Linux App Framework and version + * + * @param {string} [siteConfig.windowsFxVersion] Xenon App Framework and + * version + * + * @param {boolean} [siteConfig.requestTracingEnabled] true if + * request tracing is enabled; otherwise, false. + * + * @param {date} [siteConfig.requestTracingExpirationTime] Request tracing + * expiration time. + * + * @param {boolean} [siteConfig.remoteDebuggingEnabled] true if + * remote debugging is enabled; otherwise, false. + * + * @param {string} [siteConfig.remoteDebuggingVersion] Remote debugging + * version. + * + * @param {boolean} [siteConfig.httpLoggingEnabled] true if HTTP + * logging is enabled; otherwise, false. + * + * @param {number} [siteConfig.logsDirectorySizeLimit] HTTP logs directory size + * limit. + * + * @param {boolean} [siteConfig.detailedErrorLoggingEnabled] true + * if detailed error logging is enabled; otherwise, false. + * + * @param {string} [siteConfig.publishingUsername] Publishing user name. + * + * @param {array} [siteConfig.appSettings] Application settings. + * + * @param {object} [siteConfig.azureStorageAccounts] User-provided Azure + * storage accounts. + * + * @param {array} [siteConfig.connectionStrings] Connection strings. + * + * @param {array} [siteConfig.handlerMappings] Handler mappings. + * + * @param {string} [siteConfig.documentRoot] Document root. + * + * @param {string} [siteConfig.scmType] SCM type. Possible values include: + * 'None', 'Dropbox', 'Tfs', 'LocalGit', 'GitHub', 'CodePlexGit', 'CodePlexHg', + * 'BitbucketGit', 'BitbucketHg', 'ExternalGit', 'ExternalHg', 'OneDrive', + * 'VSO' + * + * @param {boolean} [siteConfig.use32BitWorkerProcess] true to use + * 32-bit worker process; otherwise, false. + * + * @param {boolean} [siteConfig.webSocketsEnabled] true if + * WebSocket is enabled; otherwise, false. + * + * @param {boolean} [siteConfig.alwaysOn] true if Always On is + * enabled; otherwise, false. + * + * @param {string} [siteConfig.javaVersion] Java version. + * + * @param {string} [siteConfig.javaContainer] Java container. + * + * @param {string} [siteConfig.javaContainerVersion] Java container version. + * + * @param {string} [siteConfig.appCommandLine] App command line to launch. + * + * @param {string} [siteConfig.managedPipelineMode] Managed pipeline mode. + * Possible values include: 'Integrated', 'Classic' + * + * @param {array} [siteConfig.virtualApplications] Virtual applications. + * + * @param {string} [siteConfig.loadBalancing] Site load balancing. Possible + * values include: 'WeightedRoundRobin', 'LeastRequests', 'LeastResponseTime', + * 'WeightedTotalTraffic', 'RequestHash' + * + * @param {object} [siteConfig.experiments] This is work around for polymophic + * types. + * + * @param {array} [siteConfig.experiments.rampUpRules] List of ramp-up rules. + * + * @param {object} [siteConfig.limits] Site limits. + * + * @param {number} [siteConfig.limits.maxPercentageCpu] Maximum allowed CPU + * usage percentage. + * + * @param {number} [siteConfig.limits.maxMemoryInMb] Maximum allowed memory + * usage in MB. + * + * @param {number} [siteConfig.limits.maxDiskSizeInMb] Maximum allowed disk + * size usage in MB. + * + * @param {boolean} [siteConfig.autoHealEnabled] true if Auto Heal + * is enabled; otherwise, false. + * + * @param {object} [siteConfig.autoHealRules] Auto Heal rules. + * + * @param {object} [siteConfig.autoHealRules.triggers] Conditions that describe + * when to execute the auto-heal actions. + * + * @param {object} [siteConfig.autoHealRules.triggers.requests] A rule based on + * total requests. + * + * @param {number} [siteConfig.autoHealRules.triggers.requests.count] Request + * Count. + * + * @param {string} [siteConfig.autoHealRules.triggers.requests.timeInterval] + * Time interval. + * + * @param {number} [siteConfig.autoHealRules.triggers.privateBytesInKB] A rule + * based on private bytes. + * + * @param {array} [siteConfig.autoHealRules.triggers.statusCodes] A rule based + * on status codes. + * + * @param {object} [siteConfig.autoHealRules.triggers.slowRequests] A rule + * based on request execution time. + * + * @param {string} [siteConfig.autoHealRules.triggers.slowRequests.timeTaken] + * Time taken. + * + * @param {number} [siteConfig.autoHealRules.triggers.slowRequests.count] + * Request Count. + * + * @param {string} + * [siteConfig.autoHealRules.triggers.slowRequests.timeInterval] Time interval. + * + * @param {object} [siteConfig.autoHealRules.actions] Actions to be executed + * when a rule is triggered. + * + * @param {string} [siteConfig.autoHealRules.actions.actionType] Predefined + * action to be taken. Possible values include: 'Recycle', 'LogEvent', + * 'CustomAction' + * + * @param {object} [siteConfig.autoHealRules.actions.customAction] Custom + * action to be taken. + * + * @param {string} [siteConfig.autoHealRules.actions.customAction.exe] + * Executable to be run. + * + * @param {string} [siteConfig.autoHealRules.actions.customAction.parameters] + * Parameters for the executable. + * + * @param {string} [siteConfig.autoHealRules.actions.minProcessExecutionTime] + * Minimum time the process must execute + * before taking the action + * + * @param {string} [siteConfig.tracingOptions] Tracing options. + * + * @param {string} [siteConfig.vnetName] Virtual Network name. + * + * @param {object} [siteConfig.cors] Cross-Origin Resource Sharing (CORS) + * settings. + * + * @param {array} [siteConfig.cors.allowedOrigins] Gets or sets the list of + * origins that should be allowed to make cross-origin + * calls (for example: http://example.com:12345). Use "*" to allow all. + * + * @param {object} [siteConfig.push] Push endpoint settings. + * + * @param {boolean} siteConfig.push.isPushEnabled Gets or sets a flag + * indicating whether the Push endpoint is enabled. + * + * @param {string} [siteConfig.push.tagWhitelistJson] Gets or sets a JSON + * string containing a list of tags that are whitelisted for use by the push + * registration endpoint. + * + * @param {string} [siteConfig.push.tagsRequiringAuth] Gets or sets a JSON + * string containing a list of tags that require user authentication to be used + * in the push registration endpoint. + * Tags can consist of alphanumeric characters and the following: + * '_', '@', '#', '.', ':', '-'. + * Validation should be performed at the PushRequestHandler. + * + * @param {string} [siteConfig.push.dynamicTagsJson] Gets or sets a JSON string + * containing a list of dynamic tags that will be evaluated from user claims in + * the push registration endpoint. + * + * @param {string} [siteConfig.push.kind] Kind of resource. + * + * @param {object} [siteConfig.apiDefinition] Information about the formal API + * definition for the app. + * + * @param {string} [siteConfig.apiDefinition.url] The URL of the API + * definition. + * + * @param {string} [siteConfig.autoSwapSlotName] Auto-swap slot name. + * + * @param {boolean} [siteConfig.localMySqlEnabled] true to enable + * local MySQL; otherwise, false. + * + * @param {number} [siteConfig.managedServiceIdentityId] Managed Service + * Identity Id + * + * @param {number} [siteConfig.xManagedServiceIdentityId] Explicit Managed + * Service Identity Id + * + * @param {array} [siteConfig.ipSecurityRestrictions] IP security restrictions. + * + * @param {boolean} [siteConfig.http20Enabled] Http20Enabled: configures a web + * site to allow clients to connect over http2.0 + * + * @param {string} [siteConfig.minTlsVersion] MinTlsVersion: configures the + * minimum version of TLS required for SSL requests. Possible values include: + * '1.0', '1.1', '1.2' + * + * @param {string} [siteConfig.ftpsState] State of FTP / FTPS service. Possible + * values include: 'AllAllowed', 'FtpsOnly', 'Disabled' + * + * @param {number} [siteConfig.reservedInstanceCount] Number of reserved + * instances. + * This setting only applies to the Consumption Plan + * + * @param {string} [siteConfig.kind] Kind of resource. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will update configuration for the production slot. + * + * @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 {SiteConfigResource} - 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 SiteConfigResource} 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. + */ + updateConfigurationSlot(resourceGroupName, name, siteConfig, slot, 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._updateConfigurationSlot(resourceGroupName, name, siteConfig, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._updateConfigurationSlot(resourceGroupName, name, siteConfig, slot, options, optionalCallback); + } + } + + /** + * @summary Gets a list of web app configuration snapshots identifiers. Each + * element of the list contains a timestamp and the ID of the snapshot. + * + * Gets a list of web app configuration snapshots identifiers. Each element of + * the list contains a timestamp and the ID of the snapshot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will return configuration for the production slot. + * + * @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. + */ + listConfigurationSnapshotInfoSlotWithHttpOperationResponse(resourceGroupName, name, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listConfigurationSnapshotInfoSlot(resourceGroupName, name, slot, 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 web app configuration snapshots identifiers. Each + * element of the list contains a timestamp and the ID of the snapshot. + * + * Gets a list of web app configuration snapshots identifiers. Each element of + * the list contains a timestamp and the ID of the snapshot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will return configuration for the production slot. + * + * @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 {SiteConfigurationSnapshotInfoCollection} - 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 SiteConfigurationSnapshotInfoCollection} 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. + */ + listConfigurationSnapshotInfoSlot(resourceGroupName, name, slot, 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._listConfigurationSnapshotInfoSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listConfigurationSnapshotInfoSlot(resourceGroupName, name, slot, options, optionalCallback); + } + } + + /** + * @summary Gets a snapshot of the configuration of an app at a previous point + * in time. + * + * Gets a snapshot of the configuration of an app at a previous point in time. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} snapshotId The ID of the snapshot to read. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will return configuration for the production slot. + * + * @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. + */ + getConfigurationSnapshotSlotWithHttpOperationResponse(resourceGroupName, name, snapshotId, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._getConfigurationSnapshotSlot(resourceGroupName, name, snapshotId, slot, 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 snapshot of the configuration of an app at a previous point + * in time. + * + * Gets a snapshot of the configuration of an app at a previous point in time. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} snapshotId The ID of the snapshot to read. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will return configuration for the production slot. + * + * @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 {SiteConfigResource} - 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 SiteConfigResource} 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. + */ + getConfigurationSnapshotSlot(resourceGroupName, name, snapshotId, slot, 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._getConfigurationSnapshotSlot(resourceGroupName, name, snapshotId, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getConfigurationSnapshotSlot(resourceGroupName, name, snapshotId, slot, options, optionalCallback); + } + } + + /** + * @summary Reverts the configuration of an app to a previous snapshot. + * + * Reverts the configuration of an app to a previous snapshot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} snapshotId The ID of the snapshot to read. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will return configuration for the production slot. + * + * @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. + */ + recoverSiteConfigurationSnapshotSlotWithHttpOperationResponse(resourceGroupName, name, snapshotId, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._recoverSiteConfigurationSnapshotSlot(resourceGroupName, name, snapshotId, slot, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Reverts the configuration of an app to a previous snapshot. + * + * Reverts the configuration of an app to a previous snapshot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} snapshotId The ID of the snapshot to read. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will return configuration for the production slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + recoverSiteConfigurationSnapshotSlot(resourceGroupName, name, snapshotId, slot, 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._recoverSiteConfigurationSnapshotSlot(resourceGroupName, name, snapshotId, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._recoverSiteConfigurationSnapshotSlot(resourceGroupName, name, snapshotId, slot, options, optionalCallback); + } + } + + /** + * @summary Gets the last lines of docker logs for the given site + * + * Gets the last lines of docker logs for the given site + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {string} slot Name of web app slot. If not specified then will + * default to production slot. + * + * @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. + */ + getWebSiteContainerLogsSlotWithHttpOperationResponse(resourceGroupName, name, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._getWebSiteContainerLogsSlot(resourceGroupName, name, slot, 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 the last lines of docker logs for the given site + * + * Gets the last lines of docker logs for the given site + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {string} slot Name of web app slot. If not specified then will + * default to production slot. + * + * @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 {Object} - 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. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + getWebSiteContainerLogsSlot(resourceGroupName, name, slot, 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._getWebSiteContainerLogsSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getWebSiteContainerLogsSlot(resourceGroupName, name, slot, options, optionalCallback); + } + } + + /** + * @summary Gets the ZIP archived docker log files for the given site + * + * Gets the ZIP archived docker log files for the given site + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {string} slot Name of web app slot. If not specified then will + * default to production slot. + * + * @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. + */ + getContainerLogsZipSlotWithHttpOperationResponse(resourceGroupName, name, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._getContainerLogsZipSlot(resourceGroupName, name, slot, 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 the ZIP archived docker log files for the given site + * + * Gets the ZIP archived docker log files for the given site + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {string} slot Name of web app slot. If not specified then will + * default to production slot. + * + * @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 {Object} - 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. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + getContainerLogsZipSlot(resourceGroupName, name, slot, 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._getContainerLogsZipSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getContainerLogsZipSlot(resourceGroupName, name, slot, options, optionalCallback); + } + } + + /** + * @summary List continuous web jobs for an app, or a deployment slot. + * + * List continuous web jobs for an app, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API deletes a deployment for the production slot. + * + * @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. + */ + listContinuousWebJobsSlotWithHttpOperationResponse(resourceGroupName, name, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listContinuousWebJobsSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary List continuous web jobs for an app, or a deployment slot. + * + * List continuous web jobs for an app, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API deletes a deployment for the production slot. + * + * @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 {ContinuousWebJobCollection} - 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 ContinuousWebJobCollection} 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. + */ + listContinuousWebJobsSlot(resourceGroupName, name, slot, 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._listContinuousWebJobsSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listContinuousWebJobsSlot(resourceGroupName, name, slot, options, optionalCallback); + } + } + + /** + * @summary Gets a continuous web job by its ID for an app, or a deployment + * slot. + * + * Gets a continuous web job by its ID for an app, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} webJobName Name of Web Job. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API deletes a deployment for the production slot. + * + * @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. + */ + getContinuousWebJobSlotWithHttpOperationResponse(resourceGroupName, name, webJobName, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._getContinuousWebJobSlot(resourceGroupName, name, webJobName, slot, 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 continuous web job by its ID for an app, or a deployment + * slot. + * + * Gets a continuous web job by its ID for an app, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} webJobName Name of Web Job. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API deletes a deployment for the production slot. + * + * @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 {ContinuousWebJob} - 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 ContinuousWebJob} 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. + */ + getContinuousWebJobSlot(resourceGroupName, name, webJobName, slot, 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._getContinuousWebJobSlot(resourceGroupName, name, webJobName, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getContinuousWebJobSlot(resourceGroupName, name, webJobName, slot, options, optionalCallback); + } + } + + /** + * @summary Delete a continuous web job by its ID for an app, or a deployment + * slot. + * + * Delete a continuous web job by its ID for an app, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} webJobName Name of Web Job. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API deletes a deployment for the production slot. + * + * @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. + */ + deleteContinuousWebJobSlotWithHttpOperationResponse(resourceGroupName, name, webJobName, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._deleteContinuousWebJobSlot(resourceGroupName, name, webJobName, slot, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Delete a continuous web job by its ID for an app, or a deployment + * slot. + * + * Delete a continuous web job by its ID for an app, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} webJobName Name of Web Job. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API deletes a deployment for the production slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + deleteContinuousWebJobSlot(resourceGroupName, name, webJobName, slot, 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._deleteContinuousWebJobSlot(resourceGroupName, name, webJobName, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._deleteContinuousWebJobSlot(resourceGroupName, name, webJobName, slot, options, optionalCallback); + } + } + + /** + * @summary Start a continuous web job for an app, or a deployment slot. + * + * Start a continuous web job for an app, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} webJobName Name of Web Job. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API deletes a deployment for the production slot. + * + * @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. + */ + startContinuousWebJobSlotWithHttpOperationResponse(resourceGroupName, name, webJobName, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._startContinuousWebJobSlot(resourceGroupName, name, webJobName, slot, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Start a continuous web job for an app, or a deployment slot. + * + * Start a continuous web job for an app, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} webJobName Name of Web Job. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API deletes a deployment for the production slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + startContinuousWebJobSlot(resourceGroupName, name, webJobName, slot, 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._startContinuousWebJobSlot(resourceGroupName, name, webJobName, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._startContinuousWebJobSlot(resourceGroupName, name, webJobName, slot, options, optionalCallback); + } + } + + /** + * @summary Stop a continuous web job for an app, or a deployment slot. + * + * Stop a continuous web job for an app, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} webJobName Name of Web Job. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API deletes a deployment for the production slot. + * + * @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. + */ + stopContinuousWebJobSlotWithHttpOperationResponse(resourceGroupName, name, webJobName, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._stopContinuousWebJobSlot(resourceGroupName, name, webJobName, slot, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Stop a continuous web job for an app, or a deployment slot. + * + * Stop a continuous web job for an app, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} webJobName Name of Web Job. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API deletes a deployment for the production slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + stopContinuousWebJobSlot(resourceGroupName, name, webJobName, slot, 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._stopContinuousWebJobSlot(resourceGroupName, name, webJobName, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._stopContinuousWebJobSlot(resourceGroupName, name, webJobName, slot, options, optionalCallback); + } + } + + /** + * @summary List deployments for an app, or a deployment slot. + * + * List deployments for an app, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API returns deployments for the production slot. + * + * @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. + */ + listDeploymentsSlotWithHttpOperationResponse(resourceGroupName, name, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listDeploymentsSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary List deployments for an app, or a deployment slot. + * + * List deployments for an app, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API returns deployments for the production slot. + * + * @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 {DeploymentCollection} - 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 DeploymentCollection} 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. + */ + listDeploymentsSlot(resourceGroupName, name, slot, 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._listDeploymentsSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listDeploymentsSlot(resourceGroupName, name, slot, options, optionalCallback); + } + } + + /** + * @summary Get a deployment by its ID for an app, or a deployment slot. + * + * Get a deployment by its ID for an app, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} id Deployment ID. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API gets a deployment for the production slot. + * + * @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. + */ + getDeploymentSlotWithHttpOperationResponse(resourceGroupName, name, id, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._getDeploymentSlot(resourceGroupName, name, id, slot, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Get a deployment by its ID for an app, or a deployment slot. + * + * Get a deployment by its ID for an app, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} id Deployment ID. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API gets a deployment for the production slot. + * + * @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 {Deployment} - 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 Deployment} 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. + */ + getDeploymentSlot(resourceGroupName, name, id, slot, 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._getDeploymentSlot(resourceGroupName, name, id, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getDeploymentSlot(resourceGroupName, name, id, slot, options, optionalCallback); + } + } + + /** + * @summary Create a deployment for an app, or a deployment slot. + * + * Create a deployment for an app, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} id ID of an existing deployment. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API creates a deployment for the production slot. + * + * @param {object} deployment Deployment details. + * + * @param {number} [deployment.status] Deployment status. + * + * @param {string} [deployment.message] Details about deployment status. + * + * @param {string} [deployment.author] Who authored the deployment. + * + * @param {string} [deployment.deployer] Who performed the deployment. + * + * @param {string} [deployment.authorEmail] Author email. + * + * @param {date} [deployment.startTime] Start time. + * + * @param {date} [deployment.endTime] End time. + * + * @param {boolean} [deployment.active] True if deployment is currently active, + * false if completed and null if not started. + * + * @param {string} [deployment.details] Details on deployment. + * + * @param {string} [deployment.kind] Kind of resource. + * + * @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. + */ + createDeploymentSlotWithHttpOperationResponse(resourceGroupName, name, id, slot, deployment, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._createDeploymentSlot(resourceGroupName, name, id, slot, deployment, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Create a deployment for an app, or a deployment slot. + * + * Create a deployment for an app, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} id ID of an existing deployment. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API creates a deployment for the production slot. + * + * @param {object} deployment Deployment details. + * + * @param {number} [deployment.status] Deployment status. + * + * @param {string} [deployment.message] Details about deployment status. + * + * @param {string} [deployment.author] Who authored the deployment. + * + * @param {string} [deployment.deployer] Who performed the deployment. + * + * @param {string} [deployment.authorEmail] Author email. + * + * @param {date} [deployment.startTime] Start time. + * + * @param {date} [deployment.endTime] End time. + * + * @param {boolean} [deployment.active] True if deployment is currently active, + * false if completed and null if not started. + * + * @param {string} [deployment.details] Details on deployment. + * + * @param {string} [deployment.kind] Kind of resource. + * + * @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 {Deployment} - 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 Deployment} 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. + */ + createDeploymentSlot(resourceGroupName, name, id, slot, deployment, 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._createDeploymentSlot(resourceGroupName, name, id, slot, deployment, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._createDeploymentSlot(resourceGroupName, name, id, slot, deployment, options, optionalCallback); + } + } + + /** + * @summary Delete a deployment by its ID for an app, or a deployment slot. + * + * Delete a deployment by its ID for an app, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} id Deployment ID. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API deletes a deployment for the production slot. + * + * @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. + */ + deleteDeploymentSlotWithHttpOperationResponse(resourceGroupName, name, id, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._deleteDeploymentSlot(resourceGroupName, name, id, slot, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Delete a deployment by its ID for an app, or a deployment slot. + * + * Delete a deployment by its ID for an app, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} id Deployment ID. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API deletes a deployment for the production slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + deleteDeploymentSlot(resourceGroupName, name, id, slot, 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._deleteDeploymentSlot(resourceGroupName, name, id, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._deleteDeploymentSlot(resourceGroupName, name, id, slot, options, optionalCallback); + } + } + + /** + * @summary List deployment log for specific deployment for an app, or a + * deployment slot. + * + * List deployment log for specific deployment for an app, or a deployment + * slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} id The ID of a specific deployment. This is the value of the + * name property in the JSON response from "GET + * /api/sites/{siteName}/deployments". + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API returns deployments for the production slot. + * + * @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. + */ + listDeploymentLogSlotWithHttpOperationResponse(resourceGroupName, name, id, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listDeploymentLogSlot(resourceGroupName, name, id, slot, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary List deployment log for specific deployment for an app, or a + * deployment slot. + * + * List deployment log for specific deployment for an app, or a deployment + * slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} id The ID of a specific deployment. This is the value of the + * name property in the JSON response from "GET + * /api/sites/{siteName}/deployments". + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API returns deployments for the production slot. + * + * @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 {Deployment} - 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 Deployment} 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. + */ + listDeploymentLogSlot(resourceGroupName, name, id, slot, 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._listDeploymentLogSlot(resourceGroupName, name, id, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listDeploymentLogSlot(resourceGroupName, name, id, slot, options, optionalCallback); + } + } + + /** + * @summary Discovers an existing app backup that can be restored from a blob + * in Azure storage. Use this to get information about the databases stored in + * a backup. + * + * Discovers an existing app backup that can be restored from a blob in Azure + * storage. Use this to get information about the databases stored in a backup. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} request A RestoreRequest object that includes Azure storage + * URL and blog name for discovery of backup. + * + * @param {string} request.storageAccountUrl SAS URL to the container. + * + * @param {string} [request.blobName] Name of a blob which contains the backup. + * + * @param {boolean} request.overwrite true if the restore + * operation can overwrite target app; otherwise, false. + * true is needed if trying to restore over an existing app. + * + * @param {string} [request.siteName] Name of an app. + * + * @param {array} [request.databases] Collection of databases which should be + * restored. This list has to match the list of databases included in the + * backup. + * + * @param {boolean} [request.ignoreConflictingHostNames] Changes a logic when + * restoring an app with custom domains. true to remove custom + * domains automatically. If false, custom domains are added to + * the app's object when it is being restored, but that might fail due to + * conflicts during the operation. + * + * @param {boolean} [request.ignoreDatabases] Ignore the databases and only + * restore the site content + * + * @param {string} [request.appServicePlan] Specify app service plan that will + * own restored site. + * + * @param {string} [request.operationType] Operation type. Possible values + * include: 'Default', 'Clone', 'Relocation', 'Snapshot', 'CloudFS' + * + * @param {boolean} [request.adjustConnectionStrings] true if + * SiteConfig.ConnectionStrings should be set in new app; otherwise, + * false. + * + * @param {string} [request.hostingEnvironment] App Service Environment name, + * if needed (only when restoring an app to an App Service Environment). + * + * @param {string} [request.kind] Kind of resource. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will perform discovery for the production slot. + * + * @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. + */ + discoverBackupSlotWithHttpOperationResponse(resourceGroupName, name, request, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._discoverBackupSlot(resourceGroupName, name, request, slot, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Discovers an existing app backup that can be restored from a blob + * in Azure storage. Use this to get information about the databases stored in + * a backup. + * + * Discovers an existing app backup that can be restored from a blob in Azure + * storage. Use this to get information about the databases stored in a backup. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} request A RestoreRequest object that includes Azure storage + * URL and blog name for discovery of backup. + * + * @param {string} request.storageAccountUrl SAS URL to the container. + * + * @param {string} [request.blobName] Name of a blob which contains the backup. + * + * @param {boolean} request.overwrite true if the restore + * operation can overwrite target app; otherwise, false. + * true is needed if trying to restore over an existing app. + * + * @param {string} [request.siteName] Name of an app. + * + * @param {array} [request.databases] Collection of databases which should be + * restored. This list has to match the list of databases included in the + * backup. + * + * @param {boolean} [request.ignoreConflictingHostNames] Changes a logic when + * restoring an app with custom domains. true to remove custom + * domains automatically. If false, custom domains are added to + * the app's object when it is being restored, but that might fail due to + * conflicts during the operation. + * + * @param {boolean} [request.ignoreDatabases] Ignore the databases and only + * restore the site content + * + * @param {string} [request.appServicePlan] Specify app service plan that will + * own restored site. + * + * @param {string} [request.operationType] Operation type. Possible values + * include: 'Default', 'Clone', 'Relocation', 'Snapshot', 'CloudFS' + * + * @param {boolean} [request.adjustConnectionStrings] true if + * SiteConfig.ConnectionStrings should be set in new app; otherwise, + * false. + * + * @param {string} [request.hostingEnvironment] App Service Environment name, + * if needed (only when restoring an app to an App Service Environment). + * + * @param {string} [request.kind] Kind of resource. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will perform discovery for the production slot. + * + * @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 {RestoreRequest} - 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 RestoreRequest} 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. + */ + discoverBackupSlot(resourceGroupName, name, request, slot, 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._discoverBackupSlot(resourceGroupName, name, request, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._discoverBackupSlot(resourceGroupName, name, request, slot, options, optionalCallback); + } + } + + /** + * @summary Lists ownership identifiers for domain associated with web app. + * + * Lists ownership identifiers for domain associated with web app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will delete the binding for the production slot. + * + * @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. + */ + listDomainOwnershipIdentifiersSlotWithHttpOperationResponse(resourceGroupName, name, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listDomainOwnershipIdentifiersSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Lists ownership identifiers for domain associated with web app. + * + * Lists ownership identifiers for domain associated with web app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will delete the binding for the production slot. + * + * @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 {IdentifierCollection} - 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 IdentifierCollection} 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. + */ + listDomainOwnershipIdentifiersSlot(resourceGroupName, name, slot, 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._listDomainOwnershipIdentifiersSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listDomainOwnershipIdentifiersSlot(resourceGroupName, name, slot, options, optionalCallback); + } + } + + /** + * @summary Get domain ownership identifier for web app. + * + * Get domain ownership identifier for web app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} domainOwnershipIdentifierName Name of domain ownership + * identifier. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will delete the binding for the production slot. + * + * @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. + */ + getDomainOwnershipIdentifierSlotWithHttpOperationResponse(resourceGroupName, name, domainOwnershipIdentifierName, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._getDomainOwnershipIdentifierSlot(resourceGroupName, name, domainOwnershipIdentifierName, slot, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Get domain ownership identifier for web app. + * + * Get domain ownership identifier for web app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} domainOwnershipIdentifierName Name of domain ownership + * identifier. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will delete the binding for the production slot. + * + * @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 {Identifier} - 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 Identifier} 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. + */ + getDomainOwnershipIdentifierSlot(resourceGroupName, name, domainOwnershipIdentifierName, slot, 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._getDomainOwnershipIdentifierSlot(resourceGroupName, name, domainOwnershipIdentifierName, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getDomainOwnershipIdentifierSlot(resourceGroupName, name, domainOwnershipIdentifierName, slot, options, optionalCallback); + } + } + + /** + * @summary Creates a domain ownership identifier for web app, or updates an + * existing ownership identifier. + * + * Creates a domain ownership identifier for web app, or updates an existing + * ownership identifier. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} domainOwnershipIdentifierName Name of domain ownership + * identifier. + * + * @param {object} domainOwnershipIdentifier A JSON representation of the + * domain ownership properties. + * + * @param {string} [domainOwnershipIdentifier.identifierId] String + * representation of the identity. + * + * @param {string} [domainOwnershipIdentifier.kind] Kind of resource. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will delete the binding for the production slot. + * + * @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. + */ + createOrUpdateDomainOwnershipIdentifierSlotWithHttpOperationResponse(resourceGroupName, name, domainOwnershipIdentifierName, domainOwnershipIdentifier, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._createOrUpdateDomainOwnershipIdentifierSlot(resourceGroupName, name, domainOwnershipIdentifierName, domainOwnershipIdentifier, slot, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Creates a domain ownership identifier for web app, or updates an + * existing ownership identifier. + * + * Creates a domain ownership identifier for web app, or updates an existing + * ownership identifier. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} domainOwnershipIdentifierName Name of domain ownership + * identifier. + * + * @param {object} domainOwnershipIdentifier A JSON representation of the + * domain ownership properties. + * + * @param {string} [domainOwnershipIdentifier.identifierId] String + * representation of the identity. + * + * @param {string} [domainOwnershipIdentifier.kind] Kind of resource. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will delete the binding for the production slot. + * + * @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 {Identifier} - 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 Identifier} 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. + */ + createOrUpdateDomainOwnershipIdentifierSlot(resourceGroupName, name, domainOwnershipIdentifierName, domainOwnershipIdentifier, slot, 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._createOrUpdateDomainOwnershipIdentifierSlot(resourceGroupName, name, domainOwnershipIdentifierName, domainOwnershipIdentifier, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._createOrUpdateDomainOwnershipIdentifierSlot(resourceGroupName, name, domainOwnershipIdentifierName, domainOwnershipIdentifier, slot, options, optionalCallback); + } + } + + /** + * @summary Deletes a domain ownership identifier for a web app. + * + * Deletes a domain ownership identifier for a web app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} domainOwnershipIdentifierName Name of domain ownership + * identifier. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will delete the binding for the production slot. + * + * @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. + */ + deleteDomainOwnershipIdentifierSlotWithHttpOperationResponse(resourceGroupName, name, domainOwnershipIdentifierName, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._deleteDomainOwnershipIdentifierSlot(resourceGroupName, name, domainOwnershipIdentifierName, slot, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Deletes a domain ownership identifier for a web app. + * + * Deletes a domain ownership identifier for a web app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} domainOwnershipIdentifierName Name of domain ownership + * identifier. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will delete the binding for the production slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + deleteDomainOwnershipIdentifierSlot(resourceGroupName, name, domainOwnershipIdentifierName, slot, 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._deleteDomainOwnershipIdentifierSlot(resourceGroupName, name, domainOwnershipIdentifierName, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._deleteDomainOwnershipIdentifierSlot(resourceGroupName, name, domainOwnershipIdentifierName, slot, options, optionalCallback); + } + } + + /** + * @summary Creates a domain ownership identifier for web app, or updates an + * existing ownership identifier. + * + * Creates a domain ownership identifier for web app, or updates an existing + * ownership identifier. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} domainOwnershipIdentifierName Name of domain ownership + * identifier. + * + * @param {object} domainOwnershipIdentifier A JSON representation of the + * domain ownership properties. + * + * @param {string} [domainOwnershipIdentifier.identifierId] String + * representation of the identity. + * + * @param {string} [domainOwnershipIdentifier.kind] Kind of resource. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will delete the binding for the production slot. + * + * @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. + */ + updateDomainOwnershipIdentifierSlotWithHttpOperationResponse(resourceGroupName, name, domainOwnershipIdentifierName, domainOwnershipIdentifier, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._updateDomainOwnershipIdentifierSlot(resourceGroupName, name, domainOwnershipIdentifierName, domainOwnershipIdentifier, slot, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Creates a domain ownership identifier for web app, or updates an + * existing ownership identifier. + * + * Creates a domain ownership identifier for web app, or updates an existing + * ownership identifier. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} domainOwnershipIdentifierName Name of domain ownership + * identifier. + * + * @param {object} domainOwnershipIdentifier A JSON representation of the + * domain ownership properties. + * + * @param {string} [domainOwnershipIdentifier.identifierId] String + * representation of the identity. + * + * @param {string} [domainOwnershipIdentifier.kind] Kind of resource. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will delete the binding for the production slot. + * + * @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 {Identifier} - 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 Identifier} 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. + */ + updateDomainOwnershipIdentifierSlot(resourceGroupName, name, domainOwnershipIdentifierName, domainOwnershipIdentifier, slot, 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._updateDomainOwnershipIdentifierSlot(resourceGroupName, name, domainOwnershipIdentifierName, domainOwnershipIdentifier, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._updateDomainOwnershipIdentifierSlot(resourceGroupName, name, domainOwnershipIdentifierName, domainOwnershipIdentifier, slot, options, optionalCallback); + } + } + + /** + * @summary Get the status of the last MSDeploy operation. + * + * Get the status of the last MSDeploy operation. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {string} slot Name of web app slot. If not specified then will + * default to production slot. + * + * @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. + */ + getMSDeployStatusSlotWithHttpOperationResponse(resourceGroupName, name, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._getMSDeployStatusSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Get the status of the last MSDeploy operation. + * + * Get the status of the last MSDeploy operation. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {string} slot Name of web app slot. If not specified then will + * default to production slot. + * + * @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 {MSDeployStatus} - 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 MSDeployStatus} 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. + */ + getMSDeployStatusSlot(resourceGroupName, name, slot, 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._getMSDeployStatusSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getMSDeployStatusSlot(resourceGroupName, name, slot, options, optionalCallback); + } + } + + /** + * @summary Invoke the MSDeploy web app extension. + * + * Invoke the MSDeploy web app extension. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {string} slot Name of web app slot. If not specified then will + * default to production slot. + * + * @param {object} mSDeploy Details of MSDeploy operation + * + * @param {string} [mSDeploy.packageUri] Package URI + * + * @param {string} [mSDeploy.connectionString] SQL Connection String + * + * @param {string} [mSDeploy.dbType] Database Type + * + * @param {string} [mSDeploy.setParametersXmlFileUri] URI of MSDeploy + * Parameters file. Must not be set if SetParameters is used. + * + * @param {object} [mSDeploy.setParameters] MSDeploy Parameters. Must not be + * set if SetParametersXmlFileUri is used. + * + * @param {boolean} [mSDeploy.skipAppData] Controls whether the MSDeploy + * operation skips the App_Data directory. + * If set to true, the existing App_Data directory on the + * destination + * will not be deleted, and any App_Data directory in the source will be + * ignored. + * Setting is false by default. + * + * @param {boolean} [mSDeploy.appOffline] Sets the AppOffline rule while the + * MSDeploy operation executes. + * Setting is false by default. + * + * @param {string} [mSDeploy.kind] Kind of resource. + * + * @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. + */ + createMSDeployOperationSlotWithHttpOperationResponse(resourceGroupName, name, slot, mSDeploy, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._createMSDeployOperationSlot(resourceGroupName, name, slot, mSDeploy, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Invoke the MSDeploy web app extension. + * + * Invoke the MSDeploy web app extension. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {string} slot Name of web app slot. If not specified then will + * default to production slot. + * + * @param {object} mSDeploy Details of MSDeploy operation + * + * @param {string} [mSDeploy.packageUri] Package URI + * + * @param {string} [mSDeploy.connectionString] SQL Connection String + * + * @param {string} [mSDeploy.dbType] Database Type + * + * @param {string} [mSDeploy.setParametersXmlFileUri] URI of MSDeploy + * Parameters file. Must not be set if SetParameters is used. + * + * @param {object} [mSDeploy.setParameters] MSDeploy Parameters. Must not be + * set if SetParametersXmlFileUri is used. + * + * @param {boolean} [mSDeploy.skipAppData] Controls whether the MSDeploy + * operation skips the App_Data directory. + * If set to true, the existing App_Data directory on the + * destination + * will not be deleted, and any App_Data directory in the source will be + * ignored. + * Setting is false by default. + * + * @param {boolean} [mSDeploy.appOffline] Sets the AppOffline rule while the + * MSDeploy operation executes. + * Setting is false by default. + * + * @param {string} [mSDeploy.kind] Kind of resource. + * + * @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 {MSDeployStatus} - 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 MSDeployStatus} 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. + */ + createMSDeployOperationSlot(resourceGroupName, name, slot, mSDeploy, 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._createMSDeployOperationSlot(resourceGroupName, name, slot, mSDeploy, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._createMSDeployOperationSlot(resourceGroupName, name, slot, mSDeploy, options, optionalCallback); + } + } + + /** + * @summary Get the MSDeploy Log for the last MSDeploy operation. + * + * Get the MSDeploy Log for the last MSDeploy operation. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {string} slot Name of web app slot. If not specified then will + * default to production slot. + * + * @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. + */ + getMSDeployLogSlotWithHttpOperationResponse(resourceGroupName, name, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._getMSDeployLogSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Get the MSDeploy Log for the last MSDeploy operation. + * + * Get the MSDeploy Log for the last MSDeploy operation. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {string} slot Name of web app slot. If not specified then will + * default to production slot. + * + * @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 {MSDeployLog} - 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 MSDeployLog} 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. + */ + getMSDeployLogSlot(resourceGroupName, name, slot, 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._getMSDeployLogSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getMSDeployLogSlot(resourceGroupName, name, slot, options, optionalCallback); + } + } + + /** + * @summary List the functions for a web site, or a deployment slot. + * + * List the functions for a web site, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API deletes a deployment for the production slot. + * + * @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. + */ + listInstanceFunctionsSlotWithHttpOperationResponse(resourceGroupName, name, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listInstanceFunctionsSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary List the functions for a web site, or a deployment slot. + * + * List the functions for a web site, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API deletes a deployment for the production slot. + * + * @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 {FunctionEnvelopeCollection} - 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 FunctionEnvelopeCollection} 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. + */ + listInstanceFunctionsSlot(resourceGroupName, name, slot, 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._listInstanceFunctionsSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listInstanceFunctionsSlot(resourceGroupName, name, slot, options, optionalCallback); + } + } + + /** + * @summary Fetch a short lived token that can be exchanged for a master key. + * + * Fetch a short lived token that can be exchanged for a master key. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {string} slot Name of web app slot. If not specified then will + * default to production slot. + * + * @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. + */ + getFunctionsAdminTokenSlotWithHttpOperationResponse(resourceGroupName, name, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._getFunctionsAdminTokenSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Fetch a short lived token that can be exchanged for a master key. + * + * Fetch a short lived token that can be exchanged for a master key. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {string} slot Name of web app slot. If not specified then will + * default to production slot. + * + * @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 {String} - 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. + * + * {string} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + getFunctionsAdminTokenSlot(resourceGroupName, name, slot, 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._getFunctionsAdminTokenSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getFunctionsAdminTokenSlot(resourceGroupName, name, slot, options, optionalCallback); + } + } + + /** + * @summary Get function information by its ID for web site, or a deployment + * slot. + * + * Get function information by its ID for web site, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} functionName Function name. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API deletes a deployment for the production slot. + * + * @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. + */ + getInstanceFunctionSlotWithHttpOperationResponse(resourceGroupName, name, functionName, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._getInstanceFunctionSlot(resourceGroupName, name, functionName, slot, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Get function information by its ID for web site, or a deployment + * slot. + * + * Get function information by its ID for web site, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} functionName Function name. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API deletes a deployment for the production slot. + * + * @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 {FunctionEnvelope} - 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 FunctionEnvelope} 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. + */ + getInstanceFunctionSlot(resourceGroupName, name, functionName, slot, 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._getInstanceFunctionSlot(resourceGroupName, name, functionName, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getInstanceFunctionSlot(resourceGroupName, name, functionName, slot, options, optionalCallback); + } + } + + /** + * @summary Create function for web site, or a deployment slot. + * + * Create function for web site, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} functionName Function name. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API deletes a deployment for the production slot. + * + * @param {object} functionEnvelope Function details. + * + * @param {string} [functionEnvelope.functionAppId] Function App ID. + * + * @param {string} [functionEnvelope.scriptRootPathHref] Script root path URI. + * + * @param {string} [functionEnvelope.scriptHref] Script URI. + * + * @param {string} [functionEnvelope.configHref] Config URI. + * + * @param {string} [functionEnvelope.secretsFileHref] Secrets file URI. + * + * @param {string} [functionEnvelope.href] Function URI. + * + * @param {object} [functionEnvelope.config] Config information. + * + * @param {object} [functionEnvelope.files] File list. + * + * @param {string} [functionEnvelope.testData] Test data used when testing via + * the Azure Portal. + * + * @param {string} [functionEnvelope.kind] Kind of resource. + * + * @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. + */ + createInstanceFunctionSlotWithHttpOperationResponse(resourceGroupName, name, functionName, slot, functionEnvelope, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._createInstanceFunctionSlot(resourceGroupName, name, functionName, slot, functionEnvelope, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Create function for web site, or a deployment slot. + * + * Create function for web site, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} functionName Function name. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API deletes a deployment for the production slot. + * + * @param {object} functionEnvelope Function details. + * + * @param {string} [functionEnvelope.functionAppId] Function App ID. + * + * @param {string} [functionEnvelope.scriptRootPathHref] Script root path URI. + * + * @param {string} [functionEnvelope.scriptHref] Script URI. + * + * @param {string} [functionEnvelope.configHref] Config URI. + * + * @param {string} [functionEnvelope.secretsFileHref] Secrets file URI. + * + * @param {string} [functionEnvelope.href] Function URI. + * + * @param {object} [functionEnvelope.config] Config information. + * + * @param {object} [functionEnvelope.files] File list. + * + * @param {string} [functionEnvelope.testData] Test data used when testing via + * the Azure Portal. + * + * @param {string} [functionEnvelope.kind] Kind of resource. + * + * @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 {FunctionEnvelope} - 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 FunctionEnvelope} 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. + */ + createInstanceFunctionSlot(resourceGroupName, name, functionName, slot, functionEnvelope, 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._createInstanceFunctionSlot(resourceGroupName, name, functionName, slot, functionEnvelope, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._createInstanceFunctionSlot(resourceGroupName, name, functionName, slot, functionEnvelope, options, optionalCallback); + } + } + + /** + * @summary Delete a function for web site, or a deployment slot. + * + * Delete a function for web site, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} functionName Function name. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API deletes a deployment for the production slot. + * + * @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. + */ + deleteInstanceFunctionSlotWithHttpOperationResponse(resourceGroupName, name, functionName, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._deleteInstanceFunctionSlot(resourceGroupName, name, functionName, slot, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Delete a function for web site, or a deployment slot. + * + * Delete a function for web site, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} functionName Function name. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API deletes a deployment for the production slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + deleteInstanceFunctionSlot(resourceGroupName, name, functionName, slot, 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._deleteInstanceFunctionSlot(resourceGroupName, name, functionName, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._deleteInstanceFunctionSlot(resourceGroupName, name, functionName, slot, options, optionalCallback); + } + } + + /** + * @summary Get function secrets for a function in a web site, or a deployment + * slot. + * + * Get function secrets for a function in a web site, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} functionName Function name. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API deletes a deployment for the production slot. + * + * @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. + */ + listFunctionSecretsSlotWithHttpOperationResponse(resourceGroupName, name, functionName, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listFunctionSecretsSlot(resourceGroupName, name, functionName, slot, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Get function secrets for a function in a web site, or a deployment + * slot. + * + * Get function secrets for a function in a web site, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} functionName Function name. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API deletes a deployment for the production slot. + * + * @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 {FunctionSecrets} - 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 FunctionSecrets} 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. + */ + listFunctionSecretsSlot(resourceGroupName, name, functionName, slot, 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._listFunctionSecretsSlot(resourceGroupName, name, functionName, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listFunctionSecretsSlot(resourceGroupName, name, functionName, slot, options, optionalCallback); + } + } + + /** + * @summary Get hostname bindings for an app or a deployment slot. + * + * Get hostname bindings for an app or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API gets hostname bindings for the production slot. + * + * @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. + */ + listHostNameBindingsSlotWithHttpOperationResponse(resourceGroupName, name, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listHostNameBindingsSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Get hostname bindings for an app or a deployment slot. + * + * Get hostname bindings for an app or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API gets hostname bindings for the production slot. + * + * @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 {HostNameBindingCollection} - 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 HostNameBindingCollection} 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. + */ + listHostNameBindingsSlot(resourceGroupName, name, slot, 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._listHostNameBindingsSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listHostNameBindingsSlot(resourceGroupName, name, slot, options, optionalCallback); + } + } + + /** + * @summary Get the named hostname binding for an app (or deployment slot, if + * specified). + * + * Get the named hostname binding for an app (or deployment slot, if + * specified). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API the named binding for the production slot. + * + * @param {string} hostName Hostname in the hostname binding. + * + * @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. + */ + getHostNameBindingSlotWithHttpOperationResponse(resourceGroupName, name, slot, hostName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._getHostNameBindingSlot(resourceGroupName, name, slot, hostName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Get the named hostname binding for an app (or deployment slot, if + * specified). + * + * Get the named hostname binding for an app (or deployment slot, if + * specified). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API the named binding for the production slot. + * + * @param {string} hostName Hostname in the hostname binding. + * + * @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 {HostNameBinding} - 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 HostNameBinding} 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. + */ + getHostNameBindingSlot(resourceGroupName, name, slot, hostName, 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._getHostNameBindingSlot(resourceGroupName, name, slot, hostName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getHostNameBindingSlot(resourceGroupName, name, slot, hostName, options, optionalCallback); + } + } + + /** + * @summary Creates a hostname binding for an app. + * + * Creates a hostname binding for an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} hostName Hostname in the hostname binding. + * + * @param {object} hostNameBinding Binding details. This is the JSON + * representation of a HostNameBinding object. + * + * @param {string} [hostNameBinding.siteName] App Service app name. + * + * @param {string} [hostNameBinding.domainId] Fully qualified ARM domain + * resource URI. + * + * @param {string} [hostNameBinding.azureResourceName] Azure resource name. + * + * @param {string} [hostNameBinding.azureResourceType] Azure resource type. + * Possible values include: 'Website', 'TrafficManager' + * + * @param {string} [hostNameBinding.customHostNameDnsRecordType] Custom DNS + * record type. Possible values include: 'CName', 'A' + * + * @param {string} [hostNameBinding.hostNameType] Hostname type. Possible + * values include: 'Verified', 'Managed' + * + * @param {string} [hostNameBinding.sslState] SSL type. Possible values + * include: 'Disabled', 'SniEnabled', 'IpBasedEnabled' + * + * @param {string} [hostNameBinding.thumbprint] SSL certificate thumbprint + * + * @param {string} [hostNameBinding.kind] Kind of resource. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will create a binding for the production slot. + * + * @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. + */ + createOrUpdateHostNameBindingSlotWithHttpOperationResponse(resourceGroupName, name, hostName, hostNameBinding, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._createOrUpdateHostNameBindingSlot(resourceGroupName, name, hostName, hostNameBinding, slot, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Creates a hostname binding for an app. + * + * Creates a hostname binding for an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} hostName Hostname in the hostname binding. + * + * @param {object} hostNameBinding Binding details. This is the JSON + * representation of a HostNameBinding object. + * + * @param {string} [hostNameBinding.siteName] App Service app name. + * + * @param {string} [hostNameBinding.domainId] Fully qualified ARM domain + * resource URI. + * + * @param {string} [hostNameBinding.azureResourceName] Azure resource name. + * + * @param {string} [hostNameBinding.azureResourceType] Azure resource type. + * Possible values include: 'Website', 'TrafficManager' + * + * @param {string} [hostNameBinding.customHostNameDnsRecordType] Custom DNS + * record type. Possible values include: 'CName', 'A' + * + * @param {string} [hostNameBinding.hostNameType] Hostname type. Possible + * values include: 'Verified', 'Managed' + * + * @param {string} [hostNameBinding.sslState] SSL type. Possible values + * include: 'Disabled', 'SniEnabled', 'IpBasedEnabled' + * + * @param {string} [hostNameBinding.thumbprint] SSL certificate thumbprint + * + * @param {string} [hostNameBinding.kind] Kind of resource. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will create a binding for the production slot. + * + * @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 {HostNameBinding} - 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 HostNameBinding} 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. + */ + createOrUpdateHostNameBindingSlot(resourceGroupName, name, hostName, hostNameBinding, slot, 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._createOrUpdateHostNameBindingSlot(resourceGroupName, name, hostName, hostNameBinding, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._createOrUpdateHostNameBindingSlot(resourceGroupName, name, hostName, hostNameBinding, slot, options, optionalCallback); + } + } + + /** + * @summary Deletes a hostname binding for an app. + * + * Deletes a hostname binding for an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will delete the binding for the production slot. + * + * @param {string} hostName Hostname in the hostname binding. + * + * @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. + */ + deleteHostNameBindingSlotWithHttpOperationResponse(resourceGroupName, name, slot, hostName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._deleteHostNameBindingSlot(resourceGroupName, name, slot, hostName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Deletes a hostname binding for an app. + * + * Deletes a hostname binding for an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will delete the binding for the production slot. + * + * @param {string} hostName Hostname in the hostname binding. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + deleteHostNameBindingSlot(resourceGroupName, name, slot, hostName, 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._deleteHostNameBindingSlot(resourceGroupName, name, slot, hostName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._deleteHostNameBindingSlot(resourceGroupName, name, slot, hostName, options, optionalCallback); + } + } + + /** + * @summary Retrieves a specific Service Bus Hybrid Connection used by this Web + * App. + * + * Retrieves a specific Service Bus Hybrid Connection used by this Web App. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @param {string} namespaceName The namespace for this hybrid connection. + * + * @param {string} relayName The relay name for this hybrid connection. + * + * @param {string} slot The name of the slot for the web app. + * + * @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. + */ + getHybridConnectionSlotWithHttpOperationResponse(resourceGroupName, name, namespaceName, relayName, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._getHybridConnectionSlot(resourceGroupName, name, namespaceName, relayName, slot, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Retrieves a specific Service Bus Hybrid Connection used by this Web + * App. + * + * Retrieves a specific Service Bus Hybrid Connection used by this Web App. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @param {string} namespaceName The namespace for this hybrid connection. + * + * @param {string} relayName The relay name for this hybrid connection. + * + * @param {string} slot The name of the slot for the web app. + * + * @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 {HybridConnection} - 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 HybridConnection} 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. + */ + getHybridConnectionSlot(resourceGroupName, name, namespaceName, relayName, slot, 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._getHybridConnectionSlot(resourceGroupName, name, namespaceName, relayName, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getHybridConnectionSlot(resourceGroupName, name, namespaceName, relayName, slot, options, optionalCallback); + } + } + + /** + * @summary Creates a new Hybrid Connection using a Service Bus relay. + * + * Creates a new Hybrid Connection using a Service Bus relay. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @param {string} namespaceName The namespace for this hybrid connection. + * + * @param {string} relayName The relay name for this hybrid connection. + * + * @param {object} connectionEnvelope The details of the hybrid connection. + * + * @param {string} [connectionEnvelope.serviceBusNamespace] The name of the + * Service Bus namespace. + * + * @param {string} [connectionEnvelope.relayName] The name of the Service Bus + * relay. + * + * @param {string} [connectionEnvelope.relayArmUri] The ARM URI to the Service + * Bus relay. + * + * @param {string} [connectionEnvelope.hostname] The hostname of the endpoint. + * + * @param {number} [connectionEnvelope.port] The port of the endpoint. + * + * @param {string} [connectionEnvelope.sendKeyName] The name of the Service Bus + * key which has Send permissions. This is used to authenticate to Service Bus. + * + * @param {string} [connectionEnvelope.sendKeyValue] The value of the Service + * Bus key. This is used to authenticate to Service Bus. In ARM this key will + * not be returned + * normally, use the POST /listKeys API instead. + * + * @param {string} [connectionEnvelope.serviceBusSuffix] The suffix for the + * service bus endpoint. By default this is .servicebus.windows.net + * + * @param {string} [connectionEnvelope.kind] Kind of resource. + * + * @param {string} slot The name of the slot for the web app. + * + * @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. + */ + createOrUpdateHybridConnectionSlotWithHttpOperationResponse(resourceGroupName, name, namespaceName, relayName, connectionEnvelope, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._createOrUpdateHybridConnectionSlot(resourceGroupName, name, namespaceName, relayName, connectionEnvelope, slot, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Creates a new Hybrid Connection using a Service Bus relay. + * + * Creates a new Hybrid Connection using a Service Bus relay. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @param {string} namespaceName The namespace for this hybrid connection. + * + * @param {string} relayName The relay name for this hybrid connection. + * + * @param {object} connectionEnvelope The details of the hybrid connection. + * + * @param {string} [connectionEnvelope.serviceBusNamespace] The name of the + * Service Bus namespace. + * + * @param {string} [connectionEnvelope.relayName] The name of the Service Bus + * relay. + * + * @param {string} [connectionEnvelope.relayArmUri] The ARM URI to the Service + * Bus relay. + * + * @param {string} [connectionEnvelope.hostname] The hostname of the endpoint. + * + * @param {number} [connectionEnvelope.port] The port of the endpoint. + * + * @param {string} [connectionEnvelope.sendKeyName] The name of the Service Bus + * key which has Send permissions. This is used to authenticate to Service Bus. + * + * @param {string} [connectionEnvelope.sendKeyValue] The value of the Service + * Bus key. This is used to authenticate to Service Bus. In ARM this key will + * not be returned + * normally, use the POST /listKeys API instead. + * + * @param {string} [connectionEnvelope.serviceBusSuffix] The suffix for the + * service bus endpoint. By default this is .servicebus.windows.net + * + * @param {string} [connectionEnvelope.kind] Kind of resource. + * + * @param {string} slot The name of the slot for the web app. + * + * @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 {HybridConnection} - 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 HybridConnection} 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. + */ + createOrUpdateHybridConnectionSlot(resourceGroupName, name, namespaceName, relayName, connectionEnvelope, slot, 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._createOrUpdateHybridConnectionSlot(resourceGroupName, name, namespaceName, relayName, connectionEnvelope, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._createOrUpdateHybridConnectionSlot(resourceGroupName, name, namespaceName, relayName, connectionEnvelope, slot, options, optionalCallback); + } + } + + /** + * @summary Removes a Hybrid Connection from this site. + * + * Removes a Hybrid Connection from this site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @param {string} namespaceName The namespace for this hybrid connection. + * + * @param {string} relayName The relay name for this hybrid connection. + * + * @param {string} slot The name of the slot for the web app. + * + * @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. + */ + deleteHybridConnectionSlotWithHttpOperationResponse(resourceGroupName, name, namespaceName, relayName, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._deleteHybridConnectionSlot(resourceGroupName, name, namespaceName, relayName, slot, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Removes a Hybrid Connection from this site. + * + * Removes a Hybrid Connection from this site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @param {string} namespaceName The namespace for this hybrid connection. + * + * @param {string} relayName The relay name for this hybrid connection. + * + * @param {string} slot The name of the slot for the web app. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + deleteHybridConnectionSlot(resourceGroupName, name, namespaceName, relayName, slot, 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._deleteHybridConnectionSlot(resourceGroupName, name, namespaceName, relayName, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._deleteHybridConnectionSlot(resourceGroupName, name, namespaceName, relayName, slot, options, optionalCallback); + } + } + + /** + * @summary Creates a new Hybrid Connection using a Service Bus relay. + * + * Creates a new Hybrid Connection using a Service Bus relay. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @param {string} namespaceName The namespace for this hybrid connection. + * + * @param {string} relayName The relay name for this hybrid connection. + * + * @param {object} connectionEnvelope The details of the hybrid connection. + * + * @param {string} [connectionEnvelope.serviceBusNamespace] The name of the + * Service Bus namespace. + * + * @param {string} [connectionEnvelope.relayName] The name of the Service Bus + * relay. + * + * @param {string} [connectionEnvelope.relayArmUri] The ARM URI to the Service + * Bus relay. + * + * @param {string} [connectionEnvelope.hostname] The hostname of the endpoint. + * + * @param {number} [connectionEnvelope.port] The port of the endpoint. + * + * @param {string} [connectionEnvelope.sendKeyName] The name of the Service Bus + * key which has Send permissions. This is used to authenticate to Service Bus. + * + * @param {string} [connectionEnvelope.sendKeyValue] The value of the Service + * Bus key. This is used to authenticate to Service Bus. In ARM this key will + * not be returned + * normally, use the POST /listKeys API instead. + * + * @param {string} [connectionEnvelope.serviceBusSuffix] The suffix for the + * service bus endpoint. By default this is .servicebus.windows.net + * + * @param {string} [connectionEnvelope.kind] Kind of resource. + * + * @param {string} slot The name of the slot for the web app. + * + * @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. + */ + updateHybridConnectionSlotWithHttpOperationResponse(resourceGroupName, name, namespaceName, relayName, connectionEnvelope, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._updateHybridConnectionSlot(resourceGroupName, name, namespaceName, relayName, connectionEnvelope, slot, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Creates a new Hybrid Connection using a Service Bus relay. + * + * Creates a new Hybrid Connection using a Service Bus relay. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @param {string} namespaceName The namespace for this hybrid connection. + * + * @param {string} relayName The relay name for this hybrid connection. + * + * @param {object} connectionEnvelope The details of the hybrid connection. + * + * @param {string} [connectionEnvelope.serviceBusNamespace] The name of the + * Service Bus namespace. + * + * @param {string} [connectionEnvelope.relayName] The name of the Service Bus + * relay. + * + * @param {string} [connectionEnvelope.relayArmUri] The ARM URI to the Service + * Bus relay. + * + * @param {string} [connectionEnvelope.hostname] The hostname of the endpoint. + * + * @param {number} [connectionEnvelope.port] The port of the endpoint. + * + * @param {string} [connectionEnvelope.sendKeyName] The name of the Service Bus + * key which has Send permissions. This is used to authenticate to Service Bus. + * + * @param {string} [connectionEnvelope.sendKeyValue] The value of the Service + * Bus key. This is used to authenticate to Service Bus. In ARM this key will + * not be returned + * normally, use the POST /listKeys API instead. + * + * @param {string} [connectionEnvelope.serviceBusSuffix] The suffix for the + * service bus endpoint. By default this is .servicebus.windows.net + * + * @param {string} [connectionEnvelope.kind] Kind of resource. + * + * @param {string} slot The name of the slot for the web app. + * + * @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 {HybridConnection} - 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 HybridConnection} 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. + */ + updateHybridConnectionSlot(resourceGroupName, name, namespaceName, relayName, connectionEnvelope, slot, 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._updateHybridConnectionSlot(resourceGroupName, name, namespaceName, relayName, connectionEnvelope, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._updateHybridConnectionSlot(resourceGroupName, name, namespaceName, relayName, connectionEnvelope, slot, options, optionalCallback); + } + } + + /** + * @summary Gets the send key name and value for a Hybrid Connection. + * + * Gets the send key name and value for a Hybrid Connection. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @param {string} namespaceName The namespace for this hybrid connection. + * + * @param {string} relayName The relay name for this hybrid connection. + * + * @param {string} slot The name of the slot for the web app. + * + * @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. + */ + listHybridConnectionKeysSlotWithHttpOperationResponse(resourceGroupName, name, namespaceName, relayName, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listHybridConnectionKeysSlot(resourceGroupName, name, namespaceName, relayName, slot, 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 the send key name and value for a Hybrid Connection. + * + * Gets the send key name and value for a Hybrid Connection. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @param {string} namespaceName The namespace for this hybrid connection. + * + * @param {string} relayName The relay name for this hybrid connection. + * + * @param {string} slot The name of the slot for the web app. + * + * @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 {HybridConnectionKey} - 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 HybridConnectionKey} 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. + */ + listHybridConnectionKeysSlot(resourceGroupName, name, namespaceName, relayName, slot, 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._listHybridConnectionKeysSlot(resourceGroupName, name, namespaceName, relayName, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listHybridConnectionKeysSlot(resourceGroupName, name, namespaceName, relayName, slot, options, optionalCallback); + } + } + + /** + * @summary Retrieves all Service Bus Hybrid Connections used by this Web App. + * + * Retrieves all Service Bus Hybrid Connections used by this Web App. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @param {string} slot The name of the slot for the web app. + * + * @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. + */ + listHybridConnectionsSlotWithHttpOperationResponse(resourceGroupName, name, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listHybridConnectionsSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Retrieves all Service Bus Hybrid Connections used by this Web App. + * + * Retrieves all Service Bus Hybrid Connections used by this Web App. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @param {string} slot The name of the slot for the web app. + * + * @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 {HybridConnection} - 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 HybridConnection} 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. + */ + listHybridConnectionsSlot(resourceGroupName, name, slot, 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._listHybridConnectionsSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listHybridConnectionsSlot(resourceGroupName, name, slot, options, optionalCallback); + } + } + + /** + * @summary Gets hybrid connections configured for an app (or deployment slot, + * if specified). + * + * Gets hybrid connections configured for an app (or deployment slot, if + * specified). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will get hybrid connections for the production slot. + * + * @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. + */ + listRelayServiceConnectionsSlotWithHttpOperationResponse(resourceGroupName, name, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listRelayServiceConnectionsSlot(resourceGroupName, name, slot, 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 hybrid connections configured for an app (or deployment slot, + * if specified). + * + * Gets hybrid connections configured for an app (or deployment slot, if + * specified). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will get hybrid connections for the production slot. + * + * @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 {RelayServiceConnectionEntity} - 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 RelayServiceConnectionEntity} 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. + */ + listRelayServiceConnectionsSlot(resourceGroupName, name, slot, 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._listRelayServiceConnectionsSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listRelayServiceConnectionsSlot(resourceGroupName, name, slot, options, optionalCallback); + } + } + + /** + * @summary Gets a hybrid connection configuration by its name. + * + * Gets a hybrid connection configuration by its name. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} entityName Name of the hybrid connection. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will get a hybrid connection for the production slot. + * + * @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. + */ + getRelayServiceConnectionSlotWithHttpOperationResponse(resourceGroupName, name, entityName, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._getRelayServiceConnectionSlot(resourceGroupName, name, entityName, slot, 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 hybrid connection configuration by its name. + * + * Gets a hybrid connection configuration by its name. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} entityName Name of the hybrid connection. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will get a hybrid connection for the production slot. + * + * @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 {RelayServiceConnectionEntity} - 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 RelayServiceConnectionEntity} 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. + */ + getRelayServiceConnectionSlot(resourceGroupName, name, entityName, slot, 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._getRelayServiceConnectionSlot(resourceGroupName, name, entityName, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getRelayServiceConnectionSlot(resourceGroupName, name, entityName, slot, options, optionalCallback); + } + } + + /** + * @summary Creates a new hybrid connection configuration (PUT), or updates an + * existing one (PATCH). + * + * Creates a new hybrid connection configuration (PUT), or updates an existing + * one (PATCH). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} entityName Name of the hybrid connection configuration. + * + * @param {object} connectionEnvelope Details of the hybrid connection + * configuration. + * + * @param {string} [connectionEnvelope.entityName] + * + * @param {string} [connectionEnvelope.entityConnectionString] + * + * @param {string} [connectionEnvelope.resourceType] + * + * @param {string} [connectionEnvelope.resourceConnectionString] + * + * @param {string} [connectionEnvelope.hostname] + * + * @param {number} [connectionEnvelope.port] + * + * @param {string} [connectionEnvelope.biztalkUri] + * + * @param {string} [connectionEnvelope.kind] Kind of resource. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will create or update a hybrid connection for the + * production slot. + * + * @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. + */ + createOrUpdateRelayServiceConnectionSlotWithHttpOperationResponse(resourceGroupName, name, entityName, connectionEnvelope, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._createOrUpdateRelayServiceConnectionSlot(resourceGroupName, name, entityName, connectionEnvelope, slot, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Creates a new hybrid connection configuration (PUT), or updates an + * existing one (PATCH). + * + * Creates a new hybrid connection configuration (PUT), or updates an existing + * one (PATCH). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} entityName Name of the hybrid connection configuration. + * + * @param {object} connectionEnvelope Details of the hybrid connection + * configuration. + * + * @param {string} [connectionEnvelope.entityName] + * + * @param {string} [connectionEnvelope.entityConnectionString] + * + * @param {string} [connectionEnvelope.resourceType] + * + * @param {string} [connectionEnvelope.resourceConnectionString] + * + * @param {string} [connectionEnvelope.hostname] + * + * @param {number} [connectionEnvelope.port] + * + * @param {string} [connectionEnvelope.biztalkUri] + * + * @param {string} [connectionEnvelope.kind] Kind of resource. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will create or update a hybrid connection for the + * production slot. + * + * @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 {RelayServiceConnectionEntity} - 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 RelayServiceConnectionEntity} 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. + */ + createOrUpdateRelayServiceConnectionSlot(resourceGroupName, name, entityName, connectionEnvelope, slot, 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._createOrUpdateRelayServiceConnectionSlot(resourceGroupName, name, entityName, connectionEnvelope, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._createOrUpdateRelayServiceConnectionSlot(resourceGroupName, name, entityName, connectionEnvelope, slot, options, optionalCallback); + } + } + + /** + * @summary Deletes a relay service connection by its name. + * + * Deletes a relay service connection by its name. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} entityName Name of the hybrid connection configuration. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will delete a hybrid connection for the production slot. + * + * @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. + */ + deleteRelayServiceConnectionSlotWithHttpOperationResponse(resourceGroupName, name, entityName, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._deleteRelayServiceConnectionSlot(resourceGroupName, name, entityName, slot, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Deletes a relay service connection by its name. + * + * Deletes a relay service connection by its name. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} entityName Name of the hybrid connection configuration. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will delete a hybrid connection for the production slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + deleteRelayServiceConnectionSlot(resourceGroupName, name, entityName, slot, 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._deleteRelayServiceConnectionSlot(resourceGroupName, name, entityName, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._deleteRelayServiceConnectionSlot(resourceGroupName, name, entityName, slot, options, optionalCallback); + } + } + + /** + * @summary Creates a new hybrid connection configuration (PUT), or updates an + * existing one (PATCH). + * + * Creates a new hybrid connection configuration (PUT), or updates an existing + * one (PATCH). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} entityName Name of the hybrid connection configuration. + * + * @param {object} connectionEnvelope Details of the hybrid connection + * configuration. + * + * @param {string} [connectionEnvelope.entityName] + * + * @param {string} [connectionEnvelope.entityConnectionString] + * + * @param {string} [connectionEnvelope.resourceType] + * + * @param {string} [connectionEnvelope.resourceConnectionString] + * + * @param {string} [connectionEnvelope.hostname] + * + * @param {number} [connectionEnvelope.port] + * + * @param {string} [connectionEnvelope.biztalkUri] + * + * @param {string} [connectionEnvelope.kind] Kind of resource. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will create or update a hybrid connection for the + * production slot. + * + * @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. + */ + updateRelayServiceConnectionSlotWithHttpOperationResponse(resourceGroupName, name, entityName, connectionEnvelope, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._updateRelayServiceConnectionSlot(resourceGroupName, name, entityName, connectionEnvelope, slot, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Creates a new hybrid connection configuration (PUT), or updates an + * existing one (PATCH). + * + * Creates a new hybrid connection configuration (PUT), or updates an existing + * one (PATCH). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} entityName Name of the hybrid connection configuration. + * + * @param {object} connectionEnvelope Details of the hybrid connection + * configuration. + * + * @param {string} [connectionEnvelope.entityName] + * + * @param {string} [connectionEnvelope.entityConnectionString] + * + * @param {string} [connectionEnvelope.resourceType] + * + * @param {string} [connectionEnvelope.resourceConnectionString] + * + * @param {string} [connectionEnvelope.hostname] + * + * @param {number} [connectionEnvelope.port] + * + * @param {string} [connectionEnvelope.biztalkUri] + * + * @param {string} [connectionEnvelope.kind] Kind of resource. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will create or update a hybrid connection for the + * production slot. + * + * @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 {RelayServiceConnectionEntity} - 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 RelayServiceConnectionEntity} 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. + */ + updateRelayServiceConnectionSlot(resourceGroupName, name, entityName, connectionEnvelope, slot, 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._updateRelayServiceConnectionSlot(resourceGroupName, name, entityName, connectionEnvelope, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._updateRelayServiceConnectionSlot(resourceGroupName, name, entityName, connectionEnvelope, slot, options, optionalCallback); + } + } + + /** + * @summary Gets all scale-out instances of an app. + * + * Gets all scale-out instances of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API gets the production slot instances. + * + * @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. + */ + listInstanceIdentifiersSlotWithHttpOperationResponse(resourceGroupName, name, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listInstanceIdentifiersSlot(resourceGroupName, name, slot, 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 all scale-out instances of an app. + * + * Gets all scale-out instances of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API gets the production slot instances. + * + * @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 {WebAppInstanceCollection} - 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 WebAppInstanceCollection} 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. + */ + listInstanceIdentifiersSlot(resourceGroupName, name, slot, 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._listInstanceIdentifiersSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listInstanceIdentifiersSlot(resourceGroupName, name, slot, options, optionalCallback); + } + } + + /** + * @summary Get the status of the last MSDeploy operation. + * + * Get the status of the last MSDeploy operation. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {string} slot Name of web app slot. If not specified then will + * default to production slot. + * + * @param {string} instanceId ID of web app instance. + * + * @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. + */ + getInstanceMsDeployStatusSlotWithHttpOperationResponse(resourceGroupName, name, slot, instanceId, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._getInstanceMsDeployStatusSlot(resourceGroupName, name, slot, instanceId, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Get the status of the last MSDeploy operation. + * + * Get the status of the last MSDeploy operation. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {string} slot Name of web app slot. If not specified then will + * default to production slot. + * + * @param {string} instanceId ID of web app instance. + * + * @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 {MSDeployStatus} - 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 MSDeployStatus} 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. + */ + getInstanceMsDeployStatusSlot(resourceGroupName, name, slot, instanceId, 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._getInstanceMsDeployStatusSlot(resourceGroupName, name, slot, instanceId, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getInstanceMsDeployStatusSlot(resourceGroupName, name, slot, instanceId, options, optionalCallback); + } + } + + /** + * @summary Invoke the MSDeploy web app extension. + * + * Invoke the MSDeploy web app extension. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {string} slot Name of web app slot. If not specified then will + * default to production slot. + * + * @param {string} instanceId ID of web app instance. + * + * @param {object} mSDeploy Details of MSDeploy operation + * + * @param {string} [mSDeploy.packageUri] Package URI + * + * @param {string} [mSDeploy.connectionString] SQL Connection String + * + * @param {string} [mSDeploy.dbType] Database Type + * + * @param {string} [mSDeploy.setParametersXmlFileUri] URI of MSDeploy + * Parameters file. Must not be set if SetParameters is used. + * + * @param {object} [mSDeploy.setParameters] MSDeploy Parameters. Must not be + * set if SetParametersXmlFileUri is used. + * + * @param {boolean} [mSDeploy.skipAppData] Controls whether the MSDeploy + * operation skips the App_Data directory. + * If set to true, the existing App_Data directory on the + * destination + * will not be deleted, and any App_Data directory in the source will be + * ignored. + * Setting is false by default. + * + * @param {boolean} [mSDeploy.appOffline] Sets the AppOffline rule while the + * MSDeploy operation executes. + * Setting is false by default. + * + * @param {string} [mSDeploy.kind] Kind of resource. + * + * @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. + */ + createInstanceMSDeployOperationSlotWithHttpOperationResponse(resourceGroupName, name, slot, instanceId, mSDeploy, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._createInstanceMSDeployOperationSlot(resourceGroupName, name, slot, instanceId, mSDeploy, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Invoke the MSDeploy web app extension. + * + * Invoke the MSDeploy web app extension. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {string} slot Name of web app slot. If not specified then will + * default to production slot. + * + * @param {string} instanceId ID of web app instance. + * + * @param {object} mSDeploy Details of MSDeploy operation + * + * @param {string} [mSDeploy.packageUri] Package URI + * + * @param {string} [mSDeploy.connectionString] SQL Connection String + * + * @param {string} [mSDeploy.dbType] Database Type + * + * @param {string} [mSDeploy.setParametersXmlFileUri] URI of MSDeploy + * Parameters file. Must not be set if SetParameters is used. + * + * @param {object} [mSDeploy.setParameters] MSDeploy Parameters. Must not be + * set if SetParametersXmlFileUri is used. + * + * @param {boolean} [mSDeploy.skipAppData] Controls whether the MSDeploy + * operation skips the App_Data directory. + * If set to true, the existing App_Data directory on the + * destination + * will not be deleted, and any App_Data directory in the source will be + * ignored. + * Setting is false by default. + * + * @param {boolean} [mSDeploy.appOffline] Sets the AppOffline rule while the + * MSDeploy operation executes. + * Setting is false by default. + * + * @param {string} [mSDeploy.kind] Kind of resource. + * + * @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 {MSDeployStatus} - 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 MSDeployStatus} 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. + */ + createInstanceMSDeployOperationSlot(resourceGroupName, name, slot, instanceId, mSDeploy, 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._createInstanceMSDeployOperationSlot(resourceGroupName, name, slot, instanceId, mSDeploy, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._createInstanceMSDeployOperationSlot(resourceGroupName, name, slot, instanceId, mSDeploy, options, optionalCallback); + } + } + + /** + * @summary Get the MSDeploy Log for the last MSDeploy operation. + * + * Get the MSDeploy Log for the last MSDeploy operation. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {string} slot Name of web app slot. If not specified then will + * default to production slot. + * + * @param {string} instanceId ID of web app instance. + * + * @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. + */ + getInstanceMSDeployLogSlotWithHttpOperationResponse(resourceGroupName, name, slot, instanceId, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._getInstanceMSDeployLogSlot(resourceGroupName, name, slot, instanceId, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Get the MSDeploy Log for the last MSDeploy operation. + * + * Get the MSDeploy Log for the last MSDeploy operation. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {string} slot Name of web app slot. If not specified then will + * default to production slot. + * + * @param {string} instanceId ID of web app instance. + * + * @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 {MSDeployLog} - 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 MSDeployLog} 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. + */ + getInstanceMSDeployLogSlot(resourceGroupName, name, slot, instanceId, 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._getInstanceMSDeployLogSlot(resourceGroupName, name, slot, instanceId, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getInstanceMSDeployLogSlot(resourceGroupName, name, slot, instanceId, options, optionalCallback); + } + } + + /** + * @summary Get list of processes for a web site, or a deployment slot, or for + * a specific scaled-out instance in a web site. + * + * Get list of processes for a web site, or a deployment slot, or for a + * specific scaled-out instance in a web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API returns deployments for the production slot. + * + * @param {string} instanceId ID of a specific scaled-out instance. This is the + * value of the name property in the JSON response from "GET + * api/sites/{siteName}/instances". + * + * @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. + */ + listInstanceProcessesSlotWithHttpOperationResponse(resourceGroupName, name, slot, instanceId, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listInstanceProcessesSlot(resourceGroupName, name, slot, instanceId, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Get list of processes for a web site, or a deployment slot, or for + * a specific scaled-out instance in a web site. + * + * Get list of processes for a web site, or a deployment slot, or for a + * specific scaled-out instance in a web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API returns deployments for the production slot. + * + * @param {string} instanceId ID of a specific scaled-out instance. This is the + * value of the name property in the JSON response from "GET + * api/sites/{siteName}/instances". + * + * @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 {ProcessInfoCollection} - 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 ProcessInfoCollection} 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. + */ + listInstanceProcessesSlot(resourceGroupName, name, slot, instanceId, 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._listInstanceProcessesSlot(resourceGroupName, name, slot, instanceId, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listInstanceProcessesSlot(resourceGroupName, name, slot, instanceId, options, optionalCallback); + } + } + + /** + * @summary Get process information by its ID for a specific scaled-out + * instance in a web site. + * + * Get process information by its ID for a specific scaled-out instance in a + * web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API returns deployments for the production slot. + * + * @param {string} instanceId ID of a specific scaled-out instance. This is the + * value of the name property in the JSON response from "GET + * api/sites/{siteName}/instances". + * + * @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. + */ + getInstanceProcessSlotWithHttpOperationResponse(resourceGroupName, name, processId, slot, instanceId, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._getInstanceProcessSlot(resourceGroupName, name, processId, slot, instanceId, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Get process information by its ID for a specific scaled-out + * instance in a web site. + * + * Get process information by its ID for a specific scaled-out instance in a + * web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API returns deployments for the production slot. + * + * @param {string} instanceId ID of a specific scaled-out instance. This is the + * value of the name property in the JSON response from "GET + * api/sites/{siteName}/instances". + * + * @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 {ProcessInfo} - 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 ProcessInfo} 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. + */ + getInstanceProcessSlot(resourceGroupName, name, processId, slot, instanceId, 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._getInstanceProcessSlot(resourceGroupName, name, processId, slot, instanceId, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getInstanceProcessSlot(resourceGroupName, name, processId, slot, instanceId, options, optionalCallback); + } + } + + /** + * @summary Terminate a process by its ID for a web site, or a deployment slot, + * or specific scaled-out instance in a web site. + * + * Terminate a process by its ID for a web site, or a deployment slot, or + * specific scaled-out instance in a web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API returns deployments for the production slot. + * + * @param {string} instanceId ID of a specific scaled-out instance. This is the + * value of the name property in the JSON response from "GET + * api/sites/{siteName}/instances". + * + * @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. + */ + deleteInstanceProcessSlotWithHttpOperationResponse(resourceGroupName, name, processId, slot, instanceId, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._deleteInstanceProcessSlot(resourceGroupName, name, processId, slot, instanceId, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Terminate a process by its ID for a web site, or a deployment slot, + * or specific scaled-out instance in a web site. + * + * Terminate a process by its ID for a web site, or a deployment slot, or + * specific scaled-out instance in a web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API returns deployments for the production slot. + * + * @param {string} instanceId ID of a specific scaled-out instance. This is the + * value of the name property in the JSON response from "GET + * api/sites/{siteName}/instances". + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + deleteInstanceProcessSlot(resourceGroupName, name, processId, slot, instanceId, 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._deleteInstanceProcessSlot(resourceGroupName, name, processId, slot, instanceId, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._deleteInstanceProcessSlot(resourceGroupName, name, processId, slot, instanceId, options, optionalCallback); + } + } + + /** + * @summary Get a memory dump of a process by its ID for a specific scaled-out + * instance in a web site. + * + * Get a memory dump of a process by its ID for a specific scaled-out instance + * in a web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API returns deployments for the production slot. + * + * @param {string} instanceId ID of a specific scaled-out instance. This is the + * value of the name property in the JSON response from "GET + * api/sites/{siteName}/instances". + * + * @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. + */ + getInstanceProcessDumpSlotWithHttpOperationResponse(resourceGroupName, name, processId, slot, instanceId, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._getInstanceProcessDumpSlot(resourceGroupName, name, processId, slot, instanceId, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Get a memory dump of a process by its ID for a specific scaled-out + * instance in a web site. + * + * Get a memory dump of a process by its ID for a specific scaled-out instance + * in a web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API returns deployments for the production slot. + * + * @param {string} instanceId ID of a specific scaled-out instance. This is the + * value of the name property in the JSON response from "GET + * api/sites/{siteName}/instances". + * + * @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 {Object} - 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. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + getInstanceProcessDumpSlot(resourceGroupName, name, processId, slot, instanceId, 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._getInstanceProcessDumpSlot(resourceGroupName, name, processId, slot, instanceId, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getInstanceProcessDumpSlot(resourceGroupName, name, processId, slot, instanceId, options, optionalCallback); + } + } + + /** + * @summary List module information for a process by its ID for a specific + * scaled-out instance in a web site. + * + * List module information for a process by its ID for a specific scaled-out + * instance in a web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API returns deployments for the production slot. + * + * @param {string} instanceId ID of a specific scaled-out instance. This is the + * value of the name property in the JSON response from "GET + * api/sites/{siteName}/instances". + * + * @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. + */ + listInstanceProcessModulesSlotWithHttpOperationResponse(resourceGroupName, name, processId, slot, instanceId, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listInstanceProcessModulesSlot(resourceGroupName, name, processId, slot, instanceId, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary List module information for a process by its ID for a specific + * scaled-out instance in a web site. + * + * List module information for a process by its ID for a specific scaled-out + * instance in a web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API returns deployments for the production slot. + * + * @param {string} instanceId ID of a specific scaled-out instance. This is the + * value of the name property in the JSON response from "GET + * api/sites/{siteName}/instances". + * + * @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 {ProcessModuleInfoCollection} - 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 ProcessModuleInfoCollection} 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. + */ + listInstanceProcessModulesSlot(resourceGroupName, name, processId, slot, instanceId, 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._listInstanceProcessModulesSlot(resourceGroupName, name, processId, slot, instanceId, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listInstanceProcessModulesSlot(resourceGroupName, name, processId, slot, instanceId, options, optionalCallback); + } + } + + /** + * @summary Get process information by its ID for a specific scaled-out + * instance in a web site. + * + * Get process information by its ID for a specific scaled-out instance in a + * web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @param {string} baseAddress Module base address. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API returns deployments for the production slot. + * + * @param {string} instanceId ID of a specific scaled-out instance. This is the + * value of the name property in the JSON response from "GET + * api/sites/{siteName}/instances". + * + * @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. + */ + getInstanceProcessModuleSlotWithHttpOperationResponse(resourceGroupName, name, processId, baseAddress, slot, instanceId, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._getInstanceProcessModuleSlot(resourceGroupName, name, processId, baseAddress, slot, instanceId, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Get process information by its ID for a specific scaled-out + * instance in a web site. + * + * Get process information by its ID for a specific scaled-out instance in a + * web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @param {string} baseAddress Module base address. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API returns deployments for the production slot. + * + * @param {string} instanceId ID of a specific scaled-out instance. This is the + * value of the name property in the JSON response from "GET + * api/sites/{siteName}/instances". + * + * @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 {ProcessModuleInfo} - 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 ProcessModuleInfo} 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. + */ + getInstanceProcessModuleSlot(resourceGroupName, name, processId, baseAddress, slot, instanceId, 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._getInstanceProcessModuleSlot(resourceGroupName, name, processId, baseAddress, slot, instanceId, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getInstanceProcessModuleSlot(resourceGroupName, name, processId, baseAddress, slot, instanceId, options, optionalCallback); + } + } + + /** + * @summary List the threads in a process by its ID for a specific scaled-out + * instance in a web site. + * + * List the threads in a process by its ID for a specific scaled-out instance + * in a web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API returns deployments for the production slot. + * + * @param {string} instanceId ID of a specific scaled-out instance. This is the + * value of the name property in the JSON response from "GET + * api/sites/{siteName}/instances". + * + * @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. + */ + listInstanceProcessThreadsSlotWithHttpOperationResponse(resourceGroupName, name, processId, slot, instanceId, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listInstanceProcessThreadsSlot(resourceGroupName, name, processId, slot, instanceId, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary List the threads in a process by its ID for a specific scaled-out + * instance in a web site. + * + * List the threads in a process by its ID for a specific scaled-out instance + * in a web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API returns deployments for the production slot. + * + * @param {string} instanceId ID of a specific scaled-out instance. This is the + * value of the name property in the JSON response from "GET + * api/sites/{siteName}/instances". + * + * @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 {ProcessThreadInfoCollection} - 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 ProcessThreadInfoCollection} 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. + */ + listInstanceProcessThreadsSlot(resourceGroupName, name, processId, slot, instanceId, 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._listInstanceProcessThreadsSlot(resourceGroupName, name, processId, slot, instanceId, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listInstanceProcessThreadsSlot(resourceGroupName, name, processId, slot, instanceId, options, optionalCallback); + } + } + + /** + * @summary Get thread information by Thread ID for a specific process, in a + * specific scaled-out instance in a web site. + * + * Get thread information by Thread ID for a specific process, in a specific + * scaled-out instance in a web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @param {string} threadId TID. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API returns deployments for the production slot. + * + * @param {string} instanceId ID of a specific scaled-out instance. This is the + * value of the name property in the JSON response from "GET + * api/sites/{siteName}/instances". + * + * @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. + */ + getInstanceProcessThreadSlotWithHttpOperationResponse(resourceGroupName, name, processId, threadId, slot, instanceId, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._getInstanceProcessThreadSlot(resourceGroupName, name, processId, threadId, slot, instanceId, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Get thread information by Thread ID for a specific process, in a + * specific scaled-out instance in a web site. + * + * Get thread information by Thread ID for a specific process, in a specific + * scaled-out instance in a web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @param {string} threadId TID. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API returns deployments for the production slot. + * + * @param {string} instanceId ID of a specific scaled-out instance. This is the + * value of the name property in the JSON response from "GET + * api/sites/{siteName}/instances". + * + * @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 {ProcessThreadInfo} - 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 ProcessThreadInfo} 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. + */ + getInstanceProcessThreadSlot(resourceGroupName, name, processId, threadId, slot, instanceId, 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._getInstanceProcessThreadSlot(resourceGroupName, name, processId, threadId, slot, instanceId, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getInstanceProcessThreadSlot(resourceGroupName, name, processId, threadId, slot, instanceId, options, optionalCallback); + } + } + + /** + * @summary Shows whether an app can be cloned to another resource group or + * subscription. + * + * Shows whether an app can be cloned to another resource group or + * subscription. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. By default, this API + * returns information on the production slot. + * + * @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. + */ + isCloneableSlotWithHttpOperationResponse(resourceGroupName, name, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._isCloneableSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Shows whether an app can be cloned to another resource group or + * subscription. + * + * Shows whether an app can be cloned to another resource group or + * subscription. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. By default, this API + * returns information on the production slot. + * + * @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 {SiteCloneability} - 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 SiteCloneability} 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. + */ + isCloneableSlot(resourceGroupName, name, slot, 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._isCloneableSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._isCloneableSlot(resourceGroupName, name, slot, options, optionalCallback); + } + } + + /** + * @summary This is to allow calling via powershell and ARM template. + * + * This is to allow calling via powershell and ARM template. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will restore a backup of the production slot. + * + * @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. + */ + listSyncFunctionTriggersSlotWithHttpOperationResponse(resourceGroupName, name, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listSyncFunctionTriggersSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary This is to allow calling via powershell and ARM template. + * + * This is to allow calling via powershell and ARM template. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will restore a backup of the production slot. + * + * @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 {FunctionSecrets} - 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 FunctionSecrets} 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. + */ + listSyncFunctionTriggersSlot(resourceGroupName, name, slot, 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._listSyncFunctionTriggersSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listSyncFunctionTriggersSlot(resourceGroupName, name, slot, options, optionalCallback); + } + } + + /** + * @summary Gets all metric definitions of an app (or deployment slot, if + * specified). + * + * Gets all metric definitions of an app (or deployment slot, if specified). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will get metric definitions of the production slot. + * + * @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. + */ + listMetricDefinitionsSlotWithHttpOperationResponse(resourceGroupName, name, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listMetricDefinitionsSlot(resourceGroupName, name, slot, 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 all metric definitions of an app (or deployment slot, if + * specified). + * + * Gets all metric definitions of an app (or deployment slot, if specified). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will get metric definitions of the production slot. + * + * @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 {ResourceMetricDefinitionCollection} - 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 ResourceMetricDefinitionCollection} 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. + */ + listMetricDefinitionsSlot(resourceGroupName, name, slot, 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._listMetricDefinitionsSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listMetricDefinitionsSlot(resourceGroupName, name, slot, options, optionalCallback); + } + } + + /** + * @summary Gets performance metrics of an app (or deployment slot, if + * specified). + * + * Gets performance metrics of an app (or deployment slot, if specified). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will get metrics of the production slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {boolean} [options.details] Specify "true" to include metric details + * in the response. It is "false" by default. + * + * @param {string} [options.filter] Return only metrics specified in the filter + * (using OData syntax). For example: $filter=(name.value eq 'Metric1' or + * name.value eq 'Metric2') and startTime eq 2014-01-01T00:00:00Z and endTime + * eq 2014-12-31T23:59:59Z and timeGrain eq duration'[Hour|Minute|Day]'. + * + * @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. + */ + listMetricsSlotWithHttpOperationResponse(resourceGroupName, name, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listMetricsSlot(resourceGroupName, name, slot, 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 performance metrics of an app (or deployment slot, if + * specified). + * + * Gets performance metrics of an app (or deployment slot, if specified). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will get metrics of the production slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {boolean} [options.details] Specify "true" to include metric details + * in the response. It is "false" by default. + * + * @param {string} [options.filter] Return only metrics specified in the filter + * (using OData syntax). For example: $filter=(name.value eq 'Metric1' or + * name.value eq 'Metric2') and startTime eq 2014-01-01T00:00:00Z and endTime + * eq 2014-12-31T23:59:59Z and timeGrain eq duration'[Hour|Minute|Day]'. + * + * @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 {ResourceMetricCollection} - 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 ResourceMetricCollection} 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. + */ + listMetricsSlot(resourceGroupName, name, slot, 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._listMetricsSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listMetricsSlot(resourceGroupName, name, slot, options, optionalCallback); + } + } + + /** + * @summary Returns the status of MySql in app migration, if one is active, and + * whether or not MySql in app is enabled + * + * Returns the status of MySql in app migration, if one is active, and whether + * or not MySql in app is enabled + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {string} slot Name of the deployment slot. + * + * @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. + */ + getMigrateMySqlStatusSlotWithHttpOperationResponse(resourceGroupName, name, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._getMigrateMySqlStatusSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Returns the status of MySql in app migration, if one is active, and + * whether or not MySql in app is enabled + * + * Returns the status of MySql in app migration, if one is active, and whether + * or not MySql in app is enabled + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {string} slot Name of the deployment slot. + * + * @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 {MigrateMySqlStatus} - 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 MigrateMySqlStatus} 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. + */ + getMigrateMySqlStatusSlot(resourceGroupName, name, slot, 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._getMigrateMySqlStatusSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getMigrateMySqlStatusSlot(resourceGroupName, name, slot, options, optionalCallback); + } + } + + /** + * @summary Gets all network features used by the app (or deployment slot, if + * specified). + * + * Gets all network features used by the app (or deployment slot, if + * specified). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} view The type of view. This can either be "summary" or + * "detailed". + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will get network features for the production slot. + * + * @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. + */ + listNetworkFeaturesSlotWithHttpOperationResponse(resourceGroupName, name, view, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listNetworkFeaturesSlot(resourceGroupName, name, view, slot, 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 all network features used by the app (or deployment slot, if + * specified). + * + * Gets all network features used by the app (or deployment slot, if + * specified). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} view The type of view. This can either be "summary" or + * "detailed". + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will get network features for the production slot. + * + * @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 {NetworkFeatures} - 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 NetworkFeatures} 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. + */ + listNetworkFeaturesSlot(resourceGroupName, name, view, slot, 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._listNetworkFeaturesSlot(resourceGroupName, name, view, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listNetworkFeaturesSlot(resourceGroupName, name, view, slot, options, optionalCallback); + } + } + + /** + * @summary Start capturing network packets for the site. + * + * Start capturing network packets for the site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @param {string} slot The name of the slot for this web app. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.durationInSeconds] The duration to keep capturing + * in seconds. + * + * @param {number} [options.maxFrameLength] The maximum frame length in bytes + * (Optional). + * + * @param {string} [options.sasUrl] The Blob URL to store capture file. + * + * @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. + */ + startWebSiteNetworkTraceSlotWithHttpOperationResponse(resourceGroupName, name, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._startWebSiteNetworkTraceSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Start capturing network packets for the site. + * + * Start capturing network packets for the site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @param {string} slot The name of the slot for this web app. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.durationInSeconds] The duration to keep capturing + * in seconds. + * + * @param {number} [options.maxFrameLength] The maximum frame length in bytes + * (Optional). + * + * @param {string} [options.sasUrl] The Blob URL to store capture file. + * + * @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 {String} - 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. + * + * {string} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + startWebSiteNetworkTraceSlot(resourceGroupName, name, slot, 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._startWebSiteNetworkTraceSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._startWebSiteNetworkTraceSlot(resourceGroupName, name, slot, options, optionalCallback); + } + } + + /** + * @summary Stop ongoing capturing network packets for the site. + * + * Stop ongoing capturing network packets for the site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @param {string} slot The name of the slot for this web app. + * + * @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. + */ + stopWebSiteNetworkTraceSlotWithHttpOperationResponse(resourceGroupName, name, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._stopWebSiteNetworkTraceSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Stop ongoing capturing network packets for the site. + * + * Stop ongoing capturing network packets for the site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @param {string} slot The name of the slot for this web app. + * + * @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 {String} - 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. + * + * {string} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + stopWebSiteNetworkTraceSlot(resourceGroupName, name, slot, 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._stopWebSiteNetworkTraceSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._stopWebSiteNetworkTraceSlot(resourceGroupName, name, slot, options, optionalCallback); + } + } + + /** + * @summary Generates a new publishing password for an app (or deployment slot, + * if specified). + * + * Generates a new publishing password for an app (or deployment slot, if + * specified). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API generate a new publishing password for the production + * slot. + * + * @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. + */ + generateNewSitePublishingPasswordSlotWithHttpOperationResponse(resourceGroupName, name, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._generateNewSitePublishingPasswordSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Generates a new publishing password for an app (or deployment slot, + * if specified). + * + * Generates a new publishing password for an app (or deployment slot, if + * specified). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API generate a new publishing password for the production + * slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + generateNewSitePublishingPasswordSlot(resourceGroupName, name, slot, 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._generateNewSitePublishingPasswordSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._generateNewSitePublishingPasswordSlot(resourceGroupName, name, slot, options, optionalCallback); + } + } + + /** + * @summary Gets perfmon counters for web app. + * + * Gets perfmon counters for web app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {string} slot Name of web app slot. If not specified then will + * default to production slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.filter] Return only usages/metrics specified in the + * filter. Filter conforms to odata syntax. Example: $filter=(startTime eq + * 2014-01-01T00:00:00Z and endTime eq 2014-12-31T23:59:59Z and timeGrain eq + * duration'[Hour|Minute|Day]'. + * + * @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. + */ + listPerfMonCountersSlotWithHttpOperationResponse(resourceGroupName, name, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listPerfMonCountersSlot(resourceGroupName, name, slot, 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 perfmon counters for web app. + * + * Gets perfmon counters for web app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {string} slot Name of web app slot. If not specified then will + * default to production slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.filter] Return only usages/metrics specified in the + * filter. Filter conforms to odata syntax. Example: $filter=(startTime eq + * 2014-01-01T00:00:00Z and endTime eq 2014-12-31T23:59:59Z and timeGrain eq + * duration'[Hour|Minute|Day]'. + * + * @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 {PerfMonCounterCollection} - 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 PerfMonCounterCollection} 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. + */ + listPerfMonCountersSlot(resourceGroupName, name, slot, 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._listPerfMonCountersSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listPerfMonCountersSlot(resourceGroupName, name, slot, options, optionalCallback); + } + } + + /** + * @summary Gets web app's event logs. + * + * Gets web app's event logs. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {string} slot Name of web app slot. If not specified then will + * default to production slot. + * + * @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. + */ + getSitePhpErrorLogFlagSlotWithHttpOperationResponse(resourceGroupName, name, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._getSitePhpErrorLogFlagSlot(resourceGroupName, name, slot, 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 web app's event logs. + * + * Gets web app's event logs. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {string} slot Name of web app slot. If not specified then will + * default to production slot. + * + * @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 {SitePhpErrorLogFlag} - 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 SitePhpErrorLogFlag} 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. + */ + getSitePhpErrorLogFlagSlot(resourceGroupName, name, slot, 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._getSitePhpErrorLogFlagSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getSitePhpErrorLogFlagSlot(resourceGroupName, name, slot, options, optionalCallback); + } + } + + /** + * @summary Gets the premier add-ons of an app. + * + * Gets the premier add-ons of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will get the premier add-ons for the production slot. + * + * @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. + */ + listPremierAddOnsSlotWithHttpOperationResponse(resourceGroupName, name, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listPremierAddOnsSlot(resourceGroupName, name, slot, 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 the premier add-ons of an app. + * + * Gets the premier add-ons of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will get the premier add-ons for the production slot. + * + * @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 {PremierAddOn} - 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 PremierAddOn} 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. + */ + listPremierAddOnsSlot(resourceGroupName, name, slot, 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._listPremierAddOnsSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listPremierAddOnsSlot(resourceGroupName, name, slot, options, optionalCallback); + } + } + + /** + * @summary Gets a named add-on of an app. + * + * Gets a named add-on of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} premierAddOnName Add-on name. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will get the named add-on for the production slot. + * + * @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. + */ + getPremierAddOnSlotWithHttpOperationResponse(resourceGroupName, name, premierAddOnName, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._getPremierAddOnSlot(resourceGroupName, name, premierAddOnName, slot, 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 named add-on of an app. + * + * Gets a named add-on of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} premierAddOnName Add-on name. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will get the named add-on for the production slot. + * + * @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 {PremierAddOn} - 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 PremierAddOn} 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. + */ + getPremierAddOnSlot(resourceGroupName, name, premierAddOnName, slot, 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._getPremierAddOnSlot(resourceGroupName, name, premierAddOnName, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getPremierAddOnSlot(resourceGroupName, name, premierAddOnName, slot, options, optionalCallback); + } + } + + /** + * @summary Updates a named add-on of an app. + * + * Updates a named add-on of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} premierAddOnName Add-on name. + * + * @param {object} premierAddOn A JSON representation of the edited premier + * add-on. + * + * @param {string} [premierAddOn.sku] Premier add on SKU. + * + * @param {string} [premierAddOn.product] Premier add on Product. + * + * @param {string} [premierAddOn.vendor] Premier add on Vendor. + * + * @param {string} [premierAddOn.marketplacePublisher] Premier add on + * Marketplace publisher. + * + * @param {string} [premierAddOn.marketplaceOffer] Premier add on Marketplace + * offer. + * + * @param {string} [premierAddOn.kind] Kind of resource. + * + * @param {string} premierAddOn.location Resource Location. + * + * @param {object} [premierAddOn.tags] Resource tags. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will update the named add-on for the production slot. + * + * @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. + */ + addPremierAddOnSlotWithHttpOperationResponse(resourceGroupName, name, premierAddOnName, premierAddOn, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._addPremierAddOnSlot(resourceGroupName, name, premierAddOnName, premierAddOn, slot, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Updates a named add-on of an app. + * + * Updates a named add-on of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} premierAddOnName Add-on name. + * + * @param {object} premierAddOn A JSON representation of the edited premier + * add-on. + * + * @param {string} [premierAddOn.sku] Premier add on SKU. + * + * @param {string} [premierAddOn.product] Premier add on Product. + * + * @param {string} [premierAddOn.vendor] Premier add on Vendor. + * + * @param {string} [premierAddOn.marketplacePublisher] Premier add on + * Marketplace publisher. + * + * @param {string} [premierAddOn.marketplaceOffer] Premier add on Marketplace + * offer. + * + * @param {string} [premierAddOn.kind] Kind of resource. + * + * @param {string} premierAddOn.location Resource Location. + * + * @param {object} [premierAddOn.tags] Resource tags. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will update the named add-on for the production slot. + * + * @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 {PremierAddOn} - 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 PremierAddOn} 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. + */ + addPremierAddOnSlot(resourceGroupName, name, premierAddOnName, premierAddOn, slot, 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._addPremierAddOnSlot(resourceGroupName, name, premierAddOnName, premierAddOn, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._addPremierAddOnSlot(resourceGroupName, name, premierAddOnName, premierAddOn, slot, options, optionalCallback); + } + } + + /** + * @summary Delete a premier add-on from an app. + * + * Delete a premier add-on from an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} premierAddOnName Add-on name. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will delete the named add-on for the production slot. + * + * @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. + */ + deletePremierAddOnSlotWithHttpOperationResponse(resourceGroupName, name, premierAddOnName, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._deletePremierAddOnSlot(resourceGroupName, name, premierAddOnName, slot, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Delete a premier add-on from an app. + * + * Delete a premier add-on from an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} premierAddOnName Add-on name. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will delete the named add-on for the production slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + deletePremierAddOnSlot(resourceGroupName, name, premierAddOnName, slot, 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._deletePremierAddOnSlot(resourceGroupName, name, premierAddOnName, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._deletePremierAddOnSlot(resourceGroupName, name, premierAddOnName, slot, options, optionalCallback); + } + } + + /** + * @summary Updates a named add-on of an app. + * + * Updates a named add-on of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} premierAddOnName Add-on name. + * + * @param {object} premierAddOn A JSON representation of the edited premier + * add-on. + * + * @param {string} [premierAddOn.sku] Premier add on SKU. + * + * @param {string} [premierAddOn.product] Premier add on Product. + * + * @param {string} [premierAddOn.vendor] Premier add on Vendor. + * + * @param {string} [premierAddOn.marketplacePublisher] Premier add on + * Marketplace publisher. + * + * @param {string} [premierAddOn.marketplaceOffer] Premier add on Marketplace + * offer. + * + * @param {string} [premierAddOn.kind] Kind of resource. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will update the named add-on for the production slot. + * + * @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. + */ + updatePremierAddOnSlotWithHttpOperationResponse(resourceGroupName, name, premierAddOnName, premierAddOn, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._updatePremierAddOnSlot(resourceGroupName, name, premierAddOnName, premierAddOn, slot, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Updates a named add-on of an app. + * + * Updates a named add-on of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} premierAddOnName Add-on name. + * + * @param {object} premierAddOn A JSON representation of the edited premier + * add-on. + * + * @param {string} [premierAddOn.sku] Premier add on SKU. + * + * @param {string} [premierAddOn.product] Premier add on Product. + * + * @param {string} [premierAddOn.vendor] Premier add on Vendor. + * + * @param {string} [premierAddOn.marketplacePublisher] Premier add on + * Marketplace publisher. + * + * @param {string} [premierAddOn.marketplaceOffer] Premier add on Marketplace + * offer. + * + * @param {string} [premierAddOn.kind] Kind of resource. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will update the named add-on for the production slot. + * + * @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 {PremierAddOn} - 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 PremierAddOn} 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. + */ + updatePremierAddOnSlot(resourceGroupName, name, premierAddOnName, premierAddOn, slot, 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._updatePremierAddOnSlot(resourceGroupName, name, premierAddOnName, premierAddOn, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._updatePremierAddOnSlot(resourceGroupName, name, premierAddOnName, premierAddOn, slot, options, optionalCallback); + } + } + + /** + * @summary Gets data around private site access enablement and authorized + * Virtual Networks that can access the site. + * + * Gets data around private site access enablement and authorized Virtual + * Networks that can access the site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @param {string} slot The name of the slot for the web app. + * + * @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. + */ + getPrivateAccessSlotWithHttpOperationResponse(resourceGroupName, name, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._getPrivateAccessSlot(resourceGroupName, name, slot, 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 data around private site access enablement and authorized + * Virtual Networks that can access the site. + * + * Gets data around private site access enablement and authorized Virtual + * Networks that can access the site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @param {string} slot The name of the slot for the web app. + * + * @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 {PrivateAccess} - 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 PrivateAccess} 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. + */ + getPrivateAccessSlot(resourceGroupName, name, slot, 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._getPrivateAccessSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getPrivateAccessSlot(resourceGroupName, name, slot, options, optionalCallback); + } + } + + /** + * @summary Sets data around private site access enablement and authorized + * Virtual Networks that can access the site. + * + * Sets data around private site access enablement and authorized Virtual + * Networks that can access the site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @param {object} access The information for the private access + * + * @param {boolean} [access.enabled] Whether private access is enabled or not. + * + * @param {array} [access.virtualNetworks] The Virtual Networks (and subnets) + * allowed to access the site privately. + * + * @param {string} [access.kind] Kind of resource. + * + * @param {string} slot The name of the slot for the web app. + * + * @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. + */ + putPrivateAccessVnetSlotWithHttpOperationResponse(resourceGroupName, name, access, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._putPrivateAccessVnetSlot(resourceGroupName, name, access, slot, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Sets data around private site access enablement and authorized + * Virtual Networks that can access the site. + * + * Sets data around private site access enablement and authorized Virtual + * Networks that can access the site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @param {object} access The information for the private access + * + * @param {boolean} [access.enabled] Whether private access is enabled or not. + * + * @param {array} [access.virtualNetworks] The Virtual Networks (and subnets) + * allowed to access the site privately. + * + * @param {string} [access.kind] Kind of resource. + * + * @param {string} slot The name of the slot for the web app. + * + * @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 {PrivateAccess} - 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 PrivateAccess} 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. + */ + putPrivateAccessVnetSlot(resourceGroupName, name, access, slot, 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._putPrivateAccessVnetSlot(resourceGroupName, name, access, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._putPrivateAccessVnetSlot(resourceGroupName, name, access, slot, options, optionalCallback); + } + } + + /** + * @summary Get list of processes for a web site, or a deployment slot, or for + * a specific scaled-out instance in a web site. + * + * Get list of processes for a web site, or a deployment slot, or for a + * specific scaled-out instance in a web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API returns deployments for the production slot. + * + * @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. + */ + listProcessesSlotWithHttpOperationResponse(resourceGroupName, name, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listProcessesSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Get list of processes for a web site, or a deployment slot, or for + * a specific scaled-out instance in a web site. + * + * Get list of processes for a web site, or a deployment slot, or for a + * specific scaled-out instance in a web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API returns deployments for the production slot. + * + * @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 {ProcessInfoCollection} - 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 ProcessInfoCollection} 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. + */ + listProcessesSlot(resourceGroupName, name, slot, 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._listProcessesSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listProcessesSlot(resourceGroupName, name, slot, options, optionalCallback); + } + } + + /** + * @summary Get process information by its ID for a specific scaled-out + * instance in a web site. + * + * Get process information by its ID for a specific scaled-out instance in a + * web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API returns deployments for the production slot. + * + * @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. + */ + getProcessSlotWithHttpOperationResponse(resourceGroupName, name, processId, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._getProcessSlot(resourceGroupName, name, processId, slot, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Get process information by its ID for a specific scaled-out + * instance in a web site. + * + * Get process information by its ID for a specific scaled-out instance in a + * web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API returns deployments for the production slot. + * + * @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 {ProcessInfo} - 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 ProcessInfo} 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. + */ + getProcessSlot(resourceGroupName, name, processId, slot, 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._getProcessSlot(resourceGroupName, name, processId, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getProcessSlot(resourceGroupName, name, processId, slot, options, optionalCallback); + } + } + + /** + * @summary Terminate a process by its ID for a web site, or a deployment slot, + * or specific scaled-out instance in a web site. + * + * Terminate a process by its ID for a web site, or a deployment slot, or + * specific scaled-out instance in a web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API returns deployments for the production slot. + * + * @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. + */ + deleteProcessSlotWithHttpOperationResponse(resourceGroupName, name, processId, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._deleteProcessSlot(resourceGroupName, name, processId, slot, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Terminate a process by its ID for a web site, or a deployment slot, + * or specific scaled-out instance in a web site. + * + * Terminate a process by its ID for a web site, or a deployment slot, or + * specific scaled-out instance in a web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API returns deployments for the production slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + deleteProcessSlot(resourceGroupName, name, processId, slot, 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._deleteProcessSlot(resourceGroupName, name, processId, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._deleteProcessSlot(resourceGroupName, name, processId, slot, options, optionalCallback); + } + } + + /** + * @summary Get a memory dump of a process by its ID for a specific scaled-out + * instance in a web site. + * + * Get a memory dump of a process by its ID for a specific scaled-out instance + * in a web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API returns deployments for the production slot. + * + * @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. + */ + getProcessDumpSlotWithHttpOperationResponse(resourceGroupName, name, processId, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._getProcessDumpSlot(resourceGroupName, name, processId, slot, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Get a memory dump of a process by its ID for a specific scaled-out + * instance in a web site. + * + * Get a memory dump of a process by its ID for a specific scaled-out instance + * in a web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API returns deployments for the production slot. + * + * @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 {Object} - 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. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + getProcessDumpSlot(resourceGroupName, name, processId, slot, 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._getProcessDumpSlot(resourceGroupName, name, processId, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getProcessDumpSlot(resourceGroupName, name, processId, slot, options, optionalCallback); + } + } + + /** + * @summary List module information for a process by its ID for a specific + * scaled-out instance in a web site. + * + * List module information for a process by its ID for a specific scaled-out + * instance in a web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API returns deployments for the production slot. + * + * @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. + */ + listProcessModulesSlotWithHttpOperationResponse(resourceGroupName, name, processId, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listProcessModulesSlot(resourceGroupName, name, processId, slot, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary List module information for a process by its ID for a specific + * scaled-out instance in a web site. + * + * List module information for a process by its ID for a specific scaled-out + * instance in a web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API returns deployments for the production slot. + * + * @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 {ProcessModuleInfoCollection} - 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 ProcessModuleInfoCollection} 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. + */ + listProcessModulesSlot(resourceGroupName, name, processId, slot, 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._listProcessModulesSlot(resourceGroupName, name, processId, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listProcessModulesSlot(resourceGroupName, name, processId, slot, options, optionalCallback); + } + } + + /** + * @summary Get process information by its ID for a specific scaled-out + * instance in a web site. + * + * Get process information by its ID for a specific scaled-out instance in a + * web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @param {string} baseAddress Module base address. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API returns deployments for the production slot. + * + * @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. + */ + getProcessModuleSlotWithHttpOperationResponse(resourceGroupName, name, processId, baseAddress, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._getProcessModuleSlot(resourceGroupName, name, processId, baseAddress, slot, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Get process information by its ID for a specific scaled-out + * instance in a web site. + * + * Get process information by its ID for a specific scaled-out instance in a + * web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @param {string} baseAddress Module base address. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API returns deployments for the production slot. + * + * @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 {ProcessModuleInfo} - 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 ProcessModuleInfo} 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. + */ + getProcessModuleSlot(resourceGroupName, name, processId, baseAddress, slot, 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._getProcessModuleSlot(resourceGroupName, name, processId, baseAddress, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getProcessModuleSlot(resourceGroupName, name, processId, baseAddress, slot, options, optionalCallback); + } + } + + /** + * @summary List the threads in a process by its ID for a specific scaled-out + * instance in a web site. + * + * List the threads in a process by its ID for a specific scaled-out instance + * in a web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API returns deployments for the production slot. + * + * @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. + */ + listProcessThreadsSlotWithHttpOperationResponse(resourceGroupName, name, processId, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listProcessThreadsSlot(resourceGroupName, name, processId, slot, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary List the threads in a process by its ID for a specific scaled-out + * instance in a web site. + * + * List the threads in a process by its ID for a specific scaled-out instance + * in a web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API returns deployments for the production slot. + * + * @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 {ProcessThreadInfoCollection} - 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 ProcessThreadInfoCollection} 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. + */ + listProcessThreadsSlot(resourceGroupName, name, processId, slot, 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._listProcessThreadsSlot(resourceGroupName, name, processId, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listProcessThreadsSlot(resourceGroupName, name, processId, slot, options, optionalCallback); + } + } + + /** + * @summary Get thread information by Thread ID for a specific process, in a + * specific scaled-out instance in a web site. + * + * Get thread information by Thread ID for a specific process, in a specific + * scaled-out instance in a web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @param {string} threadId TID. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API returns deployments for the production slot. + * + * @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. + */ + getProcessThreadSlotWithHttpOperationResponse(resourceGroupName, name, processId, threadId, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._getProcessThreadSlot(resourceGroupName, name, processId, threadId, slot, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Get thread information by Thread ID for a specific process, in a + * specific scaled-out instance in a web site. + * + * Get thread information by Thread ID for a specific process, in a specific + * scaled-out instance in a web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @param {string} threadId TID. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API returns deployments for the production slot. + * + * @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 {ProcessThreadInfo} - 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 ProcessThreadInfo} 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. + */ + getProcessThreadSlot(resourceGroupName, name, processId, threadId, slot, 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._getProcessThreadSlot(resourceGroupName, name, processId, threadId, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getProcessThreadSlot(resourceGroupName, name, processId, threadId, slot, options, optionalCallback); + } + } + + /** + * @summary Get public certificates for an app or a deployment slot. + * + * Get public certificates for an app or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API gets hostname bindings for the production slot. + * + * @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. + */ + listPublicCertificatesSlotWithHttpOperationResponse(resourceGroupName, name, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listPublicCertificatesSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Get public certificates for an app or a deployment slot. + * + * Get public certificates for an app or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API gets hostname bindings for the production slot. + * + * @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 {PublicCertificateCollection} - 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 PublicCertificateCollection} 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. + */ + listPublicCertificatesSlot(resourceGroupName, name, slot, 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._listPublicCertificatesSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listPublicCertificatesSlot(resourceGroupName, name, slot, options, optionalCallback); + } + } + + /** + * @summary Get the named public certificate for an app (or deployment slot, if + * specified). + * + * Get the named public certificate for an app (or deployment slot, if + * specified). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API the named binding for the production slot. + * + * @param {string} publicCertificateName Public certificate name. + * + * @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. + */ + getPublicCertificateSlotWithHttpOperationResponse(resourceGroupName, name, slot, publicCertificateName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._getPublicCertificateSlot(resourceGroupName, name, slot, publicCertificateName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Get the named public certificate for an app (or deployment slot, if + * specified). + * + * Get the named public certificate for an app (or deployment slot, if + * specified). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API the named binding for the production slot. + * + * @param {string} publicCertificateName Public certificate name. + * + * @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 {PublicCertificate} - 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 PublicCertificate} 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. + */ + getPublicCertificateSlot(resourceGroupName, name, slot, publicCertificateName, 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._getPublicCertificateSlot(resourceGroupName, name, slot, publicCertificateName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getPublicCertificateSlot(resourceGroupName, name, slot, publicCertificateName, options, optionalCallback); + } + } + + /** + * @summary Creates a hostname binding for an app. + * + * Creates a hostname binding for an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} publicCertificateName Public certificate name. + * + * @param {object} publicCertificate Public certificate details. This is the + * JSON representation of a PublicCertificate object. + * + * @param {buffer} [publicCertificate.blob] Public Certificate byte array + * + * @param {string} [publicCertificate.publicCertificateLocation] Public + * Certificate Location. Possible values include: 'CurrentUserMy', + * 'LocalMachineMy', 'Unknown' + * + * @param {string} [publicCertificate.kind] Kind of resource. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will create a binding for the production slot. + * + * @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. + */ + createOrUpdatePublicCertificateSlotWithHttpOperationResponse(resourceGroupName, name, publicCertificateName, publicCertificate, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._createOrUpdatePublicCertificateSlot(resourceGroupName, name, publicCertificateName, publicCertificate, slot, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Creates a hostname binding for an app. + * + * Creates a hostname binding for an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} publicCertificateName Public certificate name. + * + * @param {object} publicCertificate Public certificate details. This is the + * JSON representation of a PublicCertificate object. + * + * @param {buffer} [publicCertificate.blob] Public Certificate byte array + * + * @param {string} [publicCertificate.publicCertificateLocation] Public + * Certificate Location. Possible values include: 'CurrentUserMy', + * 'LocalMachineMy', 'Unknown' + * + * @param {string} [publicCertificate.kind] Kind of resource. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will create a binding for the production slot. + * + * @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 {PublicCertificate} - 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 PublicCertificate} 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. + */ + createOrUpdatePublicCertificateSlot(resourceGroupName, name, publicCertificateName, publicCertificate, slot, 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._createOrUpdatePublicCertificateSlot(resourceGroupName, name, publicCertificateName, publicCertificate, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._createOrUpdatePublicCertificateSlot(resourceGroupName, name, publicCertificateName, publicCertificate, slot, options, optionalCallback); + } + } + + /** + * @summary Deletes a hostname binding for an app. + * + * Deletes a hostname binding for an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will delete the binding for the production slot. + * + * @param {string} publicCertificateName Public certificate name. + * + * @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. + */ + deletePublicCertificateSlotWithHttpOperationResponse(resourceGroupName, name, slot, publicCertificateName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._deletePublicCertificateSlot(resourceGroupName, name, slot, publicCertificateName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Deletes a hostname binding for an app. + * + * Deletes a hostname binding for an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will delete the binding for the production slot. + * + * @param {string} publicCertificateName Public certificate name. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + deletePublicCertificateSlot(resourceGroupName, name, slot, publicCertificateName, 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._deletePublicCertificateSlot(resourceGroupName, name, slot, publicCertificateName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._deletePublicCertificateSlot(resourceGroupName, name, slot, publicCertificateName, options, optionalCallback); + } + } + + /** + * @summary Gets the publishing profile for an app (or deployment slot, if + * specified). + * + * Gets the publishing profile for an app (or deployment slot, if specified). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} publishingProfileOptions Specifies publishingProfileOptions + * for publishing profile. For example, use {"format": "FileZilla3"} to get a + * FileZilla publishing profile. + * + * @param {string} [publishingProfileOptions.format] Name of the format. Valid + * values are: + * FileZilla3 + * WebDeploy -- default + * Ftp. Possible values include: 'FileZilla3', 'WebDeploy', 'Ftp' + * + * @param {boolean} [publishingProfileOptions.includeDisasterRecoveryEndpoints] + * Include the DisasterRecover endpoint if true + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will get the publishing profile for the production slot. + * + * @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. + */ + listPublishingProfileXmlWithSecretsSlotWithHttpOperationResponse(resourceGroupName, name, publishingProfileOptions, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listPublishingProfileXmlWithSecretsSlot(resourceGroupName, name, publishingProfileOptions, slot, 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 the publishing profile for an app (or deployment slot, if + * specified). + * + * Gets the publishing profile for an app (or deployment slot, if specified). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} publishingProfileOptions Specifies publishingProfileOptions + * for publishing profile. For example, use {"format": "FileZilla3"} to get a + * FileZilla publishing profile. + * + * @param {string} [publishingProfileOptions.format] Name of the format. Valid + * values are: + * FileZilla3 + * WebDeploy -- default + * Ftp. Possible values include: 'FileZilla3', 'WebDeploy', 'Ftp' + * + * @param {boolean} [publishingProfileOptions.includeDisasterRecoveryEndpoints] + * Include the DisasterRecover endpoint if true + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will get the publishing profile for the production slot. + * + * @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 {Object} - 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. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listPublishingProfileXmlWithSecretsSlot(resourceGroupName, name, publishingProfileOptions, slot, 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._listPublishingProfileXmlWithSecretsSlot(resourceGroupName, name, publishingProfileOptions, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listPublishingProfileXmlWithSecretsSlot(resourceGroupName, name, publishingProfileOptions, slot, options, optionalCallback); + } + } + + /** + * @summary Resets the configuration settings of the current slot if they were + * previously modified by calling the API with POST. + * + * Resets the configuration settings of the current slot if they were + * previously modified by calling the API with POST. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API resets configuration settings for the production slot. + * + * @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. + */ + resetSlotConfigurationSlotWithHttpOperationResponse(resourceGroupName, name, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._resetSlotConfigurationSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Resets the configuration settings of the current slot if they were + * previously modified by calling the API with POST. + * + * Resets the configuration settings of the current slot if they were + * previously modified by calling the API with POST. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API resets configuration settings for the production slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + resetSlotConfigurationSlot(resourceGroupName, name, slot, 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._resetSlotConfigurationSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._resetSlotConfigurationSlot(resourceGroupName, name, slot, options, optionalCallback); + } + } + + /** + * @summary Restarts an app (or deployment slot, if specified). + * + * Restarts an app (or deployment slot, if specified). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will restart the production slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {boolean} [options.softRestart] Specify true to apply the + * configuration settings and restarts the app only if necessary. By default, + * the API always restarts and reprovisions the app. + * + * @param {boolean} [options.synchronous] Specify true to block until the app + * is restarted. By default, it is set to false, and the API responds + * immediately (asynchronous). + * + * @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. + */ + restartSlotWithHttpOperationResponse(resourceGroupName, name, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._restartSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Restarts an app (or deployment slot, if specified). + * + * Restarts an app (or deployment slot, if specified). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will restart the production slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {boolean} [options.softRestart] Specify true to apply the + * configuration settings and restarts the app only if necessary. By default, + * the API always restarts and reprovisions the app. + * + * @param {boolean} [options.synchronous] Specify true to block until the app + * is restarted. By default, it is set to false, and the API responds + * immediately (asynchronous). + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + restartSlot(resourceGroupName, name, slot, 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._restartSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._restartSlot(resourceGroupName, name, slot, options, optionalCallback); + } + } + + /** + * @summary Restores an app from a backup blob in Azure Storage. + * + * Restores an app from a backup blob in Azure Storage. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} request Information on restore request . + * + * @param {string} request.storageAccountUrl SAS URL to the container. + * + * @param {string} [request.blobName] Name of a blob which contains the backup. + * + * @param {boolean} request.overwrite true if the restore + * operation can overwrite target app; otherwise, false. + * true is needed if trying to restore over an existing app. + * + * @param {string} [request.siteName] Name of an app. + * + * @param {array} [request.databases] Collection of databases which should be + * restored. This list has to match the list of databases included in the + * backup. + * + * @param {boolean} [request.ignoreConflictingHostNames] Changes a logic when + * restoring an app with custom domains. true to remove custom + * domains automatically. If false, custom domains are added to + * the app's object when it is being restored, but that might fail due to + * conflicts during the operation. + * + * @param {boolean} [request.ignoreDatabases] Ignore the databases and only + * restore the site content + * + * @param {string} [request.appServicePlan] Specify app service plan that will + * own restored site. + * + * @param {string} [request.operationType] Operation type. Possible values + * include: 'Default', 'Clone', 'Relocation', 'Snapshot', 'CloudFS' + * + * @param {boolean} [request.adjustConnectionStrings] true if + * SiteConfig.ConnectionStrings should be set in new app; otherwise, + * false. + * + * @param {string} [request.hostingEnvironment] App Service Environment name, + * if needed (only when restoring an app to an App Service Environment). + * + * @param {string} [request.kind] Kind of resource. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will restore a backup of the production slot. + * + * @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. + */ + restoreFromBackupBlobSlotWithHttpOperationResponse(resourceGroupName, name, request, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._restoreFromBackupBlobSlot(resourceGroupName, name, request, slot, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Restores an app from a backup blob in Azure Storage. + * + * Restores an app from a backup blob in Azure Storage. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} request Information on restore request . + * + * @param {string} request.storageAccountUrl SAS URL to the container. + * + * @param {string} [request.blobName] Name of a blob which contains the backup. + * + * @param {boolean} request.overwrite true if the restore + * operation can overwrite target app; otherwise, false. + * true is needed if trying to restore over an existing app. + * + * @param {string} [request.siteName] Name of an app. + * + * @param {array} [request.databases] Collection of databases which should be + * restored. This list has to match the list of databases included in the + * backup. + * + * @param {boolean} [request.ignoreConflictingHostNames] Changes a logic when + * restoring an app with custom domains. true to remove custom + * domains automatically. If false, custom domains are added to + * the app's object when it is being restored, but that might fail due to + * conflicts during the operation. + * + * @param {boolean} [request.ignoreDatabases] Ignore the databases and only + * restore the site content + * + * @param {string} [request.appServicePlan] Specify app service plan that will + * own restored site. + * + * @param {string} [request.operationType] Operation type. Possible values + * include: 'Default', 'Clone', 'Relocation', 'Snapshot', 'CloudFS' + * + * @param {boolean} [request.adjustConnectionStrings] true if + * SiteConfig.ConnectionStrings should be set in new app; otherwise, + * false. + * + * @param {string} [request.hostingEnvironment] App Service Environment name, + * if needed (only when restoring an app to an App Service Environment). + * + * @param {string} [request.kind] Kind of resource. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will restore a backup of the production slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + restoreFromBackupBlobSlot(resourceGroupName, name, request, slot, 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._restoreFromBackupBlobSlot(resourceGroupName, name, request, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._restoreFromBackupBlobSlot(resourceGroupName, name, request, slot, options, optionalCallback); + } + } + + /** + * @summary Restores a deleted web app to this web app. + * + * Restores a deleted web app to this web app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {object} restoreRequest Deleted web app restore information. + * + * @param {string} [restoreRequest.deletedSiteId] ARM resource ID of the + * deleted app. Example: + * /subscriptions/{subId}/providers/Microsoft.Web/deletedSites/{deletedSiteId} + * + * @param {boolean} [restoreRequest.recoverConfiguration] If true, deleted site + * configuration, in addition to content, will be restored. + * + * @param {string} [restoreRequest.snapshotTime] Point in time to restore the + * deleted app from, formatted as a DateTime string. + * If unspecified, default value is the time that the app was deleted. + * + * @param {string} [restoreRequest.kind] Kind of resource. + * + * @param {string} slot Name of web app slot. If not specified then will + * default to production slot. + * + * @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. + */ + restoreFromDeletedAppSlotWithHttpOperationResponse(resourceGroupName, name, restoreRequest, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._restoreFromDeletedAppSlot(resourceGroupName, name, restoreRequest, slot, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Restores a deleted web app to this web app. + * + * Restores a deleted web app to this web app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {object} restoreRequest Deleted web app restore information. + * + * @param {string} [restoreRequest.deletedSiteId] ARM resource ID of the + * deleted app. Example: + * /subscriptions/{subId}/providers/Microsoft.Web/deletedSites/{deletedSiteId} + * + * @param {boolean} [restoreRequest.recoverConfiguration] If true, deleted site + * configuration, in addition to content, will be restored. + * + * @param {string} [restoreRequest.snapshotTime] Point in time to restore the + * deleted app from, formatted as a DateTime string. + * If unspecified, default value is the time that the app was deleted. + * + * @param {string} [restoreRequest.kind] Kind of resource. + * + * @param {string} slot Name of web app slot. If not specified then will + * default to production slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + restoreFromDeletedAppSlot(resourceGroupName, name, restoreRequest, slot, 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._restoreFromDeletedAppSlot(resourceGroupName, name, restoreRequest, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._restoreFromDeletedAppSlot(resourceGroupName, name, restoreRequest, slot, options, optionalCallback); + } + } + + /** + * @summary Restores a web app from a snapshot. + * + * Restores a web app from a snapshot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {object} restoreRequest Snapshot restore settings. Snapshot + * information can be obtained by calling GetDeletedSites or GetSiteSnapshots + * API. + * + * @param {string} [restoreRequest.snapshotTime] Point in time in which the app + * restore should be done, formatted as a DateTime string. + * + * @param {object} [restoreRequest.recoverySource] Optional. Specifies the web + * app that snapshot contents will be retrieved from. + * If empty, the targeted web app will be used as the source. + * + * @param {string} [restoreRequest.recoverySource.location] Geographical + * location of the source web app, e.g. SouthEastAsia, SouthCentralUS + * + * @param {string} [restoreRequest.recoverySource.id] ARM resource ID of the + * source app. + * /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName} + * for production slots and + * /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/slots/{slotName} + * for other slots. + * + * @param {boolean} restoreRequest.overwrite If true the restore + * operation can overwrite source app; otherwise, false. + * + * @param {boolean} [restoreRequest.recoverConfiguration] If true, site + * configuration, in addition to content, will be reverted. + * + * @param {boolean} [restoreRequest.ignoreConflictingHostNames] If true, custom + * hostname conflicts will be ignored when recovering to a target web app. + * This setting is only necessary when RecoverConfiguration is enabled. + * + * @param {string} [restoreRequest.kind] Kind of resource. + * + * @param {string} slot Name of web app slot. If not specified then will + * default to production slot. + * + * @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. + */ + restoreSnapshotSlotWithHttpOperationResponse(resourceGroupName, name, restoreRequest, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._restoreSnapshotSlot(resourceGroupName, name, restoreRequest, slot, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Restores a web app from a snapshot. + * + * Restores a web app from a snapshot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {object} restoreRequest Snapshot restore settings. Snapshot + * information can be obtained by calling GetDeletedSites or GetSiteSnapshots + * API. + * + * @param {string} [restoreRequest.snapshotTime] Point in time in which the app + * restore should be done, formatted as a DateTime string. + * + * @param {object} [restoreRequest.recoverySource] Optional. Specifies the web + * app that snapshot contents will be retrieved from. + * If empty, the targeted web app will be used as the source. + * + * @param {string} [restoreRequest.recoverySource.location] Geographical + * location of the source web app, e.g. SouthEastAsia, SouthCentralUS + * + * @param {string} [restoreRequest.recoverySource.id] ARM resource ID of the + * source app. + * /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName} + * for production slots and + * /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/slots/{slotName} + * for other slots. + * + * @param {boolean} restoreRequest.overwrite If true the restore + * operation can overwrite source app; otherwise, false. + * + * @param {boolean} [restoreRequest.recoverConfiguration] If true, site + * configuration, in addition to content, will be reverted. + * + * @param {boolean} [restoreRequest.ignoreConflictingHostNames] If true, custom + * hostname conflicts will be ignored when recovering to a target web app. + * This setting is only necessary when RecoverConfiguration is enabled. + * + * @param {string} [restoreRequest.kind] Kind of resource. + * + * @param {string} slot Name of web app slot. If not specified then will + * default to production slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + restoreSnapshotSlot(resourceGroupName, name, restoreRequest, slot, 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._restoreSnapshotSlot(resourceGroupName, name, restoreRequest, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._restoreSnapshotSlot(resourceGroupName, name, restoreRequest, slot, options, optionalCallback); + } + } + + /** + * @summary Get list of siteextensions for a web site, or a deployment slot. + * + * Get list of siteextensions for a web site, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API deletes a deployment for the production slot. + * + * @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. + */ + listSiteExtensionsSlotWithHttpOperationResponse(resourceGroupName, name, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listSiteExtensionsSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Get list of siteextensions for a web site, or a deployment slot. + * + * Get list of siteextensions for a web site, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API deletes a deployment for the production slot. + * + * @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 {SiteExtensionInfoCollection} - 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 SiteExtensionInfoCollection} 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. + */ + listSiteExtensionsSlot(resourceGroupName, name, slot, 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._listSiteExtensionsSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listSiteExtensionsSlot(resourceGroupName, name, slot, options, optionalCallback); + } + } + + /** + * @summary Get site extension information by its ID for a web site, or a + * deployment slot. + * + * Get site extension information by its ID for a web site, or a deployment + * slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} siteExtensionId Site extension name. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API deletes a deployment for the production slot. + * + * @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. + */ + getSiteExtensionSlotWithHttpOperationResponse(resourceGroupName, name, siteExtensionId, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._getSiteExtensionSlot(resourceGroupName, name, siteExtensionId, slot, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Get site extension information by its ID for a web site, or a + * deployment slot. + * + * Get site extension information by its ID for a web site, or a deployment + * slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} siteExtensionId Site extension name. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API deletes a deployment for the production slot. + * + * @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 {SiteExtensionInfo} - 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 SiteExtensionInfo} 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. + */ + getSiteExtensionSlot(resourceGroupName, name, siteExtensionId, slot, 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._getSiteExtensionSlot(resourceGroupName, name, siteExtensionId, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getSiteExtensionSlot(resourceGroupName, name, siteExtensionId, slot, options, optionalCallback); + } + } + + /** + * @summary Install site extension on a web site, or a deployment slot. + * + * Install site extension on a web site, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} siteExtensionId Site extension name. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API deletes a deployment for the production slot. + * + * @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. + */ + installSiteExtensionSlotWithHttpOperationResponse(resourceGroupName, name, siteExtensionId, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._installSiteExtensionSlot(resourceGroupName, name, siteExtensionId, slot, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Install site extension on a web site, or a deployment slot. + * + * Install site extension on a web site, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} siteExtensionId Site extension name. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API deletes a deployment for the production slot. + * + * @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 {SiteExtensionInfo} - 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 SiteExtensionInfo} 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. + */ + installSiteExtensionSlot(resourceGroupName, name, siteExtensionId, slot, 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._installSiteExtensionSlot(resourceGroupName, name, siteExtensionId, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._installSiteExtensionSlot(resourceGroupName, name, siteExtensionId, slot, options, optionalCallback); + } + } + + /** + * @summary Remove a site extension from a web site, or a deployment slot. + * + * Remove a site extension from a web site, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} siteExtensionId Site extension name. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API deletes a deployment for the production slot. + * + * @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. + */ + deleteSiteExtensionSlotWithHttpOperationResponse(resourceGroupName, name, siteExtensionId, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._deleteSiteExtensionSlot(resourceGroupName, name, siteExtensionId, slot, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Remove a site extension from a web site, or a deployment slot. + * + * Remove a site extension from a web site, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} siteExtensionId Site extension name. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API deletes a deployment for the production slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + deleteSiteExtensionSlot(resourceGroupName, name, siteExtensionId, slot, 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._deleteSiteExtensionSlot(resourceGroupName, name, siteExtensionId, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._deleteSiteExtensionSlot(resourceGroupName, name, siteExtensionId, slot, options, optionalCallback); + } + } + + /** + * @summary Get the difference in configuration settings between two web app + * slots. + * + * Get the difference in configuration settings between two web app slots. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} slotSwapEntity JSON object that contains the target slot + * name. See example. + * + * @param {string} slotSwapEntity.targetSlot Destination deployment slot during + * swap operation. + * + * @param {boolean} slotSwapEntity.preserveVnet true to preserve + * Virtual Network to the slot during swap; otherwise, false. + * + * @param {string} slot Name of the source slot. If a slot is not specified, + * the production slot is used as the source slot. + * + * @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. + */ + listSlotDifferencesSlotWithHttpOperationResponse(resourceGroupName, name, slotSwapEntity, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listSlotDifferencesSlot(resourceGroupName, name, slotSwapEntity, slot, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Get the difference in configuration settings between two web app + * slots. + * + * Get the difference in configuration settings between two web app slots. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} slotSwapEntity JSON object that contains the target slot + * name. See example. + * + * @param {string} slotSwapEntity.targetSlot Destination deployment slot during + * swap operation. + * + * @param {boolean} slotSwapEntity.preserveVnet true to preserve + * Virtual Network to the slot during swap; otherwise, false. + * + * @param {string} slot Name of the source slot. If a slot is not specified, + * the production slot is used as the source slot. + * + * @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 {SlotDifferenceCollection} - 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 SlotDifferenceCollection} 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. + */ + listSlotDifferencesSlot(resourceGroupName, name, slotSwapEntity, slot, 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._listSlotDifferencesSlot(resourceGroupName, name, slotSwapEntity, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listSlotDifferencesSlot(resourceGroupName, name, slotSwapEntity, slot, options, optionalCallback); + } + } + + /** + * @summary Swaps two deployment slots of an app. + * + * Swaps two deployment slots of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} slotSwapEntity JSON object that contains the target slot + * name. See example. + * + * @param {string} slotSwapEntity.targetSlot Destination deployment slot during + * swap operation. + * + * @param {boolean} slotSwapEntity.preserveVnet true to preserve + * Virtual Network to the slot during swap; otherwise, false. + * + * @param {string} slot Name of the source slot. If a slot is not specified, + * the production slot is used as the source slot. + * + * @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. + */ + swapSlotSlotWithHttpOperationResponse(resourceGroupName, name, slotSwapEntity, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._swapSlotSlot(resourceGroupName, name, slotSwapEntity, slot, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Swaps two deployment slots of an app. + * + * Swaps two deployment slots of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} slotSwapEntity JSON object that contains the target slot + * name. See example. + * + * @param {string} slotSwapEntity.targetSlot Destination deployment slot during + * swap operation. + * + * @param {boolean} slotSwapEntity.preserveVnet true to preserve + * Virtual Network to the slot during swap; otherwise, false. + * + * @param {string} slot Name of the source slot. If a slot is not specified, + * the production slot is used as the source slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + swapSlotSlot(resourceGroupName, name, slotSwapEntity, slot, 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._swapSlotSlot(resourceGroupName, name, slotSwapEntity, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._swapSlotSlot(resourceGroupName, name, slotSwapEntity, slot, options, optionalCallback); + } + } + + /** + * @summary Returns all Snapshots to the user. + * + * Returns all Snapshots to the user. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Website Name. + * + * @param {string} slot Website Slot. + * + * @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. + */ + listSnapshotsSlotWithHttpOperationResponse(resourceGroupName, name, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listSnapshotsSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Returns all Snapshots to the user. + * + * Returns all Snapshots to the user. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Website Name. + * + * @param {string} slot Website Slot. + * + * @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 {SnapshotCollection} - 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 SnapshotCollection} 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. + */ + listSnapshotsSlot(resourceGroupName, name, slot, 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._listSnapshotsSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listSnapshotsSlot(resourceGroupName, name, slot, options, optionalCallback); + } + } + + /** + * @summary Gets the source control configuration of an app. + * + * Gets the source control configuration of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will get the source control configuration for the + * production slot. + * + * @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. + */ + getSourceControlSlotWithHttpOperationResponse(resourceGroupName, name, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._getSourceControlSlot(resourceGroupName, name, slot, 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 the source control configuration of an app. + * + * Gets the source control configuration of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will get the source control configuration for the + * production slot. + * + * @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 {SiteSourceControl} - 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 SiteSourceControl} 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. + */ + getSourceControlSlot(resourceGroupName, name, slot, 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._getSourceControlSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getSourceControlSlot(resourceGroupName, name, slot, options, optionalCallback); + } + } + + /** + * @summary Updates the source control configuration of an app. + * + * Updates the source control configuration of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} siteSourceControl JSON representation of a SiteSourceControl + * object. See example. + * + * @param {string} [siteSourceControl.repoUrl] Repository or source control + * URL. + * + * @param {string} [siteSourceControl.branch] Name of branch to use for + * deployment. + * + * @param {boolean} [siteSourceControl.isManualIntegration] true + * to limit to manual integration; false to enable continuous + * integration (which configures webhooks into online repos like GitHub). + * + * @param {boolean} [siteSourceControl.deploymentRollbackEnabled] + * true to enable deployment rollback; otherwise, + * false. + * + * @param {boolean} [siteSourceControl.isMercurial] true for a + * Mercurial repository; false for a Git repository. + * + * @param {string} [siteSourceControl.kind] Kind of resource. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will update the source control configuration for the + * production slot. + * + * @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. + */ + createOrUpdateSourceControlSlotWithHttpOperationResponse(resourceGroupName, name, siteSourceControl, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._createOrUpdateSourceControlSlot(resourceGroupName, name, siteSourceControl, slot, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Updates the source control configuration of an app. + * + * Updates the source control configuration of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} siteSourceControl JSON representation of a SiteSourceControl + * object. See example. + * + * @param {string} [siteSourceControl.repoUrl] Repository or source control + * URL. + * + * @param {string} [siteSourceControl.branch] Name of branch to use for + * deployment. + * + * @param {boolean} [siteSourceControl.isManualIntegration] true + * to limit to manual integration; false to enable continuous + * integration (which configures webhooks into online repos like GitHub). + * + * @param {boolean} [siteSourceControl.deploymentRollbackEnabled] + * true to enable deployment rollback; otherwise, + * false. + * + * @param {boolean} [siteSourceControl.isMercurial] true for a + * Mercurial repository; false for a Git repository. + * + * @param {string} [siteSourceControl.kind] Kind of resource. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will update the source control configuration for the + * production slot. + * + * @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 {SiteSourceControl} - 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 SiteSourceControl} 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. + */ + createOrUpdateSourceControlSlot(resourceGroupName, name, siteSourceControl, slot, 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._createOrUpdateSourceControlSlot(resourceGroupName, name, siteSourceControl, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._createOrUpdateSourceControlSlot(resourceGroupName, name, siteSourceControl, slot, options, optionalCallback); + } + } + + /** + * @summary Deletes the source control configuration of an app. + * + * Deletes the source control configuration of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will delete the source control configuration for the + * production slot. + * + * @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. + */ + deleteSourceControlSlotWithHttpOperationResponse(resourceGroupName, name, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._deleteSourceControlSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Deletes the source control configuration of an app. + * + * Deletes the source control configuration of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will delete the source control configuration for the + * production slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + deleteSourceControlSlot(resourceGroupName, name, slot, 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._deleteSourceControlSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._deleteSourceControlSlot(resourceGroupName, name, slot, options, optionalCallback); + } + } + + /** + * @summary Updates the source control configuration of an app. + * + * Updates the source control configuration of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} siteSourceControl JSON representation of a SiteSourceControl + * object. See example. + * + * @param {string} [siteSourceControl.repoUrl] Repository or source control + * URL. + * + * @param {string} [siteSourceControl.branch] Name of branch to use for + * deployment. + * + * @param {boolean} [siteSourceControl.isManualIntegration] true + * to limit to manual integration; false to enable continuous + * integration (which configures webhooks into online repos like GitHub). + * + * @param {boolean} [siteSourceControl.deploymentRollbackEnabled] + * true to enable deployment rollback; otherwise, + * false. + * + * @param {boolean} [siteSourceControl.isMercurial] true for a + * Mercurial repository; false for a Git repository. + * + * @param {string} [siteSourceControl.kind] Kind of resource. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will update the source control configuration for the + * production slot. + * + * @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. + */ + updateSourceControlSlotWithHttpOperationResponse(resourceGroupName, name, siteSourceControl, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._updateSourceControlSlot(resourceGroupName, name, siteSourceControl, slot, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Updates the source control configuration of an app. + * + * Updates the source control configuration of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} siteSourceControl JSON representation of a SiteSourceControl + * object. See example. + * + * @param {string} [siteSourceControl.repoUrl] Repository or source control + * URL. + * + * @param {string} [siteSourceControl.branch] Name of branch to use for + * deployment. + * + * @param {boolean} [siteSourceControl.isManualIntegration] true + * to limit to manual integration; false to enable continuous + * integration (which configures webhooks into online repos like GitHub). + * + * @param {boolean} [siteSourceControl.deploymentRollbackEnabled] + * true to enable deployment rollback; otherwise, + * false. + * + * @param {boolean} [siteSourceControl.isMercurial] true for a + * Mercurial repository; false for a Git repository. + * + * @param {string} [siteSourceControl.kind] Kind of resource. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will update the source control configuration for the + * production slot. + * + * @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 {SiteSourceControl} - 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 SiteSourceControl} 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. + */ + updateSourceControlSlot(resourceGroupName, name, siteSourceControl, slot, 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._updateSourceControlSlot(resourceGroupName, name, siteSourceControl, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._updateSourceControlSlot(resourceGroupName, name, siteSourceControl, slot, options, optionalCallback); + } + } + + /** + * @summary Starts an app (or deployment slot, if specified). + * + * Starts an app (or deployment slot, if specified). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will start the production slot. + * + * @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. + */ + startSlotWithHttpOperationResponse(resourceGroupName, name, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._startSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Starts an app (or deployment slot, if specified). + * + * Starts an app (or deployment slot, if specified). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will start the production slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + startSlot(resourceGroupName, name, slot, 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._startSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._startSlot(resourceGroupName, name, slot, options, optionalCallback); + } + } + + /** + * @summary Stops an app (or deployment slot, if specified). + * + * Stops an app (or deployment slot, if specified). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will stop the production slot. + * + * @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. + */ + stopSlotWithHttpOperationResponse(resourceGroupName, name, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._stopSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Stops an app (or deployment slot, if specified). + * + * Stops an app (or deployment slot, if specified). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will stop the production slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + stopSlot(resourceGroupName, name, slot, 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._stopSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._stopSlot(resourceGroupName, name, slot, options, optionalCallback); + } + } + + /** + * @summary Sync web app repository. + * + * Sync web app repository. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {string} slot Name of web app slot. If not specified then will + * default to production slot. + * + * @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. + */ + syncRepositorySlotWithHttpOperationResponse(resourceGroupName, name, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._syncRepositorySlot(resourceGroupName, name, slot, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Sync web app repository. + * + * Sync web app repository. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {string} slot Name of web app slot. If not specified then will + * default to production slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + syncRepositorySlot(resourceGroupName, name, slot, 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._syncRepositorySlot(resourceGroupName, name, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._syncRepositorySlot(resourceGroupName, name, slot, options, optionalCallback); + } + } + + /** + * @summary Syncs function trigger metadata to the scale controller + * + * Syncs function trigger metadata to the scale controller + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will restore a backup of the production slot. + * + * @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. + */ + syncFunctionTriggersSlotWithHttpOperationResponse(resourceGroupName, name, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._syncFunctionTriggersSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Syncs function trigger metadata to the scale controller + * + * Syncs function trigger metadata to the scale controller + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will restore a backup of the production slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + syncFunctionTriggersSlot(resourceGroupName, name, slot, 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._syncFunctionTriggersSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._syncFunctionTriggersSlot(resourceGroupName, name, slot, options, optionalCallback); + } + } + + /** + * @summary List triggered web jobs for an app, or a deployment slot. + * + * List triggered web jobs for an app, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API deletes a deployment for the production slot. + * + * @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. + */ + listTriggeredWebJobsSlotWithHttpOperationResponse(resourceGroupName, name, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listTriggeredWebJobsSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary List triggered web jobs for an app, or a deployment slot. + * + * List triggered web jobs for an app, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API deletes a deployment for the production slot. + * + * @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 {TriggeredWebJobCollection} - 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 TriggeredWebJobCollection} 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. + */ + listTriggeredWebJobsSlot(resourceGroupName, name, slot, 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._listTriggeredWebJobsSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listTriggeredWebJobsSlot(resourceGroupName, name, slot, options, optionalCallback); + } + } + + /** + * @summary Gets a triggered web job by its ID for an app, or a deployment + * slot. + * + * Gets a triggered web job by its ID for an app, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} webJobName Name of Web Job. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API deletes a deployment for the production slot. + * + * @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. + */ + getTriggeredWebJobSlotWithHttpOperationResponse(resourceGroupName, name, webJobName, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._getTriggeredWebJobSlot(resourceGroupName, name, webJobName, slot, 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 triggered web job by its ID for an app, or a deployment + * slot. + * + * Gets a triggered web job by its ID for an app, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} webJobName Name of Web Job. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API deletes a deployment for the production slot. + * + * @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 {TriggeredWebJob} - 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 TriggeredWebJob} 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. + */ + getTriggeredWebJobSlot(resourceGroupName, name, webJobName, slot, 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._getTriggeredWebJobSlot(resourceGroupName, name, webJobName, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getTriggeredWebJobSlot(resourceGroupName, name, webJobName, slot, options, optionalCallback); + } + } + + /** + * @summary Delete a triggered web job by its ID for an app, or a deployment + * slot. + * + * Delete a triggered web job by its ID for an app, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} webJobName Name of Web Job. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API deletes a deployment for the production slot. + * + * @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. + */ + deleteTriggeredWebJobSlotWithHttpOperationResponse(resourceGroupName, name, webJobName, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._deleteTriggeredWebJobSlot(resourceGroupName, name, webJobName, slot, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Delete a triggered web job by its ID for an app, or a deployment + * slot. + * + * Delete a triggered web job by its ID for an app, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} webJobName Name of Web Job. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API deletes a deployment for the production slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + deleteTriggeredWebJobSlot(resourceGroupName, name, webJobName, slot, 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._deleteTriggeredWebJobSlot(resourceGroupName, name, webJobName, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._deleteTriggeredWebJobSlot(resourceGroupName, name, webJobName, slot, options, optionalCallback); + } + } + + /** + * @summary List a triggered web job's history for an app, or a deployment + * slot. + * + * List a triggered web job's history for an app, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} webJobName Name of Web Job. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API deletes a deployment for the production slot. + * + * @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. + */ + listTriggeredWebJobHistorySlotWithHttpOperationResponse(resourceGroupName, name, webJobName, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listTriggeredWebJobHistorySlot(resourceGroupName, name, webJobName, slot, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary List a triggered web job's history for an app, or a deployment + * slot. + * + * List a triggered web job's history for an app, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} webJobName Name of Web Job. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API deletes a deployment for the production slot. + * + * @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 {TriggeredJobHistoryCollection} - 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 TriggeredJobHistoryCollection} 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. + */ + listTriggeredWebJobHistorySlot(resourceGroupName, name, webJobName, slot, 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._listTriggeredWebJobHistorySlot(resourceGroupName, name, webJobName, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listTriggeredWebJobHistorySlot(resourceGroupName, name, webJobName, slot, options, optionalCallback); + } + } + + /** + * @summary Gets a triggered web job's history by its ID for an app, , or a + * deployment slot. + * + * Gets a triggered web job's history by its ID for an app, , or a deployment + * slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} webJobName Name of Web Job. + * + * @param {string} id History ID. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API deletes a deployment for the production slot. + * + * @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. + */ + getTriggeredWebJobHistorySlotWithHttpOperationResponse(resourceGroupName, name, webJobName, id, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._getTriggeredWebJobHistorySlot(resourceGroupName, name, webJobName, id, slot, 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 triggered web job's history by its ID for an app, , or a + * deployment slot. + * + * Gets a triggered web job's history by its ID for an app, , or a deployment + * slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} webJobName Name of Web Job. + * + * @param {string} id History ID. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API deletes a deployment for the production slot. + * + * @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 {TriggeredJobHistory} - 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 TriggeredJobHistory} 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. + */ + getTriggeredWebJobHistorySlot(resourceGroupName, name, webJobName, id, slot, 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._getTriggeredWebJobHistorySlot(resourceGroupName, name, webJobName, id, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getTriggeredWebJobHistorySlot(resourceGroupName, name, webJobName, id, slot, options, optionalCallback); + } + } + + /** + * @summary Run a triggered web job for an app, or a deployment slot. + * + * Run a triggered web job for an app, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} webJobName Name of Web Job. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API deletes a deployment for the production slot. + * + * @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. + */ + runTriggeredWebJobSlotWithHttpOperationResponse(resourceGroupName, name, webJobName, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._runTriggeredWebJobSlot(resourceGroupName, name, webJobName, slot, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Run a triggered web job for an app, or a deployment slot. + * + * Run a triggered web job for an app, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} webJobName Name of Web Job. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API deletes a deployment for the production slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + runTriggeredWebJobSlot(resourceGroupName, name, webJobName, slot, 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._runTriggeredWebJobSlot(resourceGroupName, name, webJobName, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._runTriggeredWebJobSlot(resourceGroupName, name, webJobName, slot, options, optionalCallback); + } + } + + /** + * @summary Gets the quota usage information of an app (or deployment slot, if + * specified). + * + * Gets the quota usage information of an app (or deployment slot, if + * specified). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will get quota information of the production slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.filter] Return only information specified in the + * filter (using OData syntax). For example: $filter=(name.value eq 'Metric1' + * or name.value eq 'Metric2') and startTime eq 2014-01-01T00:00:00Z and + * endTime eq 2014-12-31T23:59:59Z and timeGrain eq + * duration'[Hour|Minute|Day]'. + * + * @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. + */ + listUsagesSlotWithHttpOperationResponse(resourceGroupName, name, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listUsagesSlot(resourceGroupName, name, slot, 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 the quota usage information of an app (or deployment slot, if + * specified). + * + * Gets the quota usage information of an app (or deployment slot, if + * specified). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will get quota information of the production slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.filter] Return only information specified in the + * filter (using OData syntax). For example: $filter=(name.value eq 'Metric1' + * or name.value eq 'Metric2') and startTime eq 2014-01-01T00:00:00Z and + * endTime eq 2014-12-31T23:59:59Z and timeGrain eq + * duration'[Hour|Minute|Day]'. + * + * @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 {CsmUsageQuotaCollection} - 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 CsmUsageQuotaCollection} 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. + */ + listUsagesSlot(resourceGroupName, name, slot, 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._listUsagesSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listUsagesSlot(resourceGroupName, name, slot, options, optionalCallback); + } + } + + /** + * @summary Gets the virtual networks the app (or deployment slot) is connected + * to. + * + * Gets the virtual networks the app (or deployment slot) is connected to. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will get virtual network connections for the production + * slot. + * + * @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. + */ + listVnetConnectionsSlotWithHttpOperationResponse(resourceGroupName, name, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listVnetConnectionsSlot(resourceGroupName, name, slot, 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 the virtual networks the app (or deployment slot) is connected + * to. + * + * Gets the virtual networks the app (or deployment slot) is connected to. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will get virtual network connections for the production + * slot. + * + * @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 {Array} - 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. + * + * {array} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listVnetConnectionsSlot(resourceGroupName, name, slot, 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._listVnetConnectionsSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listVnetConnectionsSlot(resourceGroupName, name, slot, options, optionalCallback); + } + } + + /** + * @summary Gets a virtual network the app (or deployment slot) is connected to + * by name. + * + * Gets a virtual network the app (or deployment slot) is connected to by name. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} vnetName Name of the virtual network. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will get the named virtual network for the production + * slot. + * + * @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. + */ + getVnetConnectionSlotWithHttpOperationResponse(resourceGroupName, name, vnetName, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._getVnetConnectionSlot(resourceGroupName, name, vnetName, slot, 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 virtual network the app (or deployment slot) is connected to + * by name. + * + * Gets a virtual network the app (or deployment slot) is connected to by name. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} vnetName Name of the virtual network. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will get the named virtual network for the production + * slot. + * + * @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 {VnetInfo} - 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 VnetInfo} 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. + */ + getVnetConnectionSlot(resourceGroupName, name, vnetName, slot, 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._getVnetConnectionSlot(resourceGroupName, name, vnetName, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getVnetConnectionSlot(resourceGroupName, name, vnetName, slot, options, optionalCallback); + } + } + + /** + * @summary Adds a Virtual Network connection to an app or slot (PUT) or + * updates the connection properties (PATCH). + * + * Adds a Virtual Network connection to an app or slot (PUT) or updates the + * connection properties (PATCH). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} vnetName Name of an existing Virtual Network. + * + * @param {object} connectionEnvelope Properties of the Virtual Network + * connection. See example. + * + * @param {string} [connectionEnvelope.vnetResourceId] The Virtual Network's + * resource ID. + * + * @param {buffer} [connectionEnvelope.certBlob] A certificate file (.cer) blob + * containing the public key of the private key used to authenticate a + * Point-To-Site VPN connection. + * + * @param {string} [connectionEnvelope.dnsServers] DNS servers to be used by + * this Virtual Network. This should be a comma-separated list of IP addresses. + * + * @param {string} [connectionEnvelope.kind] Kind of resource. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will add or update connections for the production slot. + * + * @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. + */ + createOrUpdateVnetConnectionSlotWithHttpOperationResponse(resourceGroupName, name, vnetName, connectionEnvelope, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._createOrUpdateVnetConnectionSlot(resourceGroupName, name, vnetName, connectionEnvelope, slot, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Adds a Virtual Network connection to an app or slot (PUT) or + * updates the connection properties (PATCH). + * + * Adds a Virtual Network connection to an app or slot (PUT) or updates the + * connection properties (PATCH). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} vnetName Name of an existing Virtual Network. + * + * @param {object} connectionEnvelope Properties of the Virtual Network + * connection. See example. + * + * @param {string} [connectionEnvelope.vnetResourceId] The Virtual Network's + * resource ID. + * + * @param {buffer} [connectionEnvelope.certBlob] A certificate file (.cer) blob + * containing the public key of the private key used to authenticate a + * Point-To-Site VPN connection. + * + * @param {string} [connectionEnvelope.dnsServers] DNS servers to be used by + * this Virtual Network. This should be a comma-separated list of IP addresses. + * + * @param {string} [connectionEnvelope.kind] Kind of resource. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will add or update connections for the production slot. + * + * @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 {VnetInfo} - 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 VnetInfo} 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. + */ + createOrUpdateVnetConnectionSlot(resourceGroupName, name, vnetName, connectionEnvelope, slot, 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._createOrUpdateVnetConnectionSlot(resourceGroupName, name, vnetName, connectionEnvelope, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._createOrUpdateVnetConnectionSlot(resourceGroupName, name, vnetName, connectionEnvelope, slot, options, optionalCallback); + } + } + + /** + * @summary Deletes a connection from an app (or deployment slot to a named + * virtual network. + * + * Deletes a connection from an app (or deployment slot to a named virtual + * network. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} vnetName Name of the virtual network. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will delete the connection for the production slot. + * + * @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. + */ + deleteVnetConnectionSlotWithHttpOperationResponse(resourceGroupName, name, vnetName, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._deleteVnetConnectionSlot(resourceGroupName, name, vnetName, slot, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Deletes a connection from an app (or deployment slot to a named + * virtual network. + * + * Deletes a connection from an app (or deployment slot to a named virtual + * network. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} vnetName Name of the virtual network. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will delete the connection for the production slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + deleteVnetConnectionSlot(resourceGroupName, name, vnetName, slot, 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._deleteVnetConnectionSlot(resourceGroupName, name, vnetName, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._deleteVnetConnectionSlot(resourceGroupName, name, vnetName, slot, options, optionalCallback); + } + } + + /** + * @summary Adds a Virtual Network connection to an app or slot (PUT) or + * updates the connection properties (PATCH). + * + * Adds a Virtual Network connection to an app or slot (PUT) or updates the + * connection properties (PATCH). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} vnetName Name of an existing Virtual Network. + * + * @param {object} connectionEnvelope Properties of the Virtual Network + * connection. See example. + * + * @param {string} [connectionEnvelope.vnetResourceId] The Virtual Network's + * resource ID. + * + * @param {buffer} [connectionEnvelope.certBlob] A certificate file (.cer) blob + * containing the public key of the private key used to authenticate a + * Point-To-Site VPN connection. + * + * @param {string} [connectionEnvelope.dnsServers] DNS servers to be used by + * this Virtual Network. This should be a comma-separated list of IP addresses. + * + * @param {string} [connectionEnvelope.kind] Kind of resource. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will add or update connections for the production slot. + * + * @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. + */ + updateVnetConnectionSlotWithHttpOperationResponse(resourceGroupName, name, vnetName, connectionEnvelope, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._updateVnetConnectionSlot(resourceGroupName, name, vnetName, connectionEnvelope, slot, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Adds a Virtual Network connection to an app or slot (PUT) or + * updates the connection properties (PATCH). + * + * Adds a Virtual Network connection to an app or slot (PUT) or updates the + * connection properties (PATCH). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} vnetName Name of an existing Virtual Network. + * + * @param {object} connectionEnvelope Properties of the Virtual Network + * connection. See example. + * + * @param {string} [connectionEnvelope.vnetResourceId] The Virtual Network's + * resource ID. + * + * @param {buffer} [connectionEnvelope.certBlob] A certificate file (.cer) blob + * containing the public key of the private key used to authenticate a + * Point-To-Site VPN connection. + * + * @param {string} [connectionEnvelope.dnsServers] DNS servers to be used by + * this Virtual Network. This should be a comma-separated list of IP addresses. + * + * @param {string} [connectionEnvelope.kind] Kind of resource. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will add or update connections for the production slot. + * + * @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 {VnetInfo} - 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 VnetInfo} 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. + */ + updateVnetConnectionSlot(resourceGroupName, name, vnetName, connectionEnvelope, slot, 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._updateVnetConnectionSlot(resourceGroupName, name, vnetName, connectionEnvelope, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._updateVnetConnectionSlot(resourceGroupName, name, vnetName, connectionEnvelope, slot, options, optionalCallback); + } + } + + /** + * @summary Gets an app's Virtual Network gateway. + * + * Gets an app's Virtual Network gateway. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} vnetName Name of the Virtual Network. + * + * @param {string} gatewayName Name of the gateway. Currently, the only + * supported string is "primary". + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will get a gateway for the production slot's Virtual + * Network. + * + * @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. + */ + getVnetConnectionGatewaySlotWithHttpOperationResponse(resourceGroupName, name, vnetName, gatewayName, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._getVnetConnectionGatewaySlot(resourceGroupName, name, vnetName, gatewayName, slot, 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 an app's Virtual Network gateway. + * + * Gets an app's Virtual Network gateway. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} vnetName Name of the Virtual Network. + * + * @param {string} gatewayName Name of the gateway. Currently, the only + * supported string is "primary". + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will get a gateway for the production slot's Virtual + * Network. + * + * @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 {VnetGateway} - 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 VnetGateway} 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. + */ + getVnetConnectionGatewaySlot(resourceGroupName, name, vnetName, gatewayName, slot, 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._getVnetConnectionGatewaySlot(resourceGroupName, name, vnetName, gatewayName, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getVnetConnectionGatewaySlot(resourceGroupName, name, vnetName, gatewayName, slot, options, optionalCallback); + } + } + + /** + * @summary Adds a gateway to a connected Virtual Network (PUT) or updates it + * (PATCH). + * + * Adds a gateway to a connected Virtual Network (PUT) or updates it (PATCH). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} vnetName Name of the Virtual Network. + * + * @param {string} gatewayName Name of the gateway. Currently, the only + * supported string is "primary". + * + * @param {object} connectionEnvelope The properties to update this gateway + * with. + * + * @param {string} [connectionEnvelope.vnetName] The Virtual Network name. + * + * @param {string} connectionEnvelope.vpnPackageUri The URI where the VPN + * package can be downloaded. + * + * @param {string} [connectionEnvelope.kind] Kind of resource. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will add or update a gateway for the production slot's + * Virtual Network. + * + * @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. + */ + createOrUpdateVnetConnectionGatewaySlotWithHttpOperationResponse(resourceGroupName, name, vnetName, gatewayName, connectionEnvelope, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._createOrUpdateVnetConnectionGatewaySlot(resourceGroupName, name, vnetName, gatewayName, connectionEnvelope, slot, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Adds a gateway to a connected Virtual Network (PUT) or updates it + * (PATCH). + * + * Adds a gateway to a connected Virtual Network (PUT) or updates it (PATCH). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} vnetName Name of the Virtual Network. + * + * @param {string} gatewayName Name of the gateway. Currently, the only + * supported string is "primary". + * + * @param {object} connectionEnvelope The properties to update this gateway + * with. + * + * @param {string} [connectionEnvelope.vnetName] The Virtual Network name. + * + * @param {string} connectionEnvelope.vpnPackageUri The URI where the VPN + * package can be downloaded. + * + * @param {string} [connectionEnvelope.kind] Kind of resource. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will add or update a gateway for the production slot's + * Virtual Network. + * + * @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 {VnetGateway} - 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 VnetGateway} 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. + */ + createOrUpdateVnetConnectionGatewaySlot(resourceGroupName, name, vnetName, gatewayName, connectionEnvelope, slot, 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._createOrUpdateVnetConnectionGatewaySlot(resourceGroupName, name, vnetName, gatewayName, connectionEnvelope, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._createOrUpdateVnetConnectionGatewaySlot(resourceGroupName, name, vnetName, gatewayName, connectionEnvelope, slot, options, optionalCallback); + } + } + + /** + * @summary Adds a gateway to a connected Virtual Network (PUT) or updates it + * (PATCH). + * + * Adds a gateway to a connected Virtual Network (PUT) or updates it (PATCH). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} vnetName Name of the Virtual Network. + * + * @param {string} gatewayName Name of the gateway. Currently, the only + * supported string is "primary". + * + * @param {object} connectionEnvelope The properties to update this gateway + * with. + * + * @param {string} [connectionEnvelope.vnetName] The Virtual Network name. + * + * @param {string} connectionEnvelope.vpnPackageUri The URI where the VPN + * package can be downloaded. + * + * @param {string} [connectionEnvelope.kind] Kind of resource. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will add or update a gateway for the production slot's + * Virtual Network. + * + * @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. + */ + updateVnetConnectionGatewaySlotWithHttpOperationResponse(resourceGroupName, name, vnetName, gatewayName, connectionEnvelope, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._updateVnetConnectionGatewaySlot(resourceGroupName, name, vnetName, gatewayName, connectionEnvelope, slot, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Adds a gateway to a connected Virtual Network (PUT) or updates it + * (PATCH). + * + * Adds a gateway to a connected Virtual Network (PUT) or updates it (PATCH). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} vnetName Name of the Virtual Network. + * + * @param {string} gatewayName Name of the gateway. Currently, the only + * supported string is "primary". + * + * @param {object} connectionEnvelope The properties to update this gateway + * with. + * + * @param {string} [connectionEnvelope.vnetName] The Virtual Network name. + * + * @param {string} connectionEnvelope.vpnPackageUri The URI where the VPN + * package can be downloaded. + * + * @param {string} [connectionEnvelope.kind] Kind of resource. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will add or update a gateway for the production slot's + * Virtual Network. + * + * @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 {VnetGateway} - 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 VnetGateway} 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. + */ + updateVnetConnectionGatewaySlot(resourceGroupName, name, vnetName, gatewayName, connectionEnvelope, slot, 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._updateVnetConnectionGatewaySlot(resourceGroupName, name, vnetName, gatewayName, connectionEnvelope, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._updateVnetConnectionGatewaySlot(resourceGroupName, name, vnetName, gatewayName, connectionEnvelope, slot, options, optionalCallback); + } + } + + /** + * @summary List webjobs for an app, or a deployment slot. + * + * List webjobs for an app, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API returns deployments for the production slot. + * + * @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. + */ + listWebJobsSlotWithHttpOperationResponse(resourceGroupName, name, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listWebJobsSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary List webjobs for an app, or a deployment slot. + * + * List webjobs for an app, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API returns deployments for the production slot. + * + * @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 {WebJobCollection} - 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 WebJobCollection} 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. + */ + listWebJobsSlot(resourceGroupName, name, slot, 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._listWebJobsSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listWebJobsSlot(resourceGroupName, name, slot, options, optionalCallback); + } + } + + /** + * @summary Get webjob information for an app, or a deployment slot. + * + * Get webjob information for an app, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} webJobName Name of the web job. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API returns deployments for the production slot. + * + * @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. + */ + getWebJobSlotWithHttpOperationResponse(resourceGroupName, name, webJobName, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._getWebJobSlot(resourceGroupName, name, webJobName, slot, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Get webjob information for an app, or a deployment slot. + * + * Get webjob information for an app, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} webJobName Name of the web job. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API returns deployments for the production slot. + * + * @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 {WebJob} - 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 WebJob} 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. + */ + getWebJobSlot(resourceGroupName, name, webJobName, slot, 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._getWebJobSlot(resourceGroupName, name, webJobName, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getWebJobSlot(resourceGroupName, name, webJobName, slot, options, optionalCallback); + } + } + + /** + * @summary Get the difference in configuration settings between two web app + * slots. + * + * Get the difference in configuration settings between two web app slots. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} slotSwapEntity JSON object that contains the target slot + * name. See example. + * + * @param {string} slotSwapEntity.targetSlot Destination deployment slot during + * swap operation. + * + * @param {boolean} slotSwapEntity.preserveVnet true to preserve + * Virtual Network to the slot during swap; otherwise, false. + * + * @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. + */ + listSlotDifferencesFromProductionWithHttpOperationResponse(resourceGroupName, name, slotSwapEntity, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listSlotDifferencesFromProduction(resourceGroupName, name, slotSwapEntity, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Get the difference in configuration settings between two web app + * slots. + * + * Get the difference in configuration settings between two web app slots. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} slotSwapEntity JSON object that contains the target slot + * name. See example. + * + * @param {string} slotSwapEntity.targetSlot Destination deployment slot during + * swap operation. + * + * @param {boolean} slotSwapEntity.preserveVnet true to preserve + * Virtual Network to the slot during swap; otherwise, false. + * + * @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 {SlotDifferenceCollection} - 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 SlotDifferenceCollection} 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. + */ + listSlotDifferencesFromProduction(resourceGroupName, name, slotSwapEntity, 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._listSlotDifferencesFromProduction(resourceGroupName, name, slotSwapEntity, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listSlotDifferencesFromProduction(resourceGroupName, name, slotSwapEntity, options, optionalCallback); + } + } + + /** + * @summary Swaps two deployment slots of an app. + * + * Swaps two deployment slots of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} slotSwapEntity JSON object that contains the target slot + * name. See example. + * + * @param {string} slotSwapEntity.targetSlot Destination deployment slot during + * swap operation. + * + * @param {boolean} slotSwapEntity.preserveVnet true to preserve + * Virtual Network to the slot during swap; otherwise, false. + * + * @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. + */ + swapSlotWithProductionWithHttpOperationResponse(resourceGroupName, name, slotSwapEntity, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._swapSlotWithProduction(resourceGroupName, name, slotSwapEntity, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Swaps two deployment slots of an app. + * + * Swaps two deployment slots of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} slotSwapEntity JSON object that contains the target slot + * name. See example. + * + * @param {string} slotSwapEntity.targetSlot Destination deployment slot during + * swap operation. + * + * @param {boolean} slotSwapEntity.preserveVnet true to preserve + * Virtual Network to the slot during swap; otherwise, false. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + swapSlotWithProduction(resourceGroupName, name, slotSwapEntity, 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._swapSlotWithProduction(resourceGroupName, name, slotSwapEntity, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._swapSlotWithProduction(resourceGroupName, name, slotSwapEntity, options, optionalCallback); + } + } + + /** + * @summary Returns all Snapshots to the user. + * + * Returns all Snapshots to the user. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Website Name. + * + * @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. + */ + listSnapshotsWithHttpOperationResponse(resourceGroupName, name, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listSnapshots(resourceGroupName, name, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Returns all Snapshots to the user. + * + * Returns all Snapshots to the user. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Website Name. + * + * @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 {SnapshotCollection} - 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 SnapshotCollection} 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. + */ + listSnapshots(resourceGroupName, name, 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._listSnapshots(resourceGroupName, name, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listSnapshots(resourceGroupName, name, options, optionalCallback); + } + } + + /** + * @summary Gets the source control configuration of an app. + * + * Gets the source control configuration of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @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. + */ + getSourceControlWithHttpOperationResponse(resourceGroupName, name, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._getSourceControl(resourceGroupName, name, 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 the source control configuration of an app. + * + * Gets the source control configuration of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @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 {SiteSourceControl} - 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 SiteSourceControl} 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. + */ + getSourceControl(resourceGroupName, name, 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._getSourceControl(resourceGroupName, name, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getSourceControl(resourceGroupName, name, options, optionalCallback); + } + } + + /** + * @summary Updates the source control configuration of an app. + * + * Updates the source control configuration of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} siteSourceControl JSON representation of a SiteSourceControl + * object. See example. + * + * @param {string} [siteSourceControl.repoUrl] Repository or source control + * URL. + * + * @param {string} [siteSourceControl.branch] Name of branch to use for + * deployment. + * + * @param {boolean} [siteSourceControl.isManualIntegration] true + * to limit to manual integration; false to enable continuous + * integration (which configures webhooks into online repos like GitHub). + * + * @param {boolean} [siteSourceControl.deploymentRollbackEnabled] + * true to enable deployment rollback; otherwise, + * false. + * + * @param {boolean} [siteSourceControl.isMercurial] true for a + * Mercurial repository; false for a Git repository. + * + * @param {string} [siteSourceControl.kind] Kind of resource. + * + * @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. + */ + createOrUpdateSourceControlWithHttpOperationResponse(resourceGroupName, name, siteSourceControl, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._createOrUpdateSourceControl(resourceGroupName, name, siteSourceControl, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Updates the source control configuration of an app. + * + * Updates the source control configuration of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} siteSourceControl JSON representation of a SiteSourceControl + * object. See example. + * + * @param {string} [siteSourceControl.repoUrl] Repository or source control + * URL. + * + * @param {string} [siteSourceControl.branch] Name of branch to use for + * deployment. + * + * @param {boolean} [siteSourceControl.isManualIntegration] true + * to limit to manual integration; false to enable continuous + * integration (which configures webhooks into online repos like GitHub). + * + * @param {boolean} [siteSourceControl.deploymentRollbackEnabled] + * true to enable deployment rollback; otherwise, + * false. + * + * @param {boolean} [siteSourceControl.isMercurial] true for a + * Mercurial repository; false for a Git repository. + * + * @param {string} [siteSourceControl.kind] Kind of resource. + * + * @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 {SiteSourceControl} - 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 SiteSourceControl} 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. + */ + createOrUpdateSourceControl(resourceGroupName, name, siteSourceControl, 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._createOrUpdateSourceControl(resourceGroupName, name, siteSourceControl, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._createOrUpdateSourceControl(resourceGroupName, name, siteSourceControl, options, optionalCallback); + } + } + + /** + * @summary Deletes the source control configuration of an app. + * + * Deletes the source control configuration of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @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. + */ + deleteSourceControlWithHttpOperationResponse(resourceGroupName, name, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._deleteSourceControl(resourceGroupName, name, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Deletes the source control configuration of an app. + * + * Deletes the source control configuration of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + deleteSourceControl(resourceGroupName, name, 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._deleteSourceControl(resourceGroupName, name, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._deleteSourceControl(resourceGroupName, name, options, optionalCallback); + } + } + + /** + * @summary Updates the source control configuration of an app. + * + * Updates the source control configuration of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} siteSourceControl JSON representation of a SiteSourceControl + * object. See example. + * + * @param {string} [siteSourceControl.repoUrl] Repository or source control + * URL. + * + * @param {string} [siteSourceControl.branch] Name of branch to use for + * deployment. + * + * @param {boolean} [siteSourceControl.isManualIntegration] true + * to limit to manual integration; false to enable continuous + * integration (which configures webhooks into online repos like GitHub). + * + * @param {boolean} [siteSourceControl.deploymentRollbackEnabled] + * true to enable deployment rollback; otherwise, + * false. + * + * @param {boolean} [siteSourceControl.isMercurial] true for a + * Mercurial repository; false for a Git repository. + * + * @param {string} [siteSourceControl.kind] Kind of resource. + * + * @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. + */ + updateSourceControlWithHttpOperationResponse(resourceGroupName, name, siteSourceControl, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._updateSourceControl(resourceGroupName, name, siteSourceControl, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Updates the source control configuration of an app. + * + * Updates the source control configuration of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} siteSourceControl JSON representation of a SiteSourceControl + * object. See example. + * + * @param {string} [siteSourceControl.repoUrl] Repository or source control + * URL. + * + * @param {string} [siteSourceControl.branch] Name of branch to use for + * deployment. + * + * @param {boolean} [siteSourceControl.isManualIntegration] true + * to limit to manual integration; false to enable continuous + * integration (which configures webhooks into online repos like GitHub). + * + * @param {boolean} [siteSourceControl.deploymentRollbackEnabled] + * true to enable deployment rollback; otherwise, + * false. + * + * @param {boolean} [siteSourceControl.isMercurial] true for a + * Mercurial repository; false for a Git repository. + * + * @param {string} [siteSourceControl.kind] Kind of resource. + * + * @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 {SiteSourceControl} - 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 SiteSourceControl} 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. + */ + updateSourceControl(resourceGroupName, name, siteSourceControl, 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._updateSourceControl(resourceGroupName, name, siteSourceControl, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._updateSourceControl(resourceGroupName, name, siteSourceControl, options, optionalCallback); + } + } + + /** + * @summary Starts an app (or deployment slot, if specified). + * + * Starts an app (or deployment slot, if specified). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @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. + */ + startWithHttpOperationResponse(resourceGroupName, name, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._start(resourceGroupName, name, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Starts an app (or deployment slot, if specified). + * + * Starts an app (or deployment slot, if specified). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + start(resourceGroupName, name, 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._start(resourceGroupName, name, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._start(resourceGroupName, name, options, optionalCallback); + } + } + + /** + * @summary Stops an app (or deployment slot, if specified). + * + * Stops an app (or deployment slot, if specified). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @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. + */ + stopWithHttpOperationResponse(resourceGroupName, name, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._stop(resourceGroupName, name, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Stops an app (or deployment slot, if specified). + * + * Stops an app (or deployment slot, if specified). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + stop(resourceGroupName, name, 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._stop(resourceGroupName, name, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._stop(resourceGroupName, name, options, optionalCallback); + } + } + + /** + * @summary Sync web app repository. + * + * Sync web app repository. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @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. + */ + syncRepositoryWithHttpOperationResponse(resourceGroupName, name, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._syncRepository(resourceGroupName, name, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Sync web app repository. + * + * Sync web app repository. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + syncRepository(resourceGroupName, name, 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._syncRepository(resourceGroupName, name, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._syncRepository(resourceGroupName, name, options, optionalCallback); + } + } + + /** + * @summary Syncs function trigger metadata to the scale controller + * + * Syncs function trigger metadata to the scale controller + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @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. + */ + syncFunctionTriggersWithHttpOperationResponse(resourceGroupName, name, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._syncFunctionTriggers(resourceGroupName, name, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Syncs function trigger metadata to the scale controller + * + * Syncs function trigger metadata to the scale controller + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + syncFunctionTriggers(resourceGroupName, name, 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._syncFunctionTriggers(resourceGroupName, name, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._syncFunctionTriggers(resourceGroupName, name, options, optionalCallback); + } + } + + /** + * @summary List triggered web jobs for an app, or a deployment slot. + * + * List triggered web jobs for an app, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @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. + */ + listTriggeredWebJobsWithHttpOperationResponse(resourceGroupName, name, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listTriggeredWebJobs(resourceGroupName, name, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary List triggered web jobs for an app, or a deployment slot. + * + * List triggered web jobs for an app, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @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 {TriggeredWebJobCollection} - 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 TriggeredWebJobCollection} 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. + */ + listTriggeredWebJobs(resourceGroupName, name, 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._listTriggeredWebJobs(resourceGroupName, name, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listTriggeredWebJobs(resourceGroupName, name, options, optionalCallback); + } + } + + /** + * @summary Gets a triggered web job by its ID for an app, or a deployment + * slot. + * + * Gets a triggered web job by its ID for an app, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} webJobName Name of Web Job. + * + * @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. + */ + getTriggeredWebJobWithHttpOperationResponse(resourceGroupName, name, webJobName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._getTriggeredWebJob(resourceGroupName, name, webJobName, 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 triggered web job by its ID for an app, or a deployment + * slot. + * + * Gets a triggered web job by its ID for an app, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} webJobName Name of Web Job. + * + * @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 {TriggeredWebJob} - 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 TriggeredWebJob} 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. + */ + getTriggeredWebJob(resourceGroupName, name, webJobName, 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._getTriggeredWebJob(resourceGroupName, name, webJobName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getTriggeredWebJob(resourceGroupName, name, webJobName, options, optionalCallback); + } + } + + /** + * @summary Delete a triggered web job by its ID for an app, or a deployment + * slot. + * + * Delete a triggered web job by its ID for an app, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} webJobName Name of Web Job. + * + * @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. + */ + deleteTriggeredWebJobWithHttpOperationResponse(resourceGroupName, name, webJobName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._deleteTriggeredWebJob(resourceGroupName, name, webJobName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Delete a triggered web job by its ID for an app, or a deployment + * slot. + * + * Delete a triggered web job by its ID for an app, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} webJobName Name of Web Job. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + deleteTriggeredWebJob(resourceGroupName, name, webJobName, 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._deleteTriggeredWebJob(resourceGroupName, name, webJobName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._deleteTriggeredWebJob(resourceGroupName, name, webJobName, options, optionalCallback); + } + } + + /** + * @summary List a triggered web job's history for an app, or a deployment + * slot. + * + * List a triggered web job's history for an app, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} webJobName Name of Web Job. + * + * @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. + */ + listTriggeredWebJobHistoryWithHttpOperationResponse(resourceGroupName, name, webJobName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listTriggeredWebJobHistory(resourceGroupName, name, webJobName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary List a triggered web job's history for an app, or a deployment + * slot. + * + * List a triggered web job's history for an app, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} webJobName Name of Web Job. + * + * @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 {TriggeredJobHistoryCollection} - 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 TriggeredJobHistoryCollection} 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. + */ + listTriggeredWebJobHistory(resourceGroupName, name, webJobName, 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._listTriggeredWebJobHistory(resourceGroupName, name, webJobName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listTriggeredWebJobHistory(resourceGroupName, name, webJobName, options, optionalCallback); + } + } + + /** + * @summary Gets a triggered web job's history by its ID for an app, , or a + * deployment slot. + * + * Gets a triggered web job's history by its ID for an app, , or a deployment + * slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} webJobName Name of Web Job. + * + * @param {string} id History ID. + * + * @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. + */ + getTriggeredWebJobHistoryWithHttpOperationResponse(resourceGroupName, name, webJobName, id, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._getTriggeredWebJobHistory(resourceGroupName, name, webJobName, id, 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 triggered web job's history by its ID for an app, , or a + * deployment slot. + * + * Gets a triggered web job's history by its ID for an app, , or a deployment + * slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} webJobName Name of Web Job. + * + * @param {string} id History ID. + * + * @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 {TriggeredJobHistory} - 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 TriggeredJobHistory} 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. + */ + getTriggeredWebJobHistory(resourceGroupName, name, webJobName, id, 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._getTriggeredWebJobHistory(resourceGroupName, name, webJobName, id, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getTriggeredWebJobHistory(resourceGroupName, name, webJobName, id, options, optionalCallback); + } + } + + /** + * @summary Run a triggered web job for an app, or a deployment slot. + * + * Run a triggered web job for an app, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} webJobName Name of Web Job. + * + * @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. + */ + runTriggeredWebJobWithHttpOperationResponse(resourceGroupName, name, webJobName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._runTriggeredWebJob(resourceGroupName, name, webJobName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Run a triggered web job for an app, or a deployment slot. + * + * Run a triggered web job for an app, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} webJobName Name of Web Job. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + runTriggeredWebJob(resourceGroupName, name, webJobName, 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._runTriggeredWebJob(resourceGroupName, name, webJobName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._runTriggeredWebJob(resourceGroupName, name, webJobName, options, optionalCallback); + } + } + + /** + * @summary Gets the quota usage information of an app (or deployment slot, if + * specified). + * + * Gets the quota usage information of an app (or deployment slot, if + * specified). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.filter] Return only information specified in the + * filter (using OData syntax). For example: $filter=(name.value eq 'Metric1' + * or name.value eq 'Metric2') and startTime eq 2014-01-01T00:00:00Z and + * endTime eq 2014-12-31T23:59:59Z and timeGrain eq + * duration'[Hour|Minute|Day]'. + * + * @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. + */ + listUsagesWithHttpOperationResponse(resourceGroupName, name, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listUsages(resourceGroupName, name, 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 the quota usage information of an app (or deployment slot, if + * specified). + * + * Gets the quota usage information of an app (or deployment slot, if + * specified). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.filter] Return only information specified in the + * filter (using OData syntax). For example: $filter=(name.value eq 'Metric1' + * or name.value eq 'Metric2') and startTime eq 2014-01-01T00:00:00Z and + * endTime eq 2014-12-31T23:59:59Z and timeGrain eq + * duration'[Hour|Minute|Day]'. + * + * @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 {CsmUsageQuotaCollection} - 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 CsmUsageQuotaCollection} 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. + */ + listUsages(resourceGroupName, name, 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._listUsages(resourceGroupName, name, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listUsages(resourceGroupName, name, options, optionalCallback); + } + } + + /** + * @summary Gets the virtual networks the app (or deployment slot) is connected + * to. + * + * Gets the virtual networks the app (or deployment slot) is connected to. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @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. + */ + listVnetConnectionsWithHttpOperationResponse(resourceGroupName, name, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listVnetConnections(resourceGroupName, name, 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 the virtual networks the app (or deployment slot) is connected + * to. + * + * Gets the virtual networks the app (or deployment slot) is connected to. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @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 {Array} - 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. + * + * {array} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listVnetConnections(resourceGroupName, name, 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._listVnetConnections(resourceGroupName, name, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listVnetConnections(resourceGroupName, name, options, optionalCallback); + } + } + + /** + * @summary Gets a virtual network the app (or deployment slot) is connected to + * by name. + * + * Gets a virtual network the app (or deployment slot) is connected to by name. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} vnetName Name of the virtual network. + * + * @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. + */ + getVnetConnectionWithHttpOperationResponse(resourceGroupName, name, vnetName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._getVnetConnection(resourceGroupName, name, vnetName, 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 virtual network the app (or deployment slot) is connected to + * by name. + * + * Gets a virtual network the app (or deployment slot) is connected to by name. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} vnetName Name of the virtual network. + * + * @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 {VnetInfo} - 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 VnetInfo} 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. + */ + getVnetConnection(resourceGroupName, name, vnetName, 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._getVnetConnection(resourceGroupName, name, vnetName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getVnetConnection(resourceGroupName, name, vnetName, options, optionalCallback); + } + } + + /** + * @summary Adds a Virtual Network connection to an app or slot (PUT) or + * updates the connection properties (PATCH). + * + * Adds a Virtual Network connection to an app or slot (PUT) or updates the + * connection properties (PATCH). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} vnetName Name of an existing Virtual Network. + * + * @param {object} connectionEnvelope Properties of the Virtual Network + * connection. See example. + * + * @param {string} [connectionEnvelope.vnetResourceId] The Virtual Network's + * resource ID. + * + * @param {buffer} [connectionEnvelope.certBlob] A certificate file (.cer) blob + * containing the public key of the private key used to authenticate a + * Point-To-Site VPN connection. + * + * @param {string} [connectionEnvelope.dnsServers] DNS servers to be used by + * this Virtual Network. This should be a comma-separated list of IP addresses. + * + * @param {string} [connectionEnvelope.kind] Kind of resource. + * + * @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. + */ + createOrUpdateVnetConnectionWithHttpOperationResponse(resourceGroupName, name, vnetName, connectionEnvelope, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._createOrUpdateVnetConnection(resourceGroupName, name, vnetName, connectionEnvelope, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Adds a Virtual Network connection to an app or slot (PUT) or + * updates the connection properties (PATCH). + * + * Adds a Virtual Network connection to an app or slot (PUT) or updates the + * connection properties (PATCH). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} vnetName Name of an existing Virtual Network. + * + * @param {object} connectionEnvelope Properties of the Virtual Network + * connection. See example. + * + * @param {string} [connectionEnvelope.vnetResourceId] The Virtual Network's + * resource ID. + * + * @param {buffer} [connectionEnvelope.certBlob] A certificate file (.cer) blob + * containing the public key of the private key used to authenticate a + * Point-To-Site VPN connection. + * + * @param {string} [connectionEnvelope.dnsServers] DNS servers to be used by + * this Virtual Network. This should be a comma-separated list of IP addresses. + * + * @param {string} [connectionEnvelope.kind] Kind of resource. + * + * @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 {VnetInfo} - 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 VnetInfo} 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. + */ + createOrUpdateVnetConnection(resourceGroupName, name, vnetName, connectionEnvelope, 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._createOrUpdateVnetConnection(resourceGroupName, name, vnetName, connectionEnvelope, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._createOrUpdateVnetConnection(resourceGroupName, name, vnetName, connectionEnvelope, options, optionalCallback); + } + } + + /** + * @summary Deletes a connection from an app (or deployment slot to a named + * virtual network. + * + * Deletes a connection from an app (or deployment slot to a named virtual + * network. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} vnetName Name of the virtual network. + * + * @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. + */ + deleteVnetConnectionWithHttpOperationResponse(resourceGroupName, name, vnetName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._deleteVnetConnection(resourceGroupName, name, vnetName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Deletes a connection from an app (or deployment slot to a named + * virtual network. + * + * Deletes a connection from an app (or deployment slot to a named virtual + * network. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} vnetName Name of the virtual network. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + deleteVnetConnection(resourceGroupName, name, vnetName, 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._deleteVnetConnection(resourceGroupName, name, vnetName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._deleteVnetConnection(resourceGroupName, name, vnetName, options, optionalCallback); + } + } + + /** + * @summary Adds a Virtual Network connection to an app or slot (PUT) or + * updates the connection properties (PATCH). + * + * Adds a Virtual Network connection to an app or slot (PUT) or updates the + * connection properties (PATCH). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} vnetName Name of an existing Virtual Network. + * + * @param {object} connectionEnvelope Properties of the Virtual Network + * connection. See example. + * + * @param {string} [connectionEnvelope.vnetResourceId] The Virtual Network's + * resource ID. + * + * @param {buffer} [connectionEnvelope.certBlob] A certificate file (.cer) blob + * containing the public key of the private key used to authenticate a + * Point-To-Site VPN connection. + * + * @param {string} [connectionEnvelope.dnsServers] DNS servers to be used by + * this Virtual Network. This should be a comma-separated list of IP addresses. + * + * @param {string} [connectionEnvelope.kind] Kind of resource. + * + * @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. + */ + updateVnetConnectionWithHttpOperationResponse(resourceGroupName, name, vnetName, connectionEnvelope, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._updateVnetConnection(resourceGroupName, name, vnetName, connectionEnvelope, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Adds a Virtual Network connection to an app or slot (PUT) or + * updates the connection properties (PATCH). + * + * Adds a Virtual Network connection to an app or slot (PUT) or updates the + * connection properties (PATCH). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} vnetName Name of an existing Virtual Network. + * + * @param {object} connectionEnvelope Properties of the Virtual Network + * connection. See example. + * + * @param {string} [connectionEnvelope.vnetResourceId] The Virtual Network's + * resource ID. + * + * @param {buffer} [connectionEnvelope.certBlob] A certificate file (.cer) blob + * containing the public key of the private key used to authenticate a + * Point-To-Site VPN connection. + * + * @param {string} [connectionEnvelope.dnsServers] DNS servers to be used by + * this Virtual Network. This should be a comma-separated list of IP addresses. + * + * @param {string} [connectionEnvelope.kind] Kind of resource. + * + * @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 {VnetInfo} - 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 VnetInfo} 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. + */ + updateVnetConnection(resourceGroupName, name, vnetName, connectionEnvelope, 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._updateVnetConnection(resourceGroupName, name, vnetName, connectionEnvelope, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._updateVnetConnection(resourceGroupName, name, vnetName, connectionEnvelope, options, optionalCallback); + } + } + + /** + * @summary Gets an app's Virtual Network gateway. + * + * Gets an app's Virtual Network gateway. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} vnetName Name of the Virtual Network. + * + * @param {string} gatewayName Name of the gateway. Currently, the only + * supported string is "primary". + * + * @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. + */ + getVnetConnectionGatewayWithHttpOperationResponse(resourceGroupName, name, vnetName, gatewayName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._getVnetConnectionGateway(resourceGroupName, name, vnetName, gatewayName, 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 an app's Virtual Network gateway. + * + * Gets an app's Virtual Network gateway. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} vnetName Name of the Virtual Network. + * + * @param {string} gatewayName Name of the gateway. Currently, the only + * supported string is "primary". + * + * @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 {VnetGateway} - 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 VnetGateway} 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. + */ + getVnetConnectionGateway(resourceGroupName, name, vnetName, gatewayName, 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._getVnetConnectionGateway(resourceGroupName, name, vnetName, gatewayName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getVnetConnectionGateway(resourceGroupName, name, vnetName, gatewayName, options, optionalCallback); + } + } + + /** + * @summary Adds a gateway to a connected Virtual Network (PUT) or updates it + * (PATCH). + * + * Adds a gateway to a connected Virtual Network (PUT) or updates it (PATCH). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} vnetName Name of the Virtual Network. + * + * @param {string} gatewayName Name of the gateway. Currently, the only + * supported string is "primary". + * + * @param {object} connectionEnvelope The properties to update this gateway + * with. + * + * @param {string} [connectionEnvelope.vnetName] The Virtual Network name. + * + * @param {string} connectionEnvelope.vpnPackageUri The URI where the VPN + * package can be downloaded. + * + * @param {string} [connectionEnvelope.kind] Kind of resource. + * + * @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. + */ + createOrUpdateVnetConnectionGatewayWithHttpOperationResponse(resourceGroupName, name, vnetName, gatewayName, connectionEnvelope, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._createOrUpdateVnetConnectionGateway(resourceGroupName, name, vnetName, gatewayName, connectionEnvelope, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Adds a gateway to a connected Virtual Network (PUT) or updates it + * (PATCH). + * + * Adds a gateway to a connected Virtual Network (PUT) or updates it (PATCH). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} vnetName Name of the Virtual Network. + * + * @param {string} gatewayName Name of the gateway. Currently, the only + * supported string is "primary". + * + * @param {object} connectionEnvelope The properties to update this gateway + * with. + * + * @param {string} [connectionEnvelope.vnetName] The Virtual Network name. + * + * @param {string} connectionEnvelope.vpnPackageUri The URI where the VPN + * package can be downloaded. + * + * @param {string} [connectionEnvelope.kind] Kind of resource. + * + * @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 {VnetGateway} - 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 VnetGateway} 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. + */ + createOrUpdateVnetConnectionGateway(resourceGroupName, name, vnetName, gatewayName, connectionEnvelope, 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._createOrUpdateVnetConnectionGateway(resourceGroupName, name, vnetName, gatewayName, connectionEnvelope, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._createOrUpdateVnetConnectionGateway(resourceGroupName, name, vnetName, gatewayName, connectionEnvelope, options, optionalCallback); + } + } + + /** + * @summary Adds a gateway to a connected Virtual Network (PUT) or updates it + * (PATCH). + * + * Adds a gateway to a connected Virtual Network (PUT) or updates it (PATCH). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} vnetName Name of the Virtual Network. + * + * @param {string} gatewayName Name of the gateway. Currently, the only + * supported string is "primary". + * + * @param {object} connectionEnvelope The properties to update this gateway + * with. + * + * @param {string} [connectionEnvelope.vnetName] The Virtual Network name. + * + * @param {string} connectionEnvelope.vpnPackageUri The URI where the VPN + * package can be downloaded. + * + * @param {string} [connectionEnvelope.kind] Kind of resource. + * + * @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. + */ + updateVnetConnectionGatewayWithHttpOperationResponse(resourceGroupName, name, vnetName, gatewayName, connectionEnvelope, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._updateVnetConnectionGateway(resourceGroupName, name, vnetName, gatewayName, connectionEnvelope, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Adds a gateway to a connected Virtual Network (PUT) or updates it + * (PATCH). + * + * Adds a gateway to a connected Virtual Network (PUT) or updates it (PATCH). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} vnetName Name of the Virtual Network. + * + * @param {string} gatewayName Name of the gateway. Currently, the only + * supported string is "primary". + * + * @param {object} connectionEnvelope The properties to update this gateway + * with. + * + * @param {string} [connectionEnvelope.vnetName] The Virtual Network name. + * + * @param {string} connectionEnvelope.vpnPackageUri The URI where the VPN + * package can be downloaded. + * + * @param {string} [connectionEnvelope.kind] Kind of resource. + * + * @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 {VnetGateway} - 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 VnetGateway} 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. + */ + updateVnetConnectionGateway(resourceGroupName, name, vnetName, gatewayName, connectionEnvelope, 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._updateVnetConnectionGateway(resourceGroupName, name, vnetName, gatewayName, connectionEnvelope, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._updateVnetConnectionGateway(resourceGroupName, name, vnetName, gatewayName, connectionEnvelope, options, optionalCallback); + } + } + + /** + * @summary List webjobs for an app, or a deployment slot. + * + * List webjobs for an app, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @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. + */ + listWebJobsWithHttpOperationResponse(resourceGroupName, name, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listWebJobs(resourceGroupName, name, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary List webjobs for an app, or a deployment slot. + * + * List webjobs for an app, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @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 {WebJobCollection} - 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 WebJobCollection} 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. + */ + listWebJobs(resourceGroupName, name, 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._listWebJobs(resourceGroupName, name, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listWebJobs(resourceGroupName, name, options, optionalCallback); + } + } + + /** + * @summary Get webjob information for an app, or a deployment slot. + * + * Get webjob information for an app, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} webJobName Name of the web job. + * + * @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. + */ + getWebJobWithHttpOperationResponse(resourceGroupName, name, webJobName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._getWebJob(resourceGroupName, name, webJobName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Get webjob information for an app, or a deployment slot. + * + * Get webjob information for an app, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} webJobName Name of the web job. + * + * @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 {WebJob} - 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 WebJob} 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. + */ + getWebJob(resourceGroupName, name, webJobName, 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._getWebJob(resourceGroupName, name, webJobName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getWebJob(resourceGroupName, name, webJobName, options, optionalCallback); + } + } + + /** + * @summary Creates a new web, mobile, or API app in an existing resource + * group, or updates an existing app. + * + * Creates a new web, mobile, or API app in an existing resource group, or + * updates an existing app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Unique name of the app to create or update. To create + * or update a deployment slot, use the {slot} parameter. + * + * @param {object} siteEnvelope A JSON representation of the app properties. + * See example. + * + * @param {boolean} [siteEnvelope.enabled] true if the app is + * enabled; otherwise, false. Setting this value to false disables + * the app (takes the app offline). + * + * @param {array} [siteEnvelope.hostNameSslStates] Hostname SSL states are used + * to manage the SSL bindings for app's hostnames. + * + * @param {string} [siteEnvelope.serverFarmId] Resource ID of the associated + * App Service plan, formatted as: + * "/subscriptions/{subscriptionID}/resourceGroups/{groupName}/providers/Microsoft.Web/serverfarms/{appServicePlanName}". + * + * @param {boolean} [siteEnvelope.reserved] true if reserved; + * otherwise, false. + * + * @param {boolean} [siteEnvelope.isXenon] Obsolete: Hyper-V sandbox. + * + * @param {boolean} [siteEnvelope.hyperV] Hyper-V sandbox. + * + * @param {object} [siteEnvelope.siteConfig] Configuration of the app. + * + * @param {number} [siteEnvelope.siteConfig.numberOfWorkers] Number of workers. + * + * @param {array} [siteEnvelope.siteConfig.defaultDocuments] Default documents. + * + * @param {string} [siteEnvelope.siteConfig.netFrameworkVersion] .NET Framework + * version. + * + * @param {string} [siteEnvelope.siteConfig.phpVersion] Version of PHP. + * + * @param {string} [siteEnvelope.siteConfig.pythonVersion] Version of Python. + * + * @param {string} [siteEnvelope.siteConfig.nodeVersion] Version of Node.js. + * + * @param {string} [siteEnvelope.siteConfig.linuxFxVersion] Linux App Framework + * and version + * + * @param {string} [siteEnvelope.siteConfig.windowsFxVersion] Xenon App + * Framework and version + * + * @param {boolean} [siteEnvelope.siteConfig.requestTracingEnabled] + * true if request tracing is enabled; otherwise, + * false. + * + * @param {date} [siteEnvelope.siteConfig.requestTracingExpirationTime] Request + * tracing expiration time. + * + * @param {boolean} [siteEnvelope.siteConfig.remoteDebuggingEnabled] + * true if remote debugging is enabled; otherwise, + * false. + * + * @param {string} [siteEnvelope.siteConfig.remoteDebuggingVersion] Remote + * debugging version. + * + * @param {boolean} [siteEnvelope.siteConfig.httpLoggingEnabled] + * true if HTTP logging is enabled; otherwise, false. + * + * @param {number} [siteEnvelope.siteConfig.logsDirectorySizeLimit] HTTP logs + * directory size limit. + * + * @param {boolean} [siteEnvelope.siteConfig.detailedErrorLoggingEnabled] + * true if detailed error logging is enabled; otherwise, + * false. + * + * @param {string} [siteEnvelope.siteConfig.publishingUsername] Publishing user + * name. + * + * @param {array} [siteEnvelope.siteConfig.appSettings] Application settings. + * + * @param {object} [siteEnvelope.siteConfig.azureStorageAccounts] User-provided + * Azure storage accounts. + * + * @param {array} [siteEnvelope.siteConfig.connectionStrings] Connection + * strings. + * + * @param {array} [siteEnvelope.siteConfig.handlerMappings] Handler mappings. + * + * @param {string} [siteEnvelope.siteConfig.documentRoot] Document root. + * + * @param {string} [siteEnvelope.siteConfig.scmType] SCM type. Possible values + * include: 'None', 'Dropbox', 'Tfs', 'LocalGit', 'GitHub', 'CodePlexGit', + * 'CodePlexHg', 'BitbucketGit', 'BitbucketHg', 'ExternalGit', 'ExternalHg', + * 'OneDrive', 'VSO' + * + * @param {boolean} [siteEnvelope.siteConfig.use32BitWorkerProcess] + * true to use 32-bit worker process; otherwise, + * false. + * + * @param {boolean} [siteEnvelope.siteConfig.webSocketsEnabled] + * true if WebSocket is enabled; otherwise, false. + * + * @param {boolean} [siteEnvelope.siteConfig.alwaysOn] true if + * Always On is enabled; otherwise, false. + * + * @param {string} [siteEnvelope.siteConfig.javaVersion] Java version. + * + * @param {string} [siteEnvelope.siteConfig.javaContainer] Java container. + * + * @param {string} [siteEnvelope.siteConfig.javaContainerVersion] Java + * container version. + * + * @param {string} [siteEnvelope.siteConfig.appCommandLine] App command line to + * launch. + * + * @param {string} [siteEnvelope.siteConfig.managedPipelineMode] Managed + * pipeline mode. Possible values include: 'Integrated', 'Classic' + * + * @param {array} [siteEnvelope.siteConfig.virtualApplications] Virtual + * applications. + * + * @param {string} [siteEnvelope.siteConfig.loadBalancing] Site load balancing. + * Possible values include: 'WeightedRoundRobin', 'LeastRequests', + * 'LeastResponseTime', 'WeightedTotalTraffic', 'RequestHash' + * + * @param {object} [siteEnvelope.siteConfig.experiments] This is work around + * for polymophic types. + * + * @param {array} [siteEnvelope.siteConfig.experiments.rampUpRules] List of + * ramp-up rules. + * + * @param {object} [siteEnvelope.siteConfig.limits] Site limits. + * + * @param {number} [siteEnvelope.siteConfig.limits.maxPercentageCpu] Maximum + * allowed CPU usage percentage. + * + * @param {number} [siteEnvelope.siteConfig.limits.maxMemoryInMb] Maximum + * allowed memory usage in MB. + * + * @param {number} [siteEnvelope.siteConfig.limits.maxDiskSizeInMb] Maximum + * allowed disk size usage in MB. + * + * @param {boolean} [siteEnvelope.siteConfig.autoHealEnabled] true + * if Auto Heal is enabled; otherwise, false. + * + * @param {object} [siteEnvelope.siteConfig.autoHealRules] Auto Heal rules. + * + * @param {object} [siteEnvelope.siteConfig.autoHealRules.triggers] Conditions + * that describe when to execute the auto-heal actions. + * + * @param {object} [siteEnvelope.siteConfig.autoHealRules.triggers.requests] A + * rule based on total requests. + * + * @param {number} + * [siteEnvelope.siteConfig.autoHealRules.triggers.requests.count] Request + * Count. + * + * @param {string} + * [siteEnvelope.siteConfig.autoHealRules.triggers.requests.timeInterval] Time + * interval. + * + * @param {number} + * [siteEnvelope.siteConfig.autoHealRules.triggers.privateBytesInKB] A rule + * based on private bytes. + * + * @param {array} [siteEnvelope.siteConfig.autoHealRules.triggers.statusCodes] + * A rule based on status codes. + * + * @param {object} + * [siteEnvelope.siteConfig.autoHealRules.triggers.slowRequests] A rule based + * on request execution time. + * + * @param {string} + * [siteEnvelope.siteConfig.autoHealRules.triggers.slowRequests.timeTaken] Time + * taken. + * + * @param {number} + * [siteEnvelope.siteConfig.autoHealRules.triggers.slowRequests.count] Request + * Count. + * + * @param {string} + * [siteEnvelope.siteConfig.autoHealRules.triggers.slowRequests.timeInterval] + * Time interval. + * + * @param {object} [siteEnvelope.siteConfig.autoHealRules.actions] Actions to + * be executed when a rule is triggered. + * + * @param {string} [siteEnvelope.siteConfig.autoHealRules.actions.actionType] + * Predefined action to be taken. Possible values include: 'Recycle', + * 'LogEvent', 'CustomAction' + * + * @param {object} [siteEnvelope.siteConfig.autoHealRules.actions.customAction] + * Custom action to be taken. + * + * @param {string} + * [siteEnvelope.siteConfig.autoHealRules.actions.customAction.exe] Executable + * to be run. + * + * @param {string} + * [siteEnvelope.siteConfig.autoHealRules.actions.customAction.parameters] + * Parameters for the executable. + * + * @param {string} + * [siteEnvelope.siteConfig.autoHealRules.actions.minProcessExecutionTime] + * Minimum time the process must execute + * before taking the action + * + * @param {string} [siteEnvelope.siteConfig.tracingOptions] Tracing options. + * + * @param {string} [siteEnvelope.siteConfig.vnetName] Virtual Network name. + * + * @param {object} [siteEnvelope.siteConfig.cors] Cross-Origin Resource Sharing + * (CORS) settings. + * + * @param {array} [siteEnvelope.siteConfig.cors.allowedOrigins] Gets or sets + * the list of origins that should be allowed to make cross-origin + * calls (for example: http://example.com:12345). Use "*" to allow all. + * + * @param {object} [siteEnvelope.siteConfig.push] Push endpoint settings. + * + * @param {boolean} siteEnvelope.siteConfig.push.isPushEnabled Gets or sets a + * flag indicating whether the Push endpoint is enabled. + * + * @param {string} [siteEnvelope.siteConfig.push.tagWhitelistJson] Gets or sets + * a JSON string containing a list of tags that are whitelisted for use by the + * push registration endpoint. + * + * @param {string} [siteEnvelope.siteConfig.push.tagsRequiringAuth] Gets or + * sets a JSON string containing a list of tags that require user + * authentication to be used in the push registration endpoint. + * Tags can consist of alphanumeric characters and the following: + * '_', '@', '#', '.', ':', '-'. + * Validation should be performed at the PushRequestHandler. + * + * @param {string} [siteEnvelope.siteConfig.push.dynamicTagsJson] Gets or sets + * a JSON string containing a list of dynamic tags that will be evaluated from + * user claims in the push registration endpoint. + * + * @param {string} [siteEnvelope.siteConfig.push.kind] Kind of resource. + * + * @param {object} [siteEnvelope.siteConfig.apiDefinition] Information about + * the formal API definition for the app. + * + * @param {string} [siteEnvelope.siteConfig.apiDefinition.url] The URL of the + * API definition. + * + * @param {string} [siteEnvelope.siteConfig.autoSwapSlotName] Auto-swap slot + * name. + * + * @param {boolean} [siteEnvelope.siteConfig.localMySqlEnabled] + * true to enable local MySQL; otherwise, false. + * + * @param {number} [siteEnvelope.siteConfig.managedServiceIdentityId] Managed + * Service Identity Id + * + * @param {number} [siteEnvelope.siteConfig.xManagedServiceIdentityId] Explicit + * Managed Service Identity Id + * + * @param {array} [siteEnvelope.siteConfig.ipSecurityRestrictions] IP security + * restrictions. + * + * @param {boolean} [siteEnvelope.siteConfig.http20Enabled] Http20Enabled: + * configures a web site to allow clients to connect over http2.0 + * + * @param {string} [siteEnvelope.siteConfig.minTlsVersion] MinTlsVersion: + * configures the minimum version of TLS required for SSL requests. Possible + * values include: '1.0', '1.1', '1.2' + * + * @param {string} [siteEnvelope.siteConfig.ftpsState] State of FTP / FTPS + * service. Possible values include: 'AllAllowed', 'FtpsOnly', 'Disabled' + * + * @param {number} [siteEnvelope.siteConfig.reservedInstanceCount] Number of + * reserved instances. + * This setting only applies to the Consumption Plan + * + * @param {boolean} [siteEnvelope.scmSiteAlsoStopped] true to stop + * SCM (KUDU) site when the app is stopped; otherwise, false. The + * default is false. + * + * @param {object} [siteEnvelope.hostingEnvironmentProfile] App Service + * Environment to use for the app. + * + * @param {string} [siteEnvelope.hostingEnvironmentProfile.id] Resource ID of + * the App Service Environment. + * + * @param {boolean} [siteEnvelope.clientAffinityEnabled] true to + * enable client affinity; false to stop sending session affinity + * cookies, which route client requests in the same session to the same + * instance. Default is true. + * + * @param {boolean} [siteEnvelope.clientCertEnabled] true to + * enable client certificate authentication (TLS mutual authentication); + * otherwise, false. Default is false. + * + * @param {boolean} [siteEnvelope.hostNamesDisabled] true to + * disable the public hostnames of the app; otherwise, false. + * If true, the app is only accessible via API management process. + * + * @param {number} [siteEnvelope.containerSize] Size of the function container. + * + * @param {number} [siteEnvelope.dailyMemoryTimeQuota] Maximum allowed daily + * memory-time quota (applicable on dynamic apps only). + * + * @param {object} [siteEnvelope.cloningInfo] If specified during app creation, + * the app is cloned from a source app. + * + * @param {uuid} [siteEnvelope.cloningInfo.correlationId] Correlation ID of + * cloning operation. This ID ties multiple cloning operations + * together to use the same snapshot. + * + * @param {boolean} [siteEnvelope.cloningInfo.overwrite] true to + * overwrite destination app; otherwise, false. + * + * @param {boolean} [siteEnvelope.cloningInfo.cloneCustomHostNames] + * true to clone custom hostnames from source app; otherwise, + * false. + * + * @param {boolean} [siteEnvelope.cloningInfo.cloneSourceControl] + * true to clone source control from source app; otherwise, + * false. + * + * @param {string} siteEnvelope.cloningInfo.sourceWebAppId ARM resource ID of + * the source app. App resource ID is of the form + * /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName} + * for production slots and + * /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/slots/{slotName} + * for other slots. + * + * @param {string} [siteEnvelope.cloningInfo.hostingEnvironment] App Service + * Environment. + * + * @param {object} [siteEnvelope.cloningInfo.appSettingsOverrides] Application + * setting overrides for cloned app. If specified, these settings override the + * settings cloned + * from source app. Otherwise, application settings from source app are + * retained. + * + * @param {boolean} [siteEnvelope.cloningInfo.configureLoadBalancing] + * true to configure load balancing for source and destination + * app. + * + * @param {string} [siteEnvelope.cloningInfo.trafficManagerProfileId] ARM + * resource ID of the Traffic Manager profile to use, if it exists. Traffic + * Manager resource ID is of the form + * /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/trafficManagerProfiles/{profileName}. + * + * @param {string} [siteEnvelope.cloningInfo.trafficManagerProfileName] Name of + * Traffic Manager profile to create. This is only needed if Traffic Manager + * profile does not already exist. + * + * @param {boolean} [siteEnvelope.httpsOnly] HttpsOnly: configures a web site + * to accept only https requests. Issues redirect for + * http requests + * + * @param {object} [siteEnvelope.identity] + * + * @param {string} [siteEnvelope.identity.type] Type of managed service + * identity. Possible values include: 'SystemAssigned', 'UserAssigned' + * + * @param {array} [siteEnvelope.identity.identityIds] Array of UserAssigned + * managed service identities. + * + * @param {string} [siteEnvelope.kind] Kind of resource. + * + * @param {string} siteEnvelope.location Resource Location. + * + * @param {object} [siteEnvelope.tags] Resource tags. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName, name, siteEnvelope, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginCreateOrUpdate(resourceGroupName, name, siteEnvelope, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Creates a new web, mobile, or API app in an existing resource + * group, or updates an existing app. + * + * Creates a new web, mobile, or API app in an existing resource group, or + * updates an existing app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Unique name of the app to create or update. To create + * or update a deployment slot, use the {slot} parameter. + * + * @param {object} siteEnvelope A JSON representation of the app properties. + * See example. + * + * @param {boolean} [siteEnvelope.enabled] true if the app is + * enabled; otherwise, false. Setting this value to false disables + * the app (takes the app offline). + * + * @param {array} [siteEnvelope.hostNameSslStates] Hostname SSL states are used + * to manage the SSL bindings for app's hostnames. + * + * @param {string} [siteEnvelope.serverFarmId] Resource ID of the associated + * App Service plan, formatted as: + * "/subscriptions/{subscriptionID}/resourceGroups/{groupName}/providers/Microsoft.Web/serverfarms/{appServicePlanName}". + * + * @param {boolean} [siteEnvelope.reserved] true if reserved; + * otherwise, false. + * + * @param {boolean} [siteEnvelope.isXenon] Obsolete: Hyper-V sandbox. + * + * @param {boolean} [siteEnvelope.hyperV] Hyper-V sandbox. + * + * @param {object} [siteEnvelope.siteConfig] Configuration of the app. + * + * @param {number} [siteEnvelope.siteConfig.numberOfWorkers] Number of workers. + * + * @param {array} [siteEnvelope.siteConfig.defaultDocuments] Default documents. + * + * @param {string} [siteEnvelope.siteConfig.netFrameworkVersion] .NET Framework + * version. + * + * @param {string} [siteEnvelope.siteConfig.phpVersion] Version of PHP. + * + * @param {string} [siteEnvelope.siteConfig.pythonVersion] Version of Python. + * + * @param {string} [siteEnvelope.siteConfig.nodeVersion] Version of Node.js. + * + * @param {string} [siteEnvelope.siteConfig.linuxFxVersion] Linux App Framework + * and version + * + * @param {string} [siteEnvelope.siteConfig.windowsFxVersion] Xenon App + * Framework and version + * + * @param {boolean} [siteEnvelope.siteConfig.requestTracingEnabled] + * true if request tracing is enabled; otherwise, + * false. + * + * @param {date} [siteEnvelope.siteConfig.requestTracingExpirationTime] Request + * tracing expiration time. + * + * @param {boolean} [siteEnvelope.siteConfig.remoteDebuggingEnabled] + * true if remote debugging is enabled; otherwise, + * false. + * + * @param {string} [siteEnvelope.siteConfig.remoteDebuggingVersion] Remote + * debugging version. + * + * @param {boolean} [siteEnvelope.siteConfig.httpLoggingEnabled] + * true if HTTP logging is enabled; otherwise, false. + * + * @param {number} [siteEnvelope.siteConfig.logsDirectorySizeLimit] HTTP logs + * directory size limit. + * + * @param {boolean} [siteEnvelope.siteConfig.detailedErrorLoggingEnabled] + * true if detailed error logging is enabled; otherwise, + * false. + * + * @param {string} [siteEnvelope.siteConfig.publishingUsername] Publishing user + * name. + * + * @param {array} [siteEnvelope.siteConfig.appSettings] Application settings. + * + * @param {object} [siteEnvelope.siteConfig.azureStorageAccounts] User-provided + * Azure storage accounts. + * + * @param {array} [siteEnvelope.siteConfig.connectionStrings] Connection + * strings. + * + * @param {array} [siteEnvelope.siteConfig.handlerMappings] Handler mappings. + * + * @param {string} [siteEnvelope.siteConfig.documentRoot] Document root. + * + * @param {string} [siteEnvelope.siteConfig.scmType] SCM type. Possible values + * include: 'None', 'Dropbox', 'Tfs', 'LocalGit', 'GitHub', 'CodePlexGit', + * 'CodePlexHg', 'BitbucketGit', 'BitbucketHg', 'ExternalGit', 'ExternalHg', + * 'OneDrive', 'VSO' + * + * @param {boolean} [siteEnvelope.siteConfig.use32BitWorkerProcess] + * true to use 32-bit worker process; otherwise, + * false. + * + * @param {boolean} [siteEnvelope.siteConfig.webSocketsEnabled] + * true if WebSocket is enabled; otherwise, false. + * + * @param {boolean} [siteEnvelope.siteConfig.alwaysOn] true if + * Always On is enabled; otherwise, false. + * + * @param {string} [siteEnvelope.siteConfig.javaVersion] Java version. + * + * @param {string} [siteEnvelope.siteConfig.javaContainer] Java container. + * + * @param {string} [siteEnvelope.siteConfig.javaContainerVersion] Java + * container version. + * + * @param {string} [siteEnvelope.siteConfig.appCommandLine] App command line to + * launch. + * + * @param {string} [siteEnvelope.siteConfig.managedPipelineMode] Managed + * pipeline mode. Possible values include: 'Integrated', 'Classic' + * + * @param {array} [siteEnvelope.siteConfig.virtualApplications] Virtual + * applications. + * + * @param {string} [siteEnvelope.siteConfig.loadBalancing] Site load balancing. + * Possible values include: 'WeightedRoundRobin', 'LeastRequests', + * 'LeastResponseTime', 'WeightedTotalTraffic', 'RequestHash' + * + * @param {object} [siteEnvelope.siteConfig.experiments] This is work around + * for polymophic types. + * + * @param {array} [siteEnvelope.siteConfig.experiments.rampUpRules] List of + * ramp-up rules. + * + * @param {object} [siteEnvelope.siteConfig.limits] Site limits. + * + * @param {number} [siteEnvelope.siteConfig.limits.maxPercentageCpu] Maximum + * allowed CPU usage percentage. + * + * @param {number} [siteEnvelope.siteConfig.limits.maxMemoryInMb] Maximum + * allowed memory usage in MB. + * + * @param {number} [siteEnvelope.siteConfig.limits.maxDiskSizeInMb] Maximum + * allowed disk size usage in MB. + * + * @param {boolean} [siteEnvelope.siteConfig.autoHealEnabled] true + * if Auto Heal is enabled; otherwise, false. + * + * @param {object} [siteEnvelope.siteConfig.autoHealRules] Auto Heal rules. + * + * @param {object} [siteEnvelope.siteConfig.autoHealRules.triggers] Conditions + * that describe when to execute the auto-heal actions. + * + * @param {object} [siteEnvelope.siteConfig.autoHealRules.triggers.requests] A + * rule based on total requests. + * + * @param {number} + * [siteEnvelope.siteConfig.autoHealRules.triggers.requests.count] Request + * Count. + * + * @param {string} + * [siteEnvelope.siteConfig.autoHealRules.triggers.requests.timeInterval] Time + * interval. + * + * @param {number} + * [siteEnvelope.siteConfig.autoHealRules.triggers.privateBytesInKB] A rule + * based on private bytes. + * + * @param {array} [siteEnvelope.siteConfig.autoHealRules.triggers.statusCodes] + * A rule based on status codes. + * + * @param {object} + * [siteEnvelope.siteConfig.autoHealRules.triggers.slowRequests] A rule based + * on request execution time. + * + * @param {string} + * [siteEnvelope.siteConfig.autoHealRules.triggers.slowRequests.timeTaken] Time + * taken. + * + * @param {number} + * [siteEnvelope.siteConfig.autoHealRules.triggers.slowRequests.count] Request + * Count. + * + * @param {string} + * [siteEnvelope.siteConfig.autoHealRules.triggers.slowRequests.timeInterval] + * Time interval. + * + * @param {object} [siteEnvelope.siteConfig.autoHealRules.actions] Actions to + * be executed when a rule is triggered. + * + * @param {string} [siteEnvelope.siteConfig.autoHealRules.actions.actionType] + * Predefined action to be taken. Possible values include: 'Recycle', + * 'LogEvent', 'CustomAction' + * + * @param {object} [siteEnvelope.siteConfig.autoHealRules.actions.customAction] + * Custom action to be taken. + * + * @param {string} + * [siteEnvelope.siteConfig.autoHealRules.actions.customAction.exe] Executable + * to be run. + * + * @param {string} + * [siteEnvelope.siteConfig.autoHealRules.actions.customAction.parameters] + * Parameters for the executable. + * + * @param {string} + * [siteEnvelope.siteConfig.autoHealRules.actions.minProcessExecutionTime] + * Minimum time the process must execute + * before taking the action + * + * @param {string} [siteEnvelope.siteConfig.tracingOptions] Tracing options. + * + * @param {string} [siteEnvelope.siteConfig.vnetName] Virtual Network name. + * + * @param {object} [siteEnvelope.siteConfig.cors] Cross-Origin Resource Sharing + * (CORS) settings. + * + * @param {array} [siteEnvelope.siteConfig.cors.allowedOrigins] Gets or sets + * the list of origins that should be allowed to make cross-origin + * calls (for example: http://example.com:12345). Use "*" to allow all. + * + * @param {object} [siteEnvelope.siteConfig.push] Push endpoint settings. + * + * @param {boolean} siteEnvelope.siteConfig.push.isPushEnabled Gets or sets a + * flag indicating whether the Push endpoint is enabled. + * + * @param {string} [siteEnvelope.siteConfig.push.tagWhitelistJson] Gets or sets + * a JSON string containing a list of tags that are whitelisted for use by the + * push registration endpoint. + * + * @param {string} [siteEnvelope.siteConfig.push.tagsRequiringAuth] Gets or + * sets a JSON string containing a list of tags that require user + * authentication to be used in the push registration endpoint. + * Tags can consist of alphanumeric characters and the following: + * '_', '@', '#', '.', ':', '-'. + * Validation should be performed at the PushRequestHandler. + * + * @param {string} [siteEnvelope.siteConfig.push.dynamicTagsJson] Gets or sets + * a JSON string containing a list of dynamic tags that will be evaluated from + * user claims in the push registration endpoint. + * + * @param {string} [siteEnvelope.siteConfig.push.kind] Kind of resource. + * + * @param {object} [siteEnvelope.siteConfig.apiDefinition] Information about + * the formal API definition for the app. + * + * @param {string} [siteEnvelope.siteConfig.apiDefinition.url] The URL of the + * API definition. + * + * @param {string} [siteEnvelope.siteConfig.autoSwapSlotName] Auto-swap slot + * name. + * + * @param {boolean} [siteEnvelope.siteConfig.localMySqlEnabled] + * true to enable local MySQL; otherwise, false. + * + * @param {number} [siteEnvelope.siteConfig.managedServiceIdentityId] Managed + * Service Identity Id + * + * @param {number} [siteEnvelope.siteConfig.xManagedServiceIdentityId] Explicit + * Managed Service Identity Id + * + * @param {array} [siteEnvelope.siteConfig.ipSecurityRestrictions] IP security + * restrictions. + * + * @param {boolean} [siteEnvelope.siteConfig.http20Enabled] Http20Enabled: + * configures a web site to allow clients to connect over http2.0 + * + * @param {string} [siteEnvelope.siteConfig.minTlsVersion] MinTlsVersion: + * configures the minimum version of TLS required for SSL requests. Possible + * values include: '1.0', '1.1', '1.2' + * + * @param {string} [siteEnvelope.siteConfig.ftpsState] State of FTP / FTPS + * service. Possible values include: 'AllAllowed', 'FtpsOnly', 'Disabled' + * + * @param {number} [siteEnvelope.siteConfig.reservedInstanceCount] Number of + * reserved instances. + * This setting only applies to the Consumption Plan + * + * @param {boolean} [siteEnvelope.scmSiteAlsoStopped] true to stop + * SCM (KUDU) site when the app is stopped; otherwise, false. The + * default is false. + * + * @param {object} [siteEnvelope.hostingEnvironmentProfile] App Service + * Environment to use for the app. + * + * @param {string} [siteEnvelope.hostingEnvironmentProfile.id] Resource ID of + * the App Service Environment. + * + * @param {boolean} [siteEnvelope.clientAffinityEnabled] true to + * enable client affinity; false to stop sending session affinity + * cookies, which route client requests in the same session to the same + * instance. Default is true. + * + * @param {boolean} [siteEnvelope.clientCertEnabled] true to + * enable client certificate authentication (TLS mutual authentication); + * otherwise, false. Default is false. + * + * @param {boolean} [siteEnvelope.hostNamesDisabled] true to + * disable the public hostnames of the app; otherwise, false. + * If true, the app is only accessible via API management process. + * + * @param {number} [siteEnvelope.containerSize] Size of the function container. + * + * @param {number} [siteEnvelope.dailyMemoryTimeQuota] Maximum allowed daily + * memory-time quota (applicable on dynamic apps only). + * + * @param {object} [siteEnvelope.cloningInfo] If specified during app creation, + * the app is cloned from a source app. + * + * @param {uuid} [siteEnvelope.cloningInfo.correlationId] Correlation ID of + * cloning operation. This ID ties multiple cloning operations + * together to use the same snapshot. + * + * @param {boolean} [siteEnvelope.cloningInfo.overwrite] true to + * overwrite destination app; otherwise, false. + * + * @param {boolean} [siteEnvelope.cloningInfo.cloneCustomHostNames] + * true to clone custom hostnames from source app; otherwise, + * false. + * + * @param {boolean} [siteEnvelope.cloningInfo.cloneSourceControl] + * true to clone source control from source app; otherwise, + * false. + * + * @param {string} siteEnvelope.cloningInfo.sourceWebAppId ARM resource ID of + * the source app. App resource ID is of the form + * /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName} + * for production slots and + * /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/slots/{slotName} + * for other slots. + * + * @param {string} [siteEnvelope.cloningInfo.hostingEnvironment] App Service + * Environment. + * + * @param {object} [siteEnvelope.cloningInfo.appSettingsOverrides] Application + * setting overrides for cloned app. If specified, these settings override the + * settings cloned + * from source app. Otherwise, application settings from source app are + * retained. + * + * @param {boolean} [siteEnvelope.cloningInfo.configureLoadBalancing] + * true to configure load balancing for source and destination + * app. + * + * @param {string} [siteEnvelope.cloningInfo.trafficManagerProfileId] ARM + * resource ID of the Traffic Manager profile to use, if it exists. Traffic + * Manager resource ID is of the form + * /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/trafficManagerProfiles/{profileName}. + * + * @param {string} [siteEnvelope.cloningInfo.trafficManagerProfileName] Name of + * Traffic Manager profile to create. This is only needed if Traffic Manager + * profile does not already exist. + * + * @param {boolean} [siteEnvelope.httpsOnly] HttpsOnly: configures a web site + * to accept only https requests. Issues redirect for + * http requests + * + * @param {object} [siteEnvelope.identity] + * + * @param {string} [siteEnvelope.identity.type] Type of managed service + * identity. Possible values include: 'SystemAssigned', 'UserAssigned' + * + * @param {array} [siteEnvelope.identity.identityIds] Array of UserAssigned + * managed service identities. + * + * @param {string} [siteEnvelope.kind] Kind of resource. + * + * @param {string} siteEnvelope.location Resource Location. + * + * @param {object} [siteEnvelope.tags] Resource tags. + * + * @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 {Site} - 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 Site} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + beginCreateOrUpdate(resourceGroupName, name, siteEnvelope, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._beginCreateOrUpdate(resourceGroupName, name, siteEnvelope, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginCreateOrUpdate(resourceGroupName, name, siteEnvelope, options, optionalCallback); + } + } + + /** + * @summary Restores a specific backup to another app (or deployment slot, if + * specified). + * + * Restores a specific backup to another app (or deployment slot, if + * specified). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} backupId ID of the backup. + * + * @param {object} request Information on restore request . + * + * @param {string} request.storageAccountUrl SAS URL to the container. + * + * @param {string} [request.blobName] Name of a blob which contains the backup. + * + * @param {boolean} request.overwrite true if the restore + * operation can overwrite target app; otherwise, false. + * true is needed if trying to restore over an existing app. + * + * @param {string} [request.siteName] Name of an app. + * + * @param {array} [request.databases] Collection of databases which should be + * restored. This list has to match the list of databases included in the + * backup. + * + * @param {boolean} [request.ignoreConflictingHostNames] Changes a logic when + * restoring an app with custom domains. true to remove custom + * domains automatically. If false, custom domains are added to + * the app's object when it is being restored, but that might fail due to + * conflicts during the operation. + * + * @param {boolean} [request.ignoreDatabases] Ignore the databases and only + * restore the site content + * + * @param {string} [request.appServicePlan] Specify app service plan that will + * own restored site. + * + * @param {string} [request.operationType] Operation type. Possible values + * include: 'Default', 'Clone', 'Relocation', 'Snapshot', 'CloudFS' + * + * @param {boolean} [request.adjustConnectionStrings] true if + * SiteConfig.ConnectionStrings should be set in new app; otherwise, + * false. + * + * @param {string} [request.hostingEnvironment] App Service Environment name, + * if needed (only when restoring an app to an App Service Environment). + * + * @param {string} [request.kind] Kind of resource. + * + * @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. + */ + beginRestoreWithHttpOperationResponse(resourceGroupName, name, backupId, request, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginRestore(resourceGroupName, name, backupId, request, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Restores a specific backup to another app (or deployment slot, if + * specified). + * + * Restores a specific backup to another app (or deployment slot, if + * specified). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} backupId ID of the backup. + * + * @param {object} request Information on restore request . + * + * @param {string} request.storageAccountUrl SAS URL to the container. + * + * @param {string} [request.blobName] Name of a blob which contains the backup. + * + * @param {boolean} request.overwrite true if the restore + * operation can overwrite target app; otherwise, false. + * true is needed if trying to restore over an existing app. + * + * @param {string} [request.siteName] Name of an app. + * + * @param {array} [request.databases] Collection of databases which should be + * restored. This list has to match the list of databases included in the + * backup. + * + * @param {boolean} [request.ignoreConflictingHostNames] Changes a logic when + * restoring an app with custom domains. true to remove custom + * domains automatically. If false, custom domains are added to + * the app's object when it is being restored, but that might fail due to + * conflicts during the operation. + * + * @param {boolean} [request.ignoreDatabases] Ignore the databases and only + * restore the site content + * + * @param {string} [request.appServicePlan] Specify app service plan that will + * own restored site. + * + * @param {string} [request.operationType] Operation type. Possible values + * include: 'Default', 'Clone', 'Relocation', 'Snapshot', 'CloudFS' + * + * @param {boolean} [request.adjustConnectionStrings] true if + * SiteConfig.ConnectionStrings should be set in new app; otherwise, + * false. + * + * @param {string} [request.hostingEnvironment] App Service Environment name, + * if needed (only when restoring an app to an App Service Environment). + * + * @param {string} [request.kind] Kind of resource. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + beginRestore(resourceGroupName, name, backupId, request, 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._beginRestore(resourceGroupName, name, backupId, request, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginRestore(resourceGroupName, name, backupId, request, options, optionalCallback); + } + } + + /** + * @summary Gets the Git/FTP publishing credentials of an app. + * + * Gets the Git/FTP publishing credentials of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @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. + */ + beginListPublishingCredentialsWithHttpOperationResponse(resourceGroupName, name, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginListPublishingCredentials(resourceGroupName, name, 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 the Git/FTP publishing credentials of an app. + * + * Gets the Git/FTP publishing credentials of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @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 {User} - 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 User} 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. + */ + beginListPublishingCredentials(resourceGroupName, name, 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._beginListPublishingCredentials(resourceGroupName, name, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginListPublishingCredentials(resourceGroupName, name, options, optionalCallback); + } + } + + /** + * @summary Invoke the MSDeploy web app extension. + * + * Invoke the MSDeploy web app extension. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {object} mSDeploy Details of MSDeploy operation + * + * @param {string} [mSDeploy.packageUri] Package URI + * + * @param {string} [mSDeploy.connectionString] SQL Connection String + * + * @param {string} [mSDeploy.dbType] Database Type + * + * @param {string} [mSDeploy.setParametersXmlFileUri] URI of MSDeploy + * Parameters file. Must not be set if SetParameters is used. + * + * @param {object} [mSDeploy.setParameters] MSDeploy Parameters. Must not be + * set if SetParametersXmlFileUri is used. + * + * @param {boolean} [mSDeploy.skipAppData] Controls whether the MSDeploy + * operation skips the App_Data directory. + * If set to true, the existing App_Data directory on the + * destination + * will not be deleted, and any App_Data directory in the source will be + * ignored. + * Setting is false by default. + * + * @param {boolean} [mSDeploy.appOffline] Sets the AppOffline rule while the + * MSDeploy operation executes. + * Setting is false by default. + * + * @param {string} [mSDeploy.kind] Kind of resource. + * + * @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. + */ + beginCreateMSDeployOperationWithHttpOperationResponse(resourceGroupName, name, mSDeploy, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginCreateMSDeployOperation(resourceGroupName, name, mSDeploy, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Invoke the MSDeploy web app extension. + * + * Invoke the MSDeploy web app extension. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {object} mSDeploy Details of MSDeploy operation + * + * @param {string} [mSDeploy.packageUri] Package URI + * + * @param {string} [mSDeploy.connectionString] SQL Connection String + * + * @param {string} [mSDeploy.dbType] Database Type + * + * @param {string} [mSDeploy.setParametersXmlFileUri] URI of MSDeploy + * Parameters file. Must not be set if SetParameters is used. + * + * @param {object} [mSDeploy.setParameters] MSDeploy Parameters. Must not be + * set if SetParametersXmlFileUri is used. + * + * @param {boolean} [mSDeploy.skipAppData] Controls whether the MSDeploy + * operation skips the App_Data directory. + * If set to true, the existing App_Data directory on the + * destination + * will not be deleted, and any App_Data directory in the source will be + * ignored. + * Setting is false by default. + * + * @param {boolean} [mSDeploy.appOffline] Sets the AppOffline rule while the + * MSDeploy operation executes. + * Setting is false by default. + * + * @param {string} [mSDeploy.kind] Kind of resource. + * + * @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 {MSDeployStatus} - 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 MSDeployStatus} 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. + */ + beginCreateMSDeployOperation(resourceGroupName, name, mSDeploy, 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._beginCreateMSDeployOperation(resourceGroupName, name, mSDeploy, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginCreateMSDeployOperation(resourceGroupName, name, mSDeploy, options, optionalCallback); + } + } + + /** + * @summary Create function for web site, or a deployment slot. + * + * Create function for web site, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} functionName Function name. + * + * @param {object} functionEnvelope Function details. + * + * @param {string} [functionEnvelope.functionAppId] Function App ID. + * + * @param {string} [functionEnvelope.scriptRootPathHref] Script root path URI. + * + * @param {string} [functionEnvelope.scriptHref] Script URI. + * + * @param {string} [functionEnvelope.configHref] Config URI. + * + * @param {string} [functionEnvelope.secretsFileHref] Secrets file URI. + * + * @param {string} [functionEnvelope.href] Function URI. + * + * @param {object} [functionEnvelope.config] Config information. + * + * @param {object} [functionEnvelope.files] File list. + * + * @param {string} [functionEnvelope.testData] Test data used when testing via + * the Azure Portal. + * + * @param {string} [functionEnvelope.kind] Kind of resource. + * + * @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. + */ + beginCreateFunctionWithHttpOperationResponse(resourceGroupName, name, functionName, functionEnvelope, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginCreateFunction(resourceGroupName, name, functionName, functionEnvelope, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Create function for web site, or a deployment slot. + * + * Create function for web site, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} functionName Function name. + * + * @param {object} functionEnvelope Function details. + * + * @param {string} [functionEnvelope.functionAppId] Function App ID. + * + * @param {string} [functionEnvelope.scriptRootPathHref] Script root path URI. + * + * @param {string} [functionEnvelope.scriptHref] Script URI. + * + * @param {string} [functionEnvelope.configHref] Config URI. + * + * @param {string} [functionEnvelope.secretsFileHref] Secrets file URI. + * + * @param {string} [functionEnvelope.href] Function URI. + * + * @param {object} [functionEnvelope.config] Config information. + * + * @param {object} [functionEnvelope.files] File list. + * + * @param {string} [functionEnvelope.testData] Test data used when testing via + * the Azure Portal. + * + * @param {string} [functionEnvelope.kind] Kind of resource. + * + * @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 {FunctionEnvelope} - 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 FunctionEnvelope} 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. + */ + beginCreateFunction(resourceGroupName, name, functionName, functionEnvelope, 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._beginCreateFunction(resourceGroupName, name, functionName, functionEnvelope, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginCreateFunction(resourceGroupName, name, functionName, functionEnvelope, options, optionalCallback); + } + } + + /** + * @summary Invoke the MSDeploy web app extension. + * + * Invoke the MSDeploy web app extension. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {string} instanceId ID of web app instance. + * + * @param {object} mSDeploy Details of MSDeploy operation + * + * @param {string} [mSDeploy.packageUri] Package URI + * + * @param {string} [mSDeploy.connectionString] SQL Connection String + * + * @param {string} [mSDeploy.dbType] Database Type + * + * @param {string} [mSDeploy.setParametersXmlFileUri] URI of MSDeploy + * Parameters file. Must not be set if SetParameters is used. + * + * @param {object} [mSDeploy.setParameters] MSDeploy Parameters. Must not be + * set if SetParametersXmlFileUri is used. + * + * @param {boolean} [mSDeploy.skipAppData] Controls whether the MSDeploy + * operation skips the App_Data directory. + * If set to true, the existing App_Data directory on the + * destination + * will not be deleted, and any App_Data directory in the source will be + * ignored. + * Setting is false by default. + * + * @param {boolean} [mSDeploy.appOffline] Sets the AppOffline rule while the + * MSDeploy operation executes. + * Setting is false by default. + * + * @param {string} [mSDeploy.kind] Kind of resource. + * + * @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. + */ + beginCreateInstanceMSDeployOperationWithHttpOperationResponse(resourceGroupName, name, instanceId, mSDeploy, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginCreateInstanceMSDeployOperation(resourceGroupName, name, instanceId, mSDeploy, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Invoke the MSDeploy web app extension. + * + * Invoke the MSDeploy web app extension. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {string} instanceId ID of web app instance. + * + * @param {object} mSDeploy Details of MSDeploy operation + * + * @param {string} [mSDeploy.packageUri] Package URI + * + * @param {string} [mSDeploy.connectionString] SQL Connection String + * + * @param {string} [mSDeploy.dbType] Database Type + * + * @param {string} [mSDeploy.setParametersXmlFileUri] URI of MSDeploy + * Parameters file. Must not be set if SetParameters is used. + * + * @param {object} [mSDeploy.setParameters] MSDeploy Parameters. Must not be + * set if SetParametersXmlFileUri is used. + * + * @param {boolean} [mSDeploy.skipAppData] Controls whether the MSDeploy + * operation skips the App_Data directory. + * If set to true, the existing App_Data directory on the + * destination + * will not be deleted, and any App_Data directory in the source will be + * ignored. + * Setting is false by default. + * + * @param {boolean} [mSDeploy.appOffline] Sets the AppOffline rule while the + * MSDeploy operation executes. + * Setting is false by default. + * + * @param {string} [mSDeploy.kind] Kind of resource. + * + * @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 {MSDeployStatus} - 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 MSDeployStatus} 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. + */ + beginCreateInstanceMSDeployOperation(resourceGroupName, name, instanceId, mSDeploy, 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._beginCreateInstanceMSDeployOperation(resourceGroupName, name, instanceId, mSDeploy, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginCreateInstanceMSDeployOperation(resourceGroupName, name, instanceId, mSDeploy, options, optionalCallback); + } + } + + /** + * @summary Restores a web app. + * + * Restores a web app. + * + * @param {string} subscriptionName Azure subscription. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {object} migrationOptions Migration migrationOptions. + * + * @param {string} migrationOptions.azurefilesConnectionString AzureFiles + * connection string. + * + * @param {string} migrationOptions.azurefilesShare AzureFiles share. + * + * @param {boolean} [migrationOptions.switchSiteAfterMigration] + * trueif the app should be switched over; otherwise, + * false. + * + * @param {boolean} [migrationOptions.blockWriteAccessToSite] true + * if the app should be read only during copy operation; otherwise, + * false. + * + * @param {string} [migrationOptions.kind] Kind of resource. + * + * @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. + */ + beginMigrateStorageWithHttpOperationResponse(subscriptionName, resourceGroupName, name, migrationOptions, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginMigrateStorage(subscriptionName, resourceGroupName, name, migrationOptions, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Restores a web app. + * + * Restores a web app. + * + * @param {string} subscriptionName Azure subscription. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {object} migrationOptions Migration migrationOptions. + * + * @param {string} migrationOptions.azurefilesConnectionString AzureFiles + * connection string. + * + * @param {string} migrationOptions.azurefilesShare AzureFiles share. + * + * @param {boolean} [migrationOptions.switchSiteAfterMigration] + * trueif the app should be switched over; otherwise, + * false. + * + * @param {boolean} [migrationOptions.blockWriteAccessToSite] true + * if the app should be read only during copy operation; otherwise, + * false. + * + * @param {string} [migrationOptions.kind] Kind of resource. + * + * @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 {StorageMigrationResponse} - 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 StorageMigrationResponse} 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. + */ + beginMigrateStorage(subscriptionName, resourceGroupName, name, migrationOptions, 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._beginMigrateStorage(subscriptionName, resourceGroupName, name, migrationOptions, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginMigrateStorage(subscriptionName, resourceGroupName, name, migrationOptions, options, optionalCallback); + } + } + + /** + * @summary Migrates a local (in-app) MySql database to a remote MySql + * database. + * + * Migrates a local (in-app) MySql database to a remote MySql database. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {object} migrationRequestEnvelope MySql migration options. + * + * @param {string} migrationRequestEnvelope.connectionString Connection string + * to the remote MySQL database. + * + * @param {string} migrationRequestEnvelope.migrationType The type of migration + * operation to be done. Possible values include: 'LocalToRemote', + * 'RemoteToLocal' + * + * @param {string} [migrationRequestEnvelope.kind] Kind of resource. + * + * @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. + */ + beginMigrateMySqlWithHttpOperationResponse(resourceGroupName, name, migrationRequestEnvelope, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginMigrateMySql(resourceGroupName, name, migrationRequestEnvelope, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Migrates a local (in-app) MySql database to a remote MySql + * database. + * + * Migrates a local (in-app) MySql database to a remote MySql database. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {object} migrationRequestEnvelope MySql migration options. + * + * @param {string} migrationRequestEnvelope.connectionString Connection string + * to the remote MySQL database. + * + * @param {string} migrationRequestEnvelope.migrationType The type of migration + * operation to be done. Possible values include: 'LocalToRemote', + * 'RemoteToLocal' + * + * @param {string} [migrationRequestEnvelope.kind] Kind of resource. + * + * @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 {Operation} - 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 Operation} 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. + */ + beginMigrateMySql(resourceGroupName, name, migrationRequestEnvelope, 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._beginMigrateMySql(resourceGroupName, name, migrationRequestEnvelope, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginMigrateMySql(resourceGroupName, name, migrationRequestEnvelope, options, optionalCallback); + } + } + + /** + * @summary Restores an app from a backup blob in Azure Storage. + * + * Restores an app from a backup blob in Azure Storage. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} request Information on restore request . + * + * @param {string} request.storageAccountUrl SAS URL to the container. + * + * @param {string} [request.blobName] Name of a blob which contains the backup. + * + * @param {boolean} request.overwrite true if the restore + * operation can overwrite target app; otherwise, false. + * true is needed if trying to restore over an existing app. + * + * @param {string} [request.siteName] Name of an app. + * + * @param {array} [request.databases] Collection of databases which should be + * restored. This list has to match the list of databases included in the + * backup. + * + * @param {boolean} [request.ignoreConflictingHostNames] Changes a logic when + * restoring an app with custom domains. true to remove custom + * domains automatically. If false, custom domains are added to + * the app's object when it is being restored, but that might fail due to + * conflicts during the operation. + * + * @param {boolean} [request.ignoreDatabases] Ignore the databases and only + * restore the site content + * + * @param {string} [request.appServicePlan] Specify app service plan that will + * own restored site. + * + * @param {string} [request.operationType] Operation type. Possible values + * include: 'Default', 'Clone', 'Relocation', 'Snapshot', 'CloudFS' + * + * @param {boolean} [request.adjustConnectionStrings] true if + * SiteConfig.ConnectionStrings should be set in new app; otherwise, + * false. + * + * @param {string} [request.hostingEnvironment] App Service Environment name, + * if needed (only when restoring an app to an App Service Environment). + * + * @param {string} [request.kind] Kind of resource. + * + * @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. + */ + beginRestoreFromBackupBlobWithHttpOperationResponse(resourceGroupName, name, request, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginRestoreFromBackupBlob(resourceGroupName, name, request, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Restores an app from a backup blob in Azure Storage. + * + * Restores an app from a backup blob in Azure Storage. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} request Information on restore request . + * + * @param {string} request.storageAccountUrl SAS URL to the container. + * + * @param {string} [request.blobName] Name of a blob which contains the backup. + * + * @param {boolean} request.overwrite true if the restore + * operation can overwrite target app; otherwise, false. + * true is needed if trying to restore over an existing app. + * + * @param {string} [request.siteName] Name of an app. + * + * @param {array} [request.databases] Collection of databases which should be + * restored. This list has to match the list of databases included in the + * backup. + * + * @param {boolean} [request.ignoreConflictingHostNames] Changes a logic when + * restoring an app with custom domains. true to remove custom + * domains automatically. If false, custom domains are added to + * the app's object when it is being restored, but that might fail due to + * conflicts during the operation. + * + * @param {boolean} [request.ignoreDatabases] Ignore the databases and only + * restore the site content + * + * @param {string} [request.appServicePlan] Specify app service plan that will + * own restored site. + * + * @param {string} [request.operationType] Operation type. Possible values + * include: 'Default', 'Clone', 'Relocation', 'Snapshot', 'CloudFS' + * + * @param {boolean} [request.adjustConnectionStrings] true if + * SiteConfig.ConnectionStrings should be set in new app; otherwise, + * false. + * + * @param {string} [request.hostingEnvironment] App Service Environment name, + * if needed (only when restoring an app to an App Service Environment). + * + * @param {string} [request.kind] Kind of resource. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + beginRestoreFromBackupBlob(resourceGroupName, name, request, 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._beginRestoreFromBackupBlob(resourceGroupName, name, request, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginRestoreFromBackupBlob(resourceGroupName, name, request, options, optionalCallback); + } + } + + /** + * @summary Restores a deleted web app to this web app. + * + * Restores a deleted web app to this web app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {object} restoreRequest Deleted web app restore information. + * + * @param {string} [restoreRequest.deletedSiteId] ARM resource ID of the + * deleted app. Example: + * /subscriptions/{subId}/providers/Microsoft.Web/deletedSites/{deletedSiteId} + * + * @param {boolean} [restoreRequest.recoverConfiguration] If true, deleted site + * configuration, in addition to content, will be restored. + * + * @param {string} [restoreRequest.snapshotTime] Point in time to restore the + * deleted app from, formatted as a DateTime string. + * If unspecified, default value is the time that the app was deleted. + * + * @param {string} [restoreRequest.kind] Kind of resource. + * + * @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. + */ + beginRestoreFromDeletedAppWithHttpOperationResponse(resourceGroupName, name, restoreRequest, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginRestoreFromDeletedApp(resourceGroupName, name, restoreRequest, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Restores a deleted web app to this web app. + * + * Restores a deleted web app to this web app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {object} restoreRequest Deleted web app restore information. + * + * @param {string} [restoreRequest.deletedSiteId] ARM resource ID of the + * deleted app. Example: + * /subscriptions/{subId}/providers/Microsoft.Web/deletedSites/{deletedSiteId} + * + * @param {boolean} [restoreRequest.recoverConfiguration] If true, deleted site + * configuration, in addition to content, will be restored. + * + * @param {string} [restoreRequest.snapshotTime] Point in time to restore the + * deleted app from, formatted as a DateTime string. + * If unspecified, default value is the time that the app was deleted. + * + * @param {string} [restoreRequest.kind] Kind of resource. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + beginRestoreFromDeletedApp(resourceGroupName, name, restoreRequest, 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._beginRestoreFromDeletedApp(resourceGroupName, name, restoreRequest, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginRestoreFromDeletedApp(resourceGroupName, name, restoreRequest, options, optionalCallback); + } + } + + /** + * @summary Restores a web app from a snapshot. + * + * Restores a web app from a snapshot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {object} restoreRequest Snapshot restore settings. Snapshot + * information can be obtained by calling GetDeletedSites or GetSiteSnapshots + * API. + * + * @param {string} [restoreRequest.snapshotTime] Point in time in which the app + * restore should be done, formatted as a DateTime string. + * + * @param {object} [restoreRequest.recoverySource] Optional. Specifies the web + * app that snapshot contents will be retrieved from. + * If empty, the targeted web app will be used as the source. + * + * @param {string} [restoreRequest.recoverySource.location] Geographical + * location of the source web app, e.g. SouthEastAsia, SouthCentralUS + * + * @param {string} [restoreRequest.recoverySource.id] ARM resource ID of the + * source app. + * /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName} + * for production slots and + * /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/slots/{slotName} + * for other slots. + * + * @param {boolean} restoreRequest.overwrite If true the restore + * operation can overwrite source app; otherwise, false. + * + * @param {boolean} [restoreRequest.recoverConfiguration] If true, site + * configuration, in addition to content, will be reverted. + * + * @param {boolean} [restoreRequest.ignoreConflictingHostNames] If true, custom + * hostname conflicts will be ignored when recovering to a target web app. + * This setting is only necessary when RecoverConfiguration is enabled. + * + * @param {string} [restoreRequest.kind] Kind of resource. + * + * @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. + */ + beginRestoreSnapshotWithHttpOperationResponse(resourceGroupName, name, restoreRequest, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginRestoreSnapshot(resourceGroupName, name, restoreRequest, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Restores a web app from a snapshot. + * + * Restores a web app from a snapshot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {object} restoreRequest Snapshot restore settings. Snapshot + * information can be obtained by calling GetDeletedSites or GetSiteSnapshots + * API. + * + * @param {string} [restoreRequest.snapshotTime] Point in time in which the app + * restore should be done, formatted as a DateTime string. + * + * @param {object} [restoreRequest.recoverySource] Optional. Specifies the web + * app that snapshot contents will be retrieved from. + * If empty, the targeted web app will be used as the source. + * + * @param {string} [restoreRequest.recoverySource.location] Geographical + * location of the source web app, e.g. SouthEastAsia, SouthCentralUS + * + * @param {string} [restoreRequest.recoverySource.id] ARM resource ID of the + * source app. + * /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName} + * for production slots and + * /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/slots/{slotName} + * for other slots. + * + * @param {boolean} restoreRequest.overwrite If true the restore + * operation can overwrite source app; otherwise, false. + * + * @param {boolean} [restoreRequest.recoverConfiguration] If true, site + * configuration, in addition to content, will be reverted. + * + * @param {boolean} [restoreRequest.ignoreConflictingHostNames] If true, custom + * hostname conflicts will be ignored when recovering to a target web app. + * This setting is only necessary when RecoverConfiguration is enabled. + * + * @param {string} [restoreRequest.kind] Kind of resource. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + beginRestoreSnapshot(resourceGroupName, name, restoreRequest, 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._beginRestoreSnapshot(resourceGroupName, name, restoreRequest, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginRestoreSnapshot(resourceGroupName, name, restoreRequest, options, optionalCallback); + } + } + + /** + * @summary Install site extension on a web site, or a deployment slot. + * + * Install site extension on a web site, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} siteExtensionId Site extension name. + * + * @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. + */ + beginInstallSiteExtensionWithHttpOperationResponse(resourceGroupName, name, siteExtensionId, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginInstallSiteExtension(resourceGroupName, name, siteExtensionId, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Install site extension on a web site, or a deployment slot. + * + * Install site extension on a web site, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} siteExtensionId Site extension name. + * + * @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 {SiteExtensionInfo} - 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 SiteExtensionInfo} 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. + */ + beginInstallSiteExtension(resourceGroupName, name, siteExtensionId, 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._beginInstallSiteExtension(resourceGroupName, name, siteExtensionId, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginInstallSiteExtension(resourceGroupName, name, siteExtensionId, options, optionalCallback); + } + } + + /** + * @summary Creates a new web, mobile, or API app in an existing resource + * group, or updates an existing app. + * + * Creates a new web, mobile, or API app in an existing resource group, or + * updates an existing app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Unique name of the app to create or update. To create + * or update a deployment slot, use the {slot} parameter. + * + * @param {object} siteEnvelope A JSON representation of the app properties. + * See example. + * + * @param {boolean} [siteEnvelope.enabled] true if the app is + * enabled; otherwise, false. Setting this value to false disables + * the app (takes the app offline). + * + * @param {array} [siteEnvelope.hostNameSslStates] Hostname SSL states are used + * to manage the SSL bindings for app's hostnames. + * + * @param {string} [siteEnvelope.serverFarmId] Resource ID of the associated + * App Service plan, formatted as: + * "/subscriptions/{subscriptionID}/resourceGroups/{groupName}/providers/Microsoft.Web/serverfarms/{appServicePlanName}". + * + * @param {boolean} [siteEnvelope.reserved] true if reserved; + * otherwise, false. + * + * @param {boolean} [siteEnvelope.isXenon] Obsolete: Hyper-V sandbox. + * + * @param {boolean} [siteEnvelope.hyperV] Hyper-V sandbox. + * + * @param {object} [siteEnvelope.siteConfig] Configuration of the app. + * + * @param {number} [siteEnvelope.siteConfig.numberOfWorkers] Number of workers. + * + * @param {array} [siteEnvelope.siteConfig.defaultDocuments] Default documents. + * + * @param {string} [siteEnvelope.siteConfig.netFrameworkVersion] .NET Framework + * version. + * + * @param {string} [siteEnvelope.siteConfig.phpVersion] Version of PHP. + * + * @param {string} [siteEnvelope.siteConfig.pythonVersion] Version of Python. + * + * @param {string} [siteEnvelope.siteConfig.nodeVersion] Version of Node.js. + * + * @param {string} [siteEnvelope.siteConfig.linuxFxVersion] Linux App Framework + * and version + * + * @param {string} [siteEnvelope.siteConfig.windowsFxVersion] Xenon App + * Framework and version + * + * @param {boolean} [siteEnvelope.siteConfig.requestTracingEnabled] + * true if request tracing is enabled; otherwise, + * false. + * + * @param {date} [siteEnvelope.siteConfig.requestTracingExpirationTime] Request + * tracing expiration time. + * + * @param {boolean} [siteEnvelope.siteConfig.remoteDebuggingEnabled] + * true if remote debugging is enabled; otherwise, + * false. + * + * @param {string} [siteEnvelope.siteConfig.remoteDebuggingVersion] Remote + * debugging version. + * + * @param {boolean} [siteEnvelope.siteConfig.httpLoggingEnabled] + * true if HTTP logging is enabled; otherwise, false. + * + * @param {number} [siteEnvelope.siteConfig.logsDirectorySizeLimit] HTTP logs + * directory size limit. + * + * @param {boolean} [siteEnvelope.siteConfig.detailedErrorLoggingEnabled] + * true if detailed error logging is enabled; otherwise, + * false. + * + * @param {string} [siteEnvelope.siteConfig.publishingUsername] Publishing user + * name. + * + * @param {array} [siteEnvelope.siteConfig.appSettings] Application settings. + * + * @param {object} [siteEnvelope.siteConfig.azureStorageAccounts] User-provided + * Azure storage accounts. + * + * @param {array} [siteEnvelope.siteConfig.connectionStrings] Connection + * strings. + * + * @param {array} [siteEnvelope.siteConfig.handlerMappings] Handler mappings. + * + * @param {string} [siteEnvelope.siteConfig.documentRoot] Document root. + * + * @param {string} [siteEnvelope.siteConfig.scmType] SCM type. Possible values + * include: 'None', 'Dropbox', 'Tfs', 'LocalGit', 'GitHub', 'CodePlexGit', + * 'CodePlexHg', 'BitbucketGit', 'BitbucketHg', 'ExternalGit', 'ExternalHg', + * 'OneDrive', 'VSO' + * + * @param {boolean} [siteEnvelope.siteConfig.use32BitWorkerProcess] + * true to use 32-bit worker process; otherwise, + * false. + * + * @param {boolean} [siteEnvelope.siteConfig.webSocketsEnabled] + * true if WebSocket is enabled; otherwise, false. + * + * @param {boolean} [siteEnvelope.siteConfig.alwaysOn] true if + * Always On is enabled; otherwise, false. + * + * @param {string} [siteEnvelope.siteConfig.javaVersion] Java version. + * + * @param {string} [siteEnvelope.siteConfig.javaContainer] Java container. + * + * @param {string} [siteEnvelope.siteConfig.javaContainerVersion] Java + * container version. + * + * @param {string} [siteEnvelope.siteConfig.appCommandLine] App command line to + * launch. + * + * @param {string} [siteEnvelope.siteConfig.managedPipelineMode] Managed + * pipeline mode. Possible values include: 'Integrated', 'Classic' + * + * @param {array} [siteEnvelope.siteConfig.virtualApplications] Virtual + * applications. + * + * @param {string} [siteEnvelope.siteConfig.loadBalancing] Site load balancing. + * Possible values include: 'WeightedRoundRobin', 'LeastRequests', + * 'LeastResponseTime', 'WeightedTotalTraffic', 'RequestHash' + * + * @param {object} [siteEnvelope.siteConfig.experiments] This is work around + * for polymophic types. + * + * @param {array} [siteEnvelope.siteConfig.experiments.rampUpRules] List of + * ramp-up rules. + * + * @param {object} [siteEnvelope.siteConfig.limits] Site limits. + * + * @param {number} [siteEnvelope.siteConfig.limits.maxPercentageCpu] Maximum + * allowed CPU usage percentage. + * + * @param {number} [siteEnvelope.siteConfig.limits.maxMemoryInMb] Maximum + * allowed memory usage in MB. + * + * @param {number} [siteEnvelope.siteConfig.limits.maxDiskSizeInMb] Maximum + * allowed disk size usage in MB. + * + * @param {boolean} [siteEnvelope.siteConfig.autoHealEnabled] true + * if Auto Heal is enabled; otherwise, false. + * + * @param {object} [siteEnvelope.siteConfig.autoHealRules] Auto Heal rules. + * + * @param {object} [siteEnvelope.siteConfig.autoHealRules.triggers] Conditions + * that describe when to execute the auto-heal actions. + * + * @param {object} [siteEnvelope.siteConfig.autoHealRules.triggers.requests] A + * rule based on total requests. + * + * @param {number} + * [siteEnvelope.siteConfig.autoHealRules.triggers.requests.count] Request + * Count. + * + * @param {string} + * [siteEnvelope.siteConfig.autoHealRules.triggers.requests.timeInterval] Time + * interval. + * + * @param {number} + * [siteEnvelope.siteConfig.autoHealRules.triggers.privateBytesInKB] A rule + * based on private bytes. + * + * @param {array} [siteEnvelope.siteConfig.autoHealRules.triggers.statusCodes] + * A rule based on status codes. + * + * @param {object} + * [siteEnvelope.siteConfig.autoHealRules.triggers.slowRequests] A rule based + * on request execution time. + * + * @param {string} + * [siteEnvelope.siteConfig.autoHealRules.triggers.slowRequests.timeTaken] Time + * taken. + * + * @param {number} + * [siteEnvelope.siteConfig.autoHealRules.triggers.slowRequests.count] Request + * Count. + * + * @param {string} + * [siteEnvelope.siteConfig.autoHealRules.triggers.slowRequests.timeInterval] + * Time interval. + * + * @param {object} [siteEnvelope.siteConfig.autoHealRules.actions] Actions to + * be executed when a rule is triggered. + * + * @param {string} [siteEnvelope.siteConfig.autoHealRules.actions.actionType] + * Predefined action to be taken. Possible values include: 'Recycle', + * 'LogEvent', 'CustomAction' + * + * @param {object} [siteEnvelope.siteConfig.autoHealRules.actions.customAction] + * Custom action to be taken. + * + * @param {string} + * [siteEnvelope.siteConfig.autoHealRules.actions.customAction.exe] Executable + * to be run. + * + * @param {string} + * [siteEnvelope.siteConfig.autoHealRules.actions.customAction.parameters] + * Parameters for the executable. + * + * @param {string} + * [siteEnvelope.siteConfig.autoHealRules.actions.minProcessExecutionTime] + * Minimum time the process must execute + * before taking the action + * + * @param {string} [siteEnvelope.siteConfig.tracingOptions] Tracing options. + * + * @param {string} [siteEnvelope.siteConfig.vnetName] Virtual Network name. + * + * @param {object} [siteEnvelope.siteConfig.cors] Cross-Origin Resource Sharing + * (CORS) settings. + * + * @param {array} [siteEnvelope.siteConfig.cors.allowedOrigins] Gets or sets + * the list of origins that should be allowed to make cross-origin + * calls (for example: http://example.com:12345). Use "*" to allow all. + * + * @param {object} [siteEnvelope.siteConfig.push] Push endpoint settings. + * + * @param {boolean} siteEnvelope.siteConfig.push.isPushEnabled Gets or sets a + * flag indicating whether the Push endpoint is enabled. + * + * @param {string} [siteEnvelope.siteConfig.push.tagWhitelistJson] Gets or sets + * a JSON string containing a list of tags that are whitelisted for use by the + * push registration endpoint. + * + * @param {string} [siteEnvelope.siteConfig.push.tagsRequiringAuth] Gets or + * sets a JSON string containing a list of tags that require user + * authentication to be used in the push registration endpoint. + * Tags can consist of alphanumeric characters and the following: + * '_', '@', '#', '.', ':', '-'. + * Validation should be performed at the PushRequestHandler. + * + * @param {string} [siteEnvelope.siteConfig.push.dynamicTagsJson] Gets or sets + * a JSON string containing a list of dynamic tags that will be evaluated from + * user claims in the push registration endpoint. + * + * @param {string} [siteEnvelope.siteConfig.push.kind] Kind of resource. + * + * @param {object} [siteEnvelope.siteConfig.apiDefinition] Information about + * the formal API definition for the app. + * + * @param {string} [siteEnvelope.siteConfig.apiDefinition.url] The URL of the + * API definition. + * + * @param {string} [siteEnvelope.siteConfig.autoSwapSlotName] Auto-swap slot + * name. + * + * @param {boolean} [siteEnvelope.siteConfig.localMySqlEnabled] + * true to enable local MySQL; otherwise, false. + * + * @param {number} [siteEnvelope.siteConfig.managedServiceIdentityId] Managed + * Service Identity Id + * + * @param {number} [siteEnvelope.siteConfig.xManagedServiceIdentityId] Explicit + * Managed Service Identity Id + * + * @param {array} [siteEnvelope.siteConfig.ipSecurityRestrictions] IP security + * restrictions. + * + * @param {boolean} [siteEnvelope.siteConfig.http20Enabled] Http20Enabled: + * configures a web site to allow clients to connect over http2.0 + * + * @param {string} [siteEnvelope.siteConfig.minTlsVersion] MinTlsVersion: + * configures the minimum version of TLS required for SSL requests. Possible + * values include: '1.0', '1.1', '1.2' + * + * @param {string} [siteEnvelope.siteConfig.ftpsState] State of FTP / FTPS + * service. Possible values include: 'AllAllowed', 'FtpsOnly', 'Disabled' + * + * @param {number} [siteEnvelope.siteConfig.reservedInstanceCount] Number of + * reserved instances. + * This setting only applies to the Consumption Plan + * + * @param {boolean} [siteEnvelope.scmSiteAlsoStopped] true to stop + * SCM (KUDU) site when the app is stopped; otherwise, false. The + * default is false. + * + * @param {object} [siteEnvelope.hostingEnvironmentProfile] App Service + * Environment to use for the app. + * + * @param {string} [siteEnvelope.hostingEnvironmentProfile.id] Resource ID of + * the App Service Environment. + * + * @param {boolean} [siteEnvelope.clientAffinityEnabled] true to + * enable client affinity; false to stop sending session affinity + * cookies, which route client requests in the same session to the same + * instance. Default is true. + * + * @param {boolean} [siteEnvelope.clientCertEnabled] true to + * enable client certificate authentication (TLS mutual authentication); + * otherwise, false. Default is false. + * + * @param {boolean} [siteEnvelope.hostNamesDisabled] true to + * disable the public hostnames of the app; otherwise, false. + * If true, the app is only accessible via API management process. + * + * @param {number} [siteEnvelope.containerSize] Size of the function container. + * + * @param {number} [siteEnvelope.dailyMemoryTimeQuota] Maximum allowed daily + * memory-time quota (applicable on dynamic apps only). + * + * @param {object} [siteEnvelope.cloningInfo] If specified during app creation, + * the app is cloned from a source app. + * + * @param {uuid} [siteEnvelope.cloningInfo.correlationId] Correlation ID of + * cloning operation. This ID ties multiple cloning operations + * together to use the same snapshot. + * + * @param {boolean} [siteEnvelope.cloningInfo.overwrite] true to + * overwrite destination app; otherwise, false. + * + * @param {boolean} [siteEnvelope.cloningInfo.cloneCustomHostNames] + * true to clone custom hostnames from source app; otherwise, + * false. + * + * @param {boolean} [siteEnvelope.cloningInfo.cloneSourceControl] + * true to clone source control from source app; otherwise, + * false. + * + * @param {string} siteEnvelope.cloningInfo.sourceWebAppId ARM resource ID of + * the source app. App resource ID is of the form + * /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName} + * for production slots and + * /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/slots/{slotName} + * for other slots. + * + * @param {string} [siteEnvelope.cloningInfo.hostingEnvironment] App Service + * Environment. + * + * @param {object} [siteEnvelope.cloningInfo.appSettingsOverrides] Application + * setting overrides for cloned app. If specified, these settings override the + * settings cloned + * from source app. Otherwise, application settings from source app are + * retained. + * + * @param {boolean} [siteEnvelope.cloningInfo.configureLoadBalancing] + * true to configure load balancing for source and destination + * app. + * + * @param {string} [siteEnvelope.cloningInfo.trafficManagerProfileId] ARM + * resource ID of the Traffic Manager profile to use, if it exists. Traffic + * Manager resource ID is of the form + * /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/trafficManagerProfiles/{profileName}. + * + * @param {string} [siteEnvelope.cloningInfo.trafficManagerProfileName] Name of + * Traffic Manager profile to create. This is only needed if Traffic Manager + * profile does not already exist. + * + * @param {boolean} [siteEnvelope.httpsOnly] HttpsOnly: configures a web site + * to accept only https requests. Issues redirect for + * http requests + * + * @param {object} [siteEnvelope.identity] + * + * @param {string} [siteEnvelope.identity.type] Type of managed service + * identity. Possible values include: 'SystemAssigned', 'UserAssigned' + * + * @param {array} [siteEnvelope.identity.identityIds] Array of UserAssigned + * managed service identities. + * + * @param {string} [siteEnvelope.kind] Kind of resource. + * + * @param {string} siteEnvelope.location Resource Location. + * + * @param {object} [siteEnvelope.tags] Resource tags. + * + * @param {string} slot Name of the deployment slot to create or update. By + * default, this API attempts to create or modify the production slot. + * + * @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. + */ + beginCreateOrUpdateSlotWithHttpOperationResponse(resourceGroupName, name, siteEnvelope, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginCreateOrUpdateSlot(resourceGroupName, name, siteEnvelope, slot, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Creates a new web, mobile, or API app in an existing resource + * group, or updates an existing app. + * + * Creates a new web, mobile, or API app in an existing resource group, or + * updates an existing app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Unique name of the app to create or update. To create + * or update a deployment slot, use the {slot} parameter. + * + * @param {object} siteEnvelope A JSON representation of the app properties. + * See example. + * + * @param {boolean} [siteEnvelope.enabled] true if the app is + * enabled; otherwise, false. Setting this value to false disables + * the app (takes the app offline). + * + * @param {array} [siteEnvelope.hostNameSslStates] Hostname SSL states are used + * to manage the SSL bindings for app's hostnames. + * + * @param {string} [siteEnvelope.serverFarmId] Resource ID of the associated + * App Service plan, formatted as: + * "/subscriptions/{subscriptionID}/resourceGroups/{groupName}/providers/Microsoft.Web/serverfarms/{appServicePlanName}". + * + * @param {boolean} [siteEnvelope.reserved] true if reserved; + * otherwise, false. + * + * @param {boolean} [siteEnvelope.isXenon] Obsolete: Hyper-V sandbox. + * + * @param {boolean} [siteEnvelope.hyperV] Hyper-V sandbox. + * + * @param {object} [siteEnvelope.siteConfig] Configuration of the app. + * + * @param {number} [siteEnvelope.siteConfig.numberOfWorkers] Number of workers. + * + * @param {array} [siteEnvelope.siteConfig.defaultDocuments] Default documents. + * + * @param {string} [siteEnvelope.siteConfig.netFrameworkVersion] .NET Framework + * version. + * + * @param {string} [siteEnvelope.siteConfig.phpVersion] Version of PHP. + * + * @param {string} [siteEnvelope.siteConfig.pythonVersion] Version of Python. + * + * @param {string} [siteEnvelope.siteConfig.nodeVersion] Version of Node.js. + * + * @param {string} [siteEnvelope.siteConfig.linuxFxVersion] Linux App Framework + * and version + * + * @param {string} [siteEnvelope.siteConfig.windowsFxVersion] Xenon App + * Framework and version + * + * @param {boolean} [siteEnvelope.siteConfig.requestTracingEnabled] + * true if request tracing is enabled; otherwise, + * false. + * + * @param {date} [siteEnvelope.siteConfig.requestTracingExpirationTime] Request + * tracing expiration time. + * + * @param {boolean} [siteEnvelope.siteConfig.remoteDebuggingEnabled] + * true if remote debugging is enabled; otherwise, + * false. + * + * @param {string} [siteEnvelope.siteConfig.remoteDebuggingVersion] Remote + * debugging version. + * + * @param {boolean} [siteEnvelope.siteConfig.httpLoggingEnabled] + * true if HTTP logging is enabled; otherwise, false. + * + * @param {number} [siteEnvelope.siteConfig.logsDirectorySizeLimit] HTTP logs + * directory size limit. + * + * @param {boolean} [siteEnvelope.siteConfig.detailedErrorLoggingEnabled] + * true if detailed error logging is enabled; otherwise, + * false. + * + * @param {string} [siteEnvelope.siteConfig.publishingUsername] Publishing user + * name. + * + * @param {array} [siteEnvelope.siteConfig.appSettings] Application settings. + * + * @param {object} [siteEnvelope.siteConfig.azureStorageAccounts] User-provided + * Azure storage accounts. + * + * @param {array} [siteEnvelope.siteConfig.connectionStrings] Connection + * strings. + * + * @param {array} [siteEnvelope.siteConfig.handlerMappings] Handler mappings. + * + * @param {string} [siteEnvelope.siteConfig.documentRoot] Document root. + * + * @param {string} [siteEnvelope.siteConfig.scmType] SCM type. Possible values + * include: 'None', 'Dropbox', 'Tfs', 'LocalGit', 'GitHub', 'CodePlexGit', + * 'CodePlexHg', 'BitbucketGit', 'BitbucketHg', 'ExternalGit', 'ExternalHg', + * 'OneDrive', 'VSO' + * + * @param {boolean} [siteEnvelope.siteConfig.use32BitWorkerProcess] + * true to use 32-bit worker process; otherwise, + * false. + * + * @param {boolean} [siteEnvelope.siteConfig.webSocketsEnabled] + * true if WebSocket is enabled; otherwise, false. + * + * @param {boolean} [siteEnvelope.siteConfig.alwaysOn] true if + * Always On is enabled; otherwise, false. + * + * @param {string} [siteEnvelope.siteConfig.javaVersion] Java version. + * + * @param {string} [siteEnvelope.siteConfig.javaContainer] Java container. + * + * @param {string} [siteEnvelope.siteConfig.javaContainerVersion] Java + * container version. + * + * @param {string} [siteEnvelope.siteConfig.appCommandLine] App command line to + * launch. + * + * @param {string} [siteEnvelope.siteConfig.managedPipelineMode] Managed + * pipeline mode. Possible values include: 'Integrated', 'Classic' + * + * @param {array} [siteEnvelope.siteConfig.virtualApplications] Virtual + * applications. + * + * @param {string} [siteEnvelope.siteConfig.loadBalancing] Site load balancing. + * Possible values include: 'WeightedRoundRobin', 'LeastRequests', + * 'LeastResponseTime', 'WeightedTotalTraffic', 'RequestHash' + * + * @param {object} [siteEnvelope.siteConfig.experiments] This is work around + * for polymophic types. + * + * @param {array} [siteEnvelope.siteConfig.experiments.rampUpRules] List of + * ramp-up rules. + * + * @param {object} [siteEnvelope.siteConfig.limits] Site limits. + * + * @param {number} [siteEnvelope.siteConfig.limits.maxPercentageCpu] Maximum + * allowed CPU usage percentage. + * + * @param {number} [siteEnvelope.siteConfig.limits.maxMemoryInMb] Maximum + * allowed memory usage in MB. + * + * @param {number} [siteEnvelope.siteConfig.limits.maxDiskSizeInMb] Maximum + * allowed disk size usage in MB. + * + * @param {boolean} [siteEnvelope.siteConfig.autoHealEnabled] true + * if Auto Heal is enabled; otherwise, false. + * + * @param {object} [siteEnvelope.siteConfig.autoHealRules] Auto Heal rules. + * + * @param {object} [siteEnvelope.siteConfig.autoHealRules.triggers] Conditions + * that describe when to execute the auto-heal actions. + * + * @param {object} [siteEnvelope.siteConfig.autoHealRules.triggers.requests] A + * rule based on total requests. + * + * @param {number} + * [siteEnvelope.siteConfig.autoHealRules.triggers.requests.count] Request + * Count. + * + * @param {string} + * [siteEnvelope.siteConfig.autoHealRules.triggers.requests.timeInterval] Time + * interval. + * + * @param {number} + * [siteEnvelope.siteConfig.autoHealRules.triggers.privateBytesInKB] A rule + * based on private bytes. + * + * @param {array} [siteEnvelope.siteConfig.autoHealRules.triggers.statusCodes] + * A rule based on status codes. + * + * @param {object} + * [siteEnvelope.siteConfig.autoHealRules.triggers.slowRequests] A rule based + * on request execution time. + * + * @param {string} + * [siteEnvelope.siteConfig.autoHealRules.triggers.slowRequests.timeTaken] Time + * taken. + * + * @param {number} + * [siteEnvelope.siteConfig.autoHealRules.triggers.slowRequests.count] Request + * Count. + * + * @param {string} + * [siteEnvelope.siteConfig.autoHealRules.triggers.slowRequests.timeInterval] + * Time interval. + * + * @param {object} [siteEnvelope.siteConfig.autoHealRules.actions] Actions to + * be executed when a rule is triggered. + * + * @param {string} [siteEnvelope.siteConfig.autoHealRules.actions.actionType] + * Predefined action to be taken. Possible values include: 'Recycle', + * 'LogEvent', 'CustomAction' + * + * @param {object} [siteEnvelope.siteConfig.autoHealRules.actions.customAction] + * Custom action to be taken. + * + * @param {string} + * [siteEnvelope.siteConfig.autoHealRules.actions.customAction.exe] Executable + * to be run. + * + * @param {string} + * [siteEnvelope.siteConfig.autoHealRules.actions.customAction.parameters] + * Parameters for the executable. + * + * @param {string} + * [siteEnvelope.siteConfig.autoHealRules.actions.minProcessExecutionTime] + * Minimum time the process must execute + * before taking the action + * + * @param {string} [siteEnvelope.siteConfig.tracingOptions] Tracing options. + * + * @param {string} [siteEnvelope.siteConfig.vnetName] Virtual Network name. + * + * @param {object} [siteEnvelope.siteConfig.cors] Cross-Origin Resource Sharing + * (CORS) settings. + * + * @param {array} [siteEnvelope.siteConfig.cors.allowedOrigins] Gets or sets + * the list of origins that should be allowed to make cross-origin + * calls (for example: http://example.com:12345). Use "*" to allow all. + * + * @param {object} [siteEnvelope.siteConfig.push] Push endpoint settings. + * + * @param {boolean} siteEnvelope.siteConfig.push.isPushEnabled Gets or sets a + * flag indicating whether the Push endpoint is enabled. + * + * @param {string} [siteEnvelope.siteConfig.push.tagWhitelistJson] Gets or sets + * a JSON string containing a list of tags that are whitelisted for use by the + * push registration endpoint. + * + * @param {string} [siteEnvelope.siteConfig.push.tagsRequiringAuth] Gets or + * sets a JSON string containing a list of tags that require user + * authentication to be used in the push registration endpoint. + * Tags can consist of alphanumeric characters and the following: + * '_', '@', '#', '.', ':', '-'. + * Validation should be performed at the PushRequestHandler. + * + * @param {string} [siteEnvelope.siteConfig.push.dynamicTagsJson] Gets or sets + * a JSON string containing a list of dynamic tags that will be evaluated from + * user claims in the push registration endpoint. + * + * @param {string} [siteEnvelope.siteConfig.push.kind] Kind of resource. + * + * @param {object} [siteEnvelope.siteConfig.apiDefinition] Information about + * the formal API definition for the app. + * + * @param {string} [siteEnvelope.siteConfig.apiDefinition.url] The URL of the + * API definition. + * + * @param {string} [siteEnvelope.siteConfig.autoSwapSlotName] Auto-swap slot + * name. + * + * @param {boolean} [siteEnvelope.siteConfig.localMySqlEnabled] + * true to enable local MySQL; otherwise, false. + * + * @param {number} [siteEnvelope.siteConfig.managedServiceIdentityId] Managed + * Service Identity Id + * + * @param {number} [siteEnvelope.siteConfig.xManagedServiceIdentityId] Explicit + * Managed Service Identity Id + * + * @param {array} [siteEnvelope.siteConfig.ipSecurityRestrictions] IP security + * restrictions. + * + * @param {boolean} [siteEnvelope.siteConfig.http20Enabled] Http20Enabled: + * configures a web site to allow clients to connect over http2.0 + * + * @param {string} [siteEnvelope.siteConfig.minTlsVersion] MinTlsVersion: + * configures the minimum version of TLS required for SSL requests. Possible + * values include: '1.0', '1.1', '1.2' + * + * @param {string} [siteEnvelope.siteConfig.ftpsState] State of FTP / FTPS + * service. Possible values include: 'AllAllowed', 'FtpsOnly', 'Disabled' + * + * @param {number} [siteEnvelope.siteConfig.reservedInstanceCount] Number of + * reserved instances. + * This setting only applies to the Consumption Plan + * + * @param {boolean} [siteEnvelope.scmSiteAlsoStopped] true to stop + * SCM (KUDU) site when the app is stopped; otherwise, false. The + * default is false. + * + * @param {object} [siteEnvelope.hostingEnvironmentProfile] App Service + * Environment to use for the app. + * + * @param {string} [siteEnvelope.hostingEnvironmentProfile.id] Resource ID of + * the App Service Environment. + * + * @param {boolean} [siteEnvelope.clientAffinityEnabled] true to + * enable client affinity; false to stop sending session affinity + * cookies, which route client requests in the same session to the same + * instance. Default is true. + * + * @param {boolean} [siteEnvelope.clientCertEnabled] true to + * enable client certificate authentication (TLS mutual authentication); + * otherwise, false. Default is false. + * + * @param {boolean} [siteEnvelope.hostNamesDisabled] true to + * disable the public hostnames of the app; otherwise, false. + * If true, the app is only accessible via API management process. + * + * @param {number} [siteEnvelope.containerSize] Size of the function container. + * + * @param {number} [siteEnvelope.dailyMemoryTimeQuota] Maximum allowed daily + * memory-time quota (applicable on dynamic apps only). + * + * @param {object} [siteEnvelope.cloningInfo] If specified during app creation, + * the app is cloned from a source app. + * + * @param {uuid} [siteEnvelope.cloningInfo.correlationId] Correlation ID of + * cloning operation. This ID ties multiple cloning operations + * together to use the same snapshot. + * + * @param {boolean} [siteEnvelope.cloningInfo.overwrite] true to + * overwrite destination app; otherwise, false. + * + * @param {boolean} [siteEnvelope.cloningInfo.cloneCustomHostNames] + * true to clone custom hostnames from source app; otherwise, + * false. + * + * @param {boolean} [siteEnvelope.cloningInfo.cloneSourceControl] + * true to clone source control from source app; otherwise, + * false. + * + * @param {string} siteEnvelope.cloningInfo.sourceWebAppId ARM resource ID of + * the source app. App resource ID is of the form + * /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName} + * for production slots and + * /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/slots/{slotName} + * for other slots. + * + * @param {string} [siteEnvelope.cloningInfo.hostingEnvironment] App Service + * Environment. + * + * @param {object} [siteEnvelope.cloningInfo.appSettingsOverrides] Application + * setting overrides for cloned app. If specified, these settings override the + * settings cloned + * from source app. Otherwise, application settings from source app are + * retained. + * + * @param {boolean} [siteEnvelope.cloningInfo.configureLoadBalancing] + * true to configure load balancing for source and destination + * app. + * + * @param {string} [siteEnvelope.cloningInfo.trafficManagerProfileId] ARM + * resource ID of the Traffic Manager profile to use, if it exists. Traffic + * Manager resource ID is of the form + * /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/trafficManagerProfiles/{profileName}. + * + * @param {string} [siteEnvelope.cloningInfo.trafficManagerProfileName] Name of + * Traffic Manager profile to create. This is only needed if Traffic Manager + * profile does not already exist. + * + * @param {boolean} [siteEnvelope.httpsOnly] HttpsOnly: configures a web site + * to accept only https requests. Issues redirect for + * http requests + * + * @param {object} [siteEnvelope.identity] + * + * @param {string} [siteEnvelope.identity.type] Type of managed service + * identity. Possible values include: 'SystemAssigned', 'UserAssigned' + * + * @param {array} [siteEnvelope.identity.identityIds] Array of UserAssigned + * managed service identities. + * + * @param {string} [siteEnvelope.kind] Kind of resource. + * + * @param {string} siteEnvelope.location Resource Location. + * + * @param {object} [siteEnvelope.tags] Resource tags. + * + * @param {string} slot Name of the deployment slot to create or update. By + * default, this API attempts to create or modify the production slot. + * + * @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 {Site} - 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 Site} 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. + */ + beginCreateOrUpdateSlot(resourceGroupName, name, siteEnvelope, slot, 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._beginCreateOrUpdateSlot(resourceGroupName, name, siteEnvelope, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginCreateOrUpdateSlot(resourceGroupName, name, siteEnvelope, slot, options, optionalCallback); + } + } + + /** + * @summary Restores a specific backup to another app (or deployment slot, if + * specified). + * + * Restores a specific backup to another app (or deployment slot, if + * specified). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} backupId ID of the backup. + * + * @param {object} request Information on restore request . + * + * @param {string} request.storageAccountUrl SAS URL to the container. + * + * @param {string} [request.blobName] Name of a blob which contains the backup. + * + * @param {boolean} request.overwrite true if the restore + * operation can overwrite target app; otherwise, false. + * true is needed if trying to restore over an existing app. + * + * @param {string} [request.siteName] Name of an app. + * + * @param {array} [request.databases] Collection of databases which should be + * restored. This list has to match the list of databases included in the + * backup. + * + * @param {boolean} [request.ignoreConflictingHostNames] Changes a logic when + * restoring an app with custom domains. true to remove custom + * domains automatically. If false, custom domains are added to + * the app's object when it is being restored, but that might fail due to + * conflicts during the operation. + * + * @param {boolean} [request.ignoreDatabases] Ignore the databases and only + * restore the site content + * + * @param {string} [request.appServicePlan] Specify app service plan that will + * own restored site. + * + * @param {string} [request.operationType] Operation type. Possible values + * include: 'Default', 'Clone', 'Relocation', 'Snapshot', 'CloudFS' + * + * @param {boolean} [request.adjustConnectionStrings] true if + * SiteConfig.ConnectionStrings should be set in new app; otherwise, + * false. + * + * @param {string} [request.hostingEnvironment] App Service Environment name, + * if needed (only when restoring an app to an App Service Environment). + * + * @param {string} [request.kind] Kind of resource. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will restore a backup of the production slot. + * + * @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. + */ + beginRestoreSlotWithHttpOperationResponse(resourceGroupName, name, backupId, request, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginRestoreSlot(resourceGroupName, name, backupId, request, slot, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Restores a specific backup to another app (or deployment slot, if + * specified). + * + * Restores a specific backup to another app (or deployment slot, if + * specified). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} backupId ID of the backup. + * + * @param {object} request Information on restore request . + * + * @param {string} request.storageAccountUrl SAS URL to the container. + * + * @param {string} [request.blobName] Name of a blob which contains the backup. + * + * @param {boolean} request.overwrite true if the restore + * operation can overwrite target app; otherwise, false. + * true is needed if trying to restore over an existing app. + * + * @param {string} [request.siteName] Name of an app. + * + * @param {array} [request.databases] Collection of databases which should be + * restored. This list has to match the list of databases included in the + * backup. + * + * @param {boolean} [request.ignoreConflictingHostNames] Changes a logic when + * restoring an app with custom domains. true to remove custom + * domains automatically. If false, custom domains are added to + * the app's object when it is being restored, but that might fail due to + * conflicts during the operation. + * + * @param {boolean} [request.ignoreDatabases] Ignore the databases and only + * restore the site content + * + * @param {string} [request.appServicePlan] Specify app service plan that will + * own restored site. + * + * @param {string} [request.operationType] Operation type. Possible values + * include: 'Default', 'Clone', 'Relocation', 'Snapshot', 'CloudFS' + * + * @param {boolean} [request.adjustConnectionStrings] true if + * SiteConfig.ConnectionStrings should be set in new app; otherwise, + * false. + * + * @param {string} [request.hostingEnvironment] App Service Environment name, + * if needed (only when restoring an app to an App Service Environment). + * + * @param {string} [request.kind] Kind of resource. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will restore a backup of the production slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + beginRestoreSlot(resourceGroupName, name, backupId, request, slot, 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._beginRestoreSlot(resourceGroupName, name, backupId, request, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginRestoreSlot(resourceGroupName, name, backupId, request, slot, options, optionalCallback); + } + } + + /** + * @summary Gets the Git/FTP publishing credentials of an app. + * + * Gets the Git/FTP publishing credentials of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will get the publishing credentials for the production + * slot. + * + * @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. + */ + beginListPublishingCredentialsSlotWithHttpOperationResponse(resourceGroupName, name, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginListPublishingCredentialsSlot(resourceGroupName, name, slot, 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 the Git/FTP publishing credentials of an app. + * + * Gets the Git/FTP publishing credentials of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will get the publishing credentials for the production + * slot. + * + * @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 {User} - 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 User} 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. + */ + beginListPublishingCredentialsSlot(resourceGroupName, name, slot, 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._beginListPublishingCredentialsSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginListPublishingCredentialsSlot(resourceGroupName, name, slot, options, optionalCallback); + } + } + + /** + * @summary Invoke the MSDeploy web app extension. + * + * Invoke the MSDeploy web app extension. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {string} slot Name of web app slot. If not specified then will + * default to production slot. + * + * @param {object} mSDeploy Details of MSDeploy operation + * + * @param {string} [mSDeploy.packageUri] Package URI + * + * @param {string} [mSDeploy.connectionString] SQL Connection String + * + * @param {string} [mSDeploy.dbType] Database Type + * + * @param {string} [mSDeploy.setParametersXmlFileUri] URI of MSDeploy + * Parameters file. Must not be set if SetParameters is used. + * + * @param {object} [mSDeploy.setParameters] MSDeploy Parameters. Must not be + * set if SetParametersXmlFileUri is used. + * + * @param {boolean} [mSDeploy.skipAppData] Controls whether the MSDeploy + * operation skips the App_Data directory. + * If set to true, the existing App_Data directory on the + * destination + * will not be deleted, and any App_Data directory in the source will be + * ignored. + * Setting is false by default. + * + * @param {boolean} [mSDeploy.appOffline] Sets the AppOffline rule while the + * MSDeploy operation executes. + * Setting is false by default. + * + * @param {string} [mSDeploy.kind] Kind of resource. + * + * @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. + */ + beginCreateMSDeployOperationSlotWithHttpOperationResponse(resourceGroupName, name, slot, mSDeploy, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginCreateMSDeployOperationSlot(resourceGroupName, name, slot, mSDeploy, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Invoke the MSDeploy web app extension. + * + * Invoke the MSDeploy web app extension. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {string} slot Name of web app slot. If not specified then will + * default to production slot. + * + * @param {object} mSDeploy Details of MSDeploy operation + * + * @param {string} [mSDeploy.packageUri] Package URI + * + * @param {string} [mSDeploy.connectionString] SQL Connection String + * + * @param {string} [mSDeploy.dbType] Database Type + * + * @param {string} [mSDeploy.setParametersXmlFileUri] URI of MSDeploy + * Parameters file. Must not be set if SetParameters is used. + * + * @param {object} [mSDeploy.setParameters] MSDeploy Parameters. Must not be + * set if SetParametersXmlFileUri is used. + * + * @param {boolean} [mSDeploy.skipAppData] Controls whether the MSDeploy + * operation skips the App_Data directory. + * If set to true, the existing App_Data directory on the + * destination + * will not be deleted, and any App_Data directory in the source will be + * ignored. + * Setting is false by default. + * + * @param {boolean} [mSDeploy.appOffline] Sets the AppOffline rule while the + * MSDeploy operation executes. + * Setting is false by default. + * + * @param {string} [mSDeploy.kind] Kind of resource. + * + * @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 {MSDeployStatus} - 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 MSDeployStatus} 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. + */ + beginCreateMSDeployOperationSlot(resourceGroupName, name, slot, mSDeploy, 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._beginCreateMSDeployOperationSlot(resourceGroupName, name, slot, mSDeploy, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginCreateMSDeployOperationSlot(resourceGroupName, name, slot, mSDeploy, options, optionalCallback); + } + } + + /** + * @summary Create function for web site, or a deployment slot. + * + * Create function for web site, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} functionName Function name. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API deletes a deployment for the production slot. + * + * @param {object} functionEnvelope Function details. + * + * @param {string} [functionEnvelope.functionAppId] Function App ID. + * + * @param {string} [functionEnvelope.scriptRootPathHref] Script root path URI. + * + * @param {string} [functionEnvelope.scriptHref] Script URI. + * + * @param {string} [functionEnvelope.configHref] Config URI. + * + * @param {string} [functionEnvelope.secretsFileHref] Secrets file URI. + * + * @param {string} [functionEnvelope.href] Function URI. + * + * @param {object} [functionEnvelope.config] Config information. + * + * @param {object} [functionEnvelope.files] File list. + * + * @param {string} [functionEnvelope.testData] Test data used when testing via + * the Azure Portal. + * + * @param {string} [functionEnvelope.kind] Kind of resource. + * + * @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. + */ + beginCreateInstanceFunctionSlotWithHttpOperationResponse(resourceGroupName, name, functionName, slot, functionEnvelope, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginCreateInstanceFunctionSlot(resourceGroupName, name, functionName, slot, functionEnvelope, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Create function for web site, or a deployment slot. + * + * Create function for web site, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} functionName Function name. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API deletes a deployment for the production slot. + * + * @param {object} functionEnvelope Function details. + * + * @param {string} [functionEnvelope.functionAppId] Function App ID. + * + * @param {string} [functionEnvelope.scriptRootPathHref] Script root path URI. + * + * @param {string} [functionEnvelope.scriptHref] Script URI. + * + * @param {string} [functionEnvelope.configHref] Config URI. + * + * @param {string} [functionEnvelope.secretsFileHref] Secrets file URI. + * + * @param {string} [functionEnvelope.href] Function URI. + * + * @param {object} [functionEnvelope.config] Config information. + * + * @param {object} [functionEnvelope.files] File list. + * + * @param {string} [functionEnvelope.testData] Test data used when testing via + * the Azure Portal. + * + * @param {string} [functionEnvelope.kind] Kind of resource. + * + * @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 {FunctionEnvelope} - 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 FunctionEnvelope} 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. + */ + beginCreateInstanceFunctionSlot(resourceGroupName, name, functionName, slot, functionEnvelope, 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._beginCreateInstanceFunctionSlot(resourceGroupName, name, functionName, slot, functionEnvelope, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginCreateInstanceFunctionSlot(resourceGroupName, name, functionName, slot, functionEnvelope, options, optionalCallback); + } + } + + /** + * @summary Invoke the MSDeploy web app extension. + * + * Invoke the MSDeploy web app extension. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {string} slot Name of web app slot. If not specified then will + * default to production slot. + * + * @param {string} instanceId ID of web app instance. + * + * @param {object} mSDeploy Details of MSDeploy operation + * + * @param {string} [mSDeploy.packageUri] Package URI + * + * @param {string} [mSDeploy.connectionString] SQL Connection String + * + * @param {string} [mSDeploy.dbType] Database Type + * + * @param {string} [mSDeploy.setParametersXmlFileUri] URI of MSDeploy + * Parameters file. Must not be set if SetParameters is used. + * + * @param {object} [mSDeploy.setParameters] MSDeploy Parameters. Must not be + * set if SetParametersXmlFileUri is used. + * + * @param {boolean} [mSDeploy.skipAppData] Controls whether the MSDeploy + * operation skips the App_Data directory. + * If set to true, the existing App_Data directory on the + * destination + * will not be deleted, and any App_Data directory in the source will be + * ignored. + * Setting is false by default. + * + * @param {boolean} [mSDeploy.appOffline] Sets the AppOffline rule while the + * MSDeploy operation executes. + * Setting is false by default. + * + * @param {string} [mSDeploy.kind] Kind of resource. + * + * @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. + */ + beginCreateInstanceMSDeployOperationSlotWithHttpOperationResponse(resourceGroupName, name, slot, instanceId, mSDeploy, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginCreateInstanceMSDeployOperationSlot(resourceGroupName, name, slot, instanceId, mSDeploy, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Invoke the MSDeploy web app extension. + * + * Invoke the MSDeploy web app extension. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {string} slot Name of web app slot. If not specified then will + * default to production slot. + * + * @param {string} instanceId ID of web app instance. + * + * @param {object} mSDeploy Details of MSDeploy operation + * + * @param {string} [mSDeploy.packageUri] Package URI + * + * @param {string} [mSDeploy.connectionString] SQL Connection String + * + * @param {string} [mSDeploy.dbType] Database Type + * + * @param {string} [mSDeploy.setParametersXmlFileUri] URI of MSDeploy + * Parameters file. Must not be set if SetParameters is used. + * + * @param {object} [mSDeploy.setParameters] MSDeploy Parameters. Must not be + * set if SetParametersXmlFileUri is used. + * + * @param {boolean} [mSDeploy.skipAppData] Controls whether the MSDeploy + * operation skips the App_Data directory. + * If set to true, the existing App_Data directory on the + * destination + * will not be deleted, and any App_Data directory in the source will be + * ignored. + * Setting is false by default. + * + * @param {boolean} [mSDeploy.appOffline] Sets the AppOffline rule while the + * MSDeploy operation executes. + * Setting is false by default. + * + * @param {string} [mSDeploy.kind] Kind of resource. + * + * @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 {MSDeployStatus} - 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 MSDeployStatus} 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. + */ + beginCreateInstanceMSDeployOperationSlot(resourceGroupName, name, slot, instanceId, mSDeploy, 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._beginCreateInstanceMSDeployOperationSlot(resourceGroupName, name, slot, instanceId, mSDeploy, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginCreateInstanceMSDeployOperationSlot(resourceGroupName, name, slot, instanceId, mSDeploy, options, optionalCallback); + } + } + + /** + * @summary Restores an app from a backup blob in Azure Storage. + * + * Restores an app from a backup blob in Azure Storage. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} request Information on restore request . + * + * @param {string} request.storageAccountUrl SAS URL to the container. + * + * @param {string} [request.blobName] Name of a blob which contains the backup. + * + * @param {boolean} request.overwrite true if the restore + * operation can overwrite target app; otherwise, false. + * true is needed if trying to restore over an existing app. + * + * @param {string} [request.siteName] Name of an app. + * + * @param {array} [request.databases] Collection of databases which should be + * restored. This list has to match the list of databases included in the + * backup. + * + * @param {boolean} [request.ignoreConflictingHostNames] Changes a logic when + * restoring an app with custom domains. true to remove custom + * domains automatically. If false, custom domains are added to + * the app's object when it is being restored, but that might fail due to + * conflicts during the operation. + * + * @param {boolean} [request.ignoreDatabases] Ignore the databases and only + * restore the site content + * + * @param {string} [request.appServicePlan] Specify app service plan that will + * own restored site. + * + * @param {string} [request.operationType] Operation type. Possible values + * include: 'Default', 'Clone', 'Relocation', 'Snapshot', 'CloudFS' + * + * @param {boolean} [request.adjustConnectionStrings] true if + * SiteConfig.ConnectionStrings should be set in new app; otherwise, + * false. + * + * @param {string} [request.hostingEnvironment] App Service Environment name, + * if needed (only when restoring an app to an App Service Environment). + * + * @param {string} [request.kind] Kind of resource. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will restore a backup of the production slot. + * + * @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. + */ + beginRestoreFromBackupBlobSlotWithHttpOperationResponse(resourceGroupName, name, request, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginRestoreFromBackupBlobSlot(resourceGroupName, name, request, slot, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Restores an app from a backup blob in Azure Storage. + * + * Restores an app from a backup blob in Azure Storage. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} request Information on restore request . + * + * @param {string} request.storageAccountUrl SAS URL to the container. + * + * @param {string} [request.blobName] Name of a blob which contains the backup. + * + * @param {boolean} request.overwrite true if the restore + * operation can overwrite target app; otherwise, false. + * true is needed if trying to restore over an existing app. + * + * @param {string} [request.siteName] Name of an app. + * + * @param {array} [request.databases] Collection of databases which should be + * restored. This list has to match the list of databases included in the + * backup. + * + * @param {boolean} [request.ignoreConflictingHostNames] Changes a logic when + * restoring an app with custom domains. true to remove custom + * domains automatically. If false, custom domains are added to + * the app's object when it is being restored, but that might fail due to + * conflicts during the operation. + * + * @param {boolean} [request.ignoreDatabases] Ignore the databases and only + * restore the site content + * + * @param {string} [request.appServicePlan] Specify app service plan that will + * own restored site. + * + * @param {string} [request.operationType] Operation type. Possible values + * include: 'Default', 'Clone', 'Relocation', 'Snapshot', 'CloudFS' + * + * @param {boolean} [request.adjustConnectionStrings] true if + * SiteConfig.ConnectionStrings should be set in new app; otherwise, + * false. + * + * @param {string} [request.hostingEnvironment] App Service Environment name, + * if needed (only when restoring an app to an App Service Environment). + * + * @param {string} [request.kind] Kind of resource. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will restore a backup of the production slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + beginRestoreFromBackupBlobSlot(resourceGroupName, name, request, slot, 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._beginRestoreFromBackupBlobSlot(resourceGroupName, name, request, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginRestoreFromBackupBlobSlot(resourceGroupName, name, request, slot, options, optionalCallback); + } + } + + /** + * @summary Restores a deleted web app to this web app. + * + * Restores a deleted web app to this web app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {object} restoreRequest Deleted web app restore information. + * + * @param {string} [restoreRequest.deletedSiteId] ARM resource ID of the + * deleted app. Example: + * /subscriptions/{subId}/providers/Microsoft.Web/deletedSites/{deletedSiteId} + * + * @param {boolean} [restoreRequest.recoverConfiguration] If true, deleted site + * configuration, in addition to content, will be restored. + * + * @param {string} [restoreRequest.snapshotTime] Point in time to restore the + * deleted app from, formatted as a DateTime string. + * If unspecified, default value is the time that the app was deleted. + * + * @param {string} [restoreRequest.kind] Kind of resource. + * + * @param {string} slot Name of web app slot. If not specified then will + * default to production slot. + * + * @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. + */ + beginRestoreFromDeletedAppSlotWithHttpOperationResponse(resourceGroupName, name, restoreRequest, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginRestoreFromDeletedAppSlot(resourceGroupName, name, restoreRequest, slot, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Restores a deleted web app to this web app. + * + * Restores a deleted web app to this web app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {object} restoreRequest Deleted web app restore information. + * + * @param {string} [restoreRequest.deletedSiteId] ARM resource ID of the + * deleted app. Example: + * /subscriptions/{subId}/providers/Microsoft.Web/deletedSites/{deletedSiteId} + * + * @param {boolean} [restoreRequest.recoverConfiguration] If true, deleted site + * configuration, in addition to content, will be restored. + * + * @param {string} [restoreRequest.snapshotTime] Point in time to restore the + * deleted app from, formatted as a DateTime string. + * If unspecified, default value is the time that the app was deleted. + * + * @param {string} [restoreRequest.kind] Kind of resource. + * + * @param {string} slot Name of web app slot. If not specified then will + * default to production slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + beginRestoreFromDeletedAppSlot(resourceGroupName, name, restoreRequest, slot, 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._beginRestoreFromDeletedAppSlot(resourceGroupName, name, restoreRequest, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginRestoreFromDeletedAppSlot(resourceGroupName, name, restoreRequest, slot, options, optionalCallback); + } + } + + /** + * @summary Restores a web app from a snapshot. + * + * Restores a web app from a snapshot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {object} restoreRequest Snapshot restore settings. Snapshot + * information can be obtained by calling GetDeletedSites or GetSiteSnapshots + * API. + * + * @param {string} [restoreRequest.snapshotTime] Point in time in which the app + * restore should be done, formatted as a DateTime string. + * + * @param {object} [restoreRequest.recoverySource] Optional. Specifies the web + * app that snapshot contents will be retrieved from. + * If empty, the targeted web app will be used as the source. + * + * @param {string} [restoreRequest.recoverySource.location] Geographical + * location of the source web app, e.g. SouthEastAsia, SouthCentralUS + * + * @param {string} [restoreRequest.recoverySource.id] ARM resource ID of the + * source app. + * /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName} + * for production slots and + * /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/slots/{slotName} + * for other slots. + * + * @param {boolean} restoreRequest.overwrite If true the restore + * operation can overwrite source app; otherwise, false. + * + * @param {boolean} [restoreRequest.recoverConfiguration] If true, site + * configuration, in addition to content, will be reverted. + * + * @param {boolean} [restoreRequest.ignoreConflictingHostNames] If true, custom + * hostname conflicts will be ignored when recovering to a target web app. + * This setting is only necessary when RecoverConfiguration is enabled. + * + * @param {string} [restoreRequest.kind] Kind of resource. + * + * @param {string} slot Name of web app slot. If not specified then will + * default to production slot. + * + * @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. + */ + beginRestoreSnapshotSlotWithHttpOperationResponse(resourceGroupName, name, restoreRequest, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginRestoreSnapshotSlot(resourceGroupName, name, restoreRequest, slot, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Restores a web app from a snapshot. + * + * Restores a web app from a snapshot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {object} restoreRequest Snapshot restore settings. Snapshot + * information can be obtained by calling GetDeletedSites or GetSiteSnapshots + * API. + * + * @param {string} [restoreRequest.snapshotTime] Point in time in which the app + * restore should be done, formatted as a DateTime string. + * + * @param {object} [restoreRequest.recoverySource] Optional. Specifies the web + * app that snapshot contents will be retrieved from. + * If empty, the targeted web app will be used as the source. + * + * @param {string} [restoreRequest.recoverySource.location] Geographical + * location of the source web app, e.g. SouthEastAsia, SouthCentralUS + * + * @param {string} [restoreRequest.recoverySource.id] ARM resource ID of the + * source app. + * /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName} + * for production slots and + * /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/slots/{slotName} + * for other slots. + * + * @param {boolean} restoreRequest.overwrite If true the restore + * operation can overwrite source app; otherwise, false. + * + * @param {boolean} [restoreRequest.recoverConfiguration] If true, site + * configuration, in addition to content, will be reverted. + * + * @param {boolean} [restoreRequest.ignoreConflictingHostNames] If true, custom + * hostname conflicts will be ignored when recovering to a target web app. + * This setting is only necessary when RecoverConfiguration is enabled. + * + * @param {string} [restoreRequest.kind] Kind of resource. + * + * @param {string} slot Name of web app slot. If not specified then will + * default to production slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + beginRestoreSnapshotSlot(resourceGroupName, name, restoreRequest, slot, 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._beginRestoreSnapshotSlot(resourceGroupName, name, restoreRequest, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginRestoreSnapshotSlot(resourceGroupName, name, restoreRequest, slot, options, optionalCallback); + } + } + + /** + * @summary Install site extension on a web site, or a deployment slot. + * + * Install site extension on a web site, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} siteExtensionId Site extension name. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API deletes a deployment for the production slot. + * + * @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. + */ + beginInstallSiteExtensionSlotWithHttpOperationResponse(resourceGroupName, name, siteExtensionId, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginInstallSiteExtensionSlot(resourceGroupName, name, siteExtensionId, slot, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Install site extension on a web site, or a deployment slot. + * + * Install site extension on a web site, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} siteExtensionId Site extension name. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API deletes a deployment for the production slot. + * + * @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 {SiteExtensionInfo} - 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 SiteExtensionInfo} 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. + */ + beginInstallSiteExtensionSlot(resourceGroupName, name, siteExtensionId, slot, 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._beginInstallSiteExtensionSlot(resourceGroupName, name, siteExtensionId, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginInstallSiteExtensionSlot(resourceGroupName, name, siteExtensionId, slot, options, optionalCallback); + } + } + + /** + * @summary Swaps two deployment slots of an app. + * + * Swaps two deployment slots of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} slotSwapEntity JSON object that contains the target slot + * name. See example. + * + * @param {string} slotSwapEntity.targetSlot Destination deployment slot during + * swap operation. + * + * @param {boolean} slotSwapEntity.preserveVnet true to preserve + * Virtual Network to the slot during swap; otherwise, false. + * + * @param {string} slot Name of the source slot. If a slot is not specified, + * the production slot is used as the source slot. + * + * @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. + */ + beginSwapSlotSlotWithHttpOperationResponse(resourceGroupName, name, slotSwapEntity, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginSwapSlotSlot(resourceGroupName, name, slotSwapEntity, slot, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Swaps two deployment slots of an app. + * + * Swaps two deployment slots of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} slotSwapEntity JSON object that contains the target slot + * name. See example. + * + * @param {string} slotSwapEntity.targetSlot Destination deployment slot during + * swap operation. + * + * @param {boolean} slotSwapEntity.preserveVnet true to preserve + * Virtual Network to the slot during swap; otherwise, false. + * + * @param {string} slot Name of the source slot. If a slot is not specified, + * the production slot is used as the source slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + beginSwapSlotSlot(resourceGroupName, name, slotSwapEntity, slot, 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._beginSwapSlotSlot(resourceGroupName, name, slotSwapEntity, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginSwapSlotSlot(resourceGroupName, name, slotSwapEntity, slot, options, optionalCallback); + } + } + + /** + * @summary Updates the source control configuration of an app. + * + * Updates the source control configuration of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} siteSourceControl JSON representation of a SiteSourceControl + * object. See example. + * + * @param {string} [siteSourceControl.repoUrl] Repository or source control + * URL. + * + * @param {string} [siteSourceControl.branch] Name of branch to use for + * deployment. + * + * @param {boolean} [siteSourceControl.isManualIntegration] true + * to limit to manual integration; false to enable continuous + * integration (which configures webhooks into online repos like GitHub). + * + * @param {boolean} [siteSourceControl.deploymentRollbackEnabled] + * true to enable deployment rollback; otherwise, + * false. + * + * @param {boolean} [siteSourceControl.isMercurial] true for a + * Mercurial repository; false for a Git repository. + * + * @param {string} [siteSourceControl.kind] Kind of resource. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will update the source control configuration for the + * production slot. + * + * @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. + */ + beginCreateOrUpdateSourceControlSlotWithHttpOperationResponse(resourceGroupName, name, siteSourceControl, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginCreateOrUpdateSourceControlSlot(resourceGroupName, name, siteSourceControl, slot, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Updates the source control configuration of an app. + * + * Updates the source control configuration of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} siteSourceControl JSON representation of a SiteSourceControl + * object. See example. + * + * @param {string} [siteSourceControl.repoUrl] Repository or source control + * URL. + * + * @param {string} [siteSourceControl.branch] Name of branch to use for + * deployment. + * + * @param {boolean} [siteSourceControl.isManualIntegration] true + * to limit to manual integration; false to enable continuous + * integration (which configures webhooks into online repos like GitHub). + * + * @param {boolean} [siteSourceControl.deploymentRollbackEnabled] + * true to enable deployment rollback; otherwise, + * false. + * + * @param {boolean} [siteSourceControl.isMercurial] true for a + * Mercurial repository; false for a Git repository. + * + * @param {string} [siteSourceControl.kind] Kind of resource. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will update the source control configuration for the + * production slot. + * + * @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 {SiteSourceControl} - 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 SiteSourceControl} 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. + */ + beginCreateOrUpdateSourceControlSlot(resourceGroupName, name, siteSourceControl, slot, 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._beginCreateOrUpdateSourceControlSlot(resourceGroupName, name, siteSourceControl, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginCreateOrUpdateSourceControlSlot(resourceGroupName, name, siteSourceControl, slot, options, optionalCallback); + } + } + + /** + * @summary Swaps two deployment slots of an app. + * + * Swaps two deployment slots of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} slotSwapEntity JSON object that contains the target slot + * name. See example. + * + * @param {string} slotSwapEntity.targetSlot Destination deployment slot during + * swap operation. + * + * @param {boolean} slotSwapEntity.preserveVnet true to preserve + * Virtual Network to the slot during swap; otherwise, false. + * + * @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. + */ + beginSwapSlotWithProductionWithHttpOperationResponse(resourceGroupName, name, slotSwapEntity, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginSwapSlotWithProduction(resourceGroupName, name, slotSwapEntity, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Swaps two deployment slots of an app. + * + * Swaps two deployment slots of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} slotSwapEntity JSON object that contains the target slot + * name. See example. + * + * @param {string} slotSwapEntity.targetSlot Destination deployment slot during + * swap operation. + * + * @param {boolean} slotSwapEntity.preserveVnet true to preserve + * Virtual Network to the slot during swap; otherwise, false. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + beginSwapSlotWithProduction(resourceGroupName, name, slotSwapEntity, 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._beginSwapSlotWithProduction(resourceGroupName, name, slotSwapEntity, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginSwapSlotWithProduction(resourceGroupName, name, slotSwapEntity, options, optionalCallback); + } + } + + /** + * @summary Updates the source control configuration of an app. + * + * Updates the source control configuration of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} siteSourceControl JSON representation of a SiteSourceControl + * object. See example. + * + * @param {string} [siteSourceControl.repoUrl] Repository or source control + * URL. + * + * @param {string} [siteSourceControl.branch] Name of branch to use for + * deployment. + * + * @param {boolean} [siteSourceControl.isManualIntegration] true + * to limit to manual integration; false to enable continuous + * integration (which configures webhooks into online repos like GitHub). + * + * @param {boolean} [siteSourceControl.deploymentRollbackEnabled] + * true to enable deployment rollback; otherwise, + * false. + * + * @param {boolean} [siteSourceControl.isMercurial] true for a + * Mercurial repository; false for a Git repository. + * + * @param {string} [siteSourceControl.kind] Kind of resource. + * + * @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. + */ + beginCreateOrUpdateSourceControlWithHttpOperationResponse(resourceGroupName, name, siteSourceControl, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginCreateOrUpdateSourceControl(resourceGroupName, name, siteSourceControl, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Updates the source control configuration of an app. + * + * Updates the source control configuration of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} siteSourceControl JSON representation of a SiteSourceControl + * object. See example. + * + * @param {string} [siteSourceControl.repoUrl] Repository or source control + * URL. + * + * @param {string} [siteSourceControl.branch] Name of branch to use for + * deployment. + * + * @param {boolean} [siteSourceControl.isManualIntegration] true + * to limit to manual integration; false to enable continuous + * integration (which configures webhooks into online repos like GitHub). + * + * @param {boolean} [siteSourceControl.deploymentRollbackEnabled] + * true to enable deployment rollback; otherwise, + * false. + * + * @param {boolean} [siteSourceControl.isMercurial] true for a + * Mercurial repository; false for a Git repository. + * + * @param {string} [siteSourceControl.kind] Kind of resource. + * + * @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 {SiteSourceControl} - 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 SiteSourceControl} 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. + */ + beginCreateOrUpdateSourceControl(resourceGroupName, name, siteSourceControl, 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._beginCreateOrUpdateSourceControl(resourceGroupName, name, siteSourceControl, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginCreateOrUpdateSourceControl(resourceGroupName, name, siteSourceControl, options, optionalCallback); + } + } + + /** + * @summary Get all apps for a subscription. + * + * Get all apps for a subscription. + * + * @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 Get all apps for a subscription. + * + * Get all apps for a subscription. + * + * @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 {WebAppCollection} - 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 WebAppCollection} 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); + } + } + + /** + * @summary Gets all web, mobile, and API apps in the specified resource group. + * + * Gets all web, mobile, and API apps in the specified resource group. + * + * @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. + */ + listByResourceGroupNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listByResourceGroupNext(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 all web, mobile, and API apps in the specified resource group. + * + * Gets all web, mobile, and API apps in the specified resource group. + * + * @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 {WebAppCollection} - 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 WebAppCollection} 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. + */ + listByResourceGroupNext(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._listByResourceGroupNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listByResourceGroupNext(nextPageLink, options, optionalCallback); + } + } + + /** + * @summary Gets existing backups of an app. + * + * Gets existing backups of an app. + * + * @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. + */ + listBackupsNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listBackupsNext(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 existing backups of an app. + * + * Gets existing backups of an app. + * + * @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 {BackupItemCollection} - 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 BackupItemCollection} 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. + */ + listBackupsNext(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._listBackupsNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listBackupsNext(nextPageLink, options, optionalCallback); + } + } + + /** + * @summary List the configurations of an app + * + * List the configurations of an app + * + * @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. + */ + listConfigurationsNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listConfigurationsNext(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 List the configurations of an app + * + * List the configurations of an app + * + * @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 {SiteConfigResourceCollection} - 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 SiteConfigResourceCollection} 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. + */ + listConfigurationsNext(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._listConfigurationsNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listConfigurationsNext(nextPageLink, options, optionalCallback); + } + } + + /** + * @summary Gets a list of web app configuration snapshots identifiers. Each + * element of the list contains a timestamp and the ID of the snapshot. + * + * Gets a list of web app configuration snapshots identifiers. Each element of + * the list contains a timestamp and the ID of the snapshot. + * + * @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. + */ + listConfigurationSnapshotInfoNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listConfigurationSnapshotInfoNext(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 web app configuration snapshots identifiers. Each + * element of the list contains a timestamp and the ID of the snapshot. + * + * Gets a list of web app configuration snapshots identifiers. Each element of + * the list contains a timestamp and the ID of the snapshot. + * + * @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 {SiteConfigurationSnapshotInfoCollection} - 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 SiteConfigurationSnapshotInfoCollection} 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. + */ + listConfigurationSnapshotInfoNext(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._listConfigurationSnapshotInfoNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listConfigurationSnapshotInfoNext(nextPageLink, options, optionalCallback); + } + } + + /** + * @summary List continuous web jobs for an app, or a deployment slot. + * + * List continuous web jobs for an app, or a deployment slot. + * + * @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. + */ + listContinuousWebJobsNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listContinuousWebJobsNext(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 List continuous web jobs for an app, or a deployment slot. + * + * List continuous web jobs for an app, or a deployment slot. + * + * @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 {ContinuousWebJobCollection} - 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 ContinuousWebJobCollection} 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. + */ + listContinuousWebJobsNext(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._listContinuousWebJobsNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listContinuousWebJobsNext(nextPageLink, options, optionalCallback); + } + } + + /** + * @summary List deployments for an app, or a deployment slot. + * + * List deployments for an app, or a deployment slot. + * + * @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. + */ + listDeploymentsNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listDeploymentsNext(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 List deployments for an app, or a deployment slot. + * + * List deployments for an app, or a deployment slot. + * + * @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 {DeploymentCollection} - 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 DeploymentCollection} 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. + */ + listDeploymentsNext(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._listDeploymentsNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listDeploymentsNext(nextPageLink, options, optionalCallback); + } + } + + /** + * @summary Lists ownership identifiers for domain associated with web app. + * + * Lists ownership identifiers for domain associated with web app. + * + * @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. + */ + listDomainOwnershipIdentifiersNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listDomainOwnershipIdentifiersNext(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 Lists ownership identifiers for domain associated with web app. + * + * Lists ownership identifiers for domain associated with web app. + * + * @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 {IdentifierCollection} - 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 IdentifierCollection} 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. + */ + listDomainOwnershipIdentifiersNext(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._listDomainOwnershipIdentifiersNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listDomainOwnershipIdentifiersNext(nextPageLink, options, optionalCallback); + } + } + + /** + * @summary List the functions for a web site, or a deployment slot. + * + * List the functions for a web site, or a deployment slot. + * + * @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. + */ + listFunctionsNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listFunctionsNext(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 List the functions for a web site, or a deployment slot. + * + * List the functions for a web site, or a deployment slot. + * + * @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 {FunctionEnvelopeCollection} - 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 FunctionEnvelopeCollection} 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. + */ + listFunctionsNext(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._listFunctionsNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listFunctionsNext(nextPageLink, options, optionalCallback); + } + } + + /** + * @summary Get hostname bindings for an app or a deployment slot. + * + * Get hostname bindings for an app or a deployment slot. + * + * @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. + */ + listHostNameBindingsNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listHostNameBindingsNext(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 Get hostname bindings for an app or a deployment slot. + * + * Get hostname bindings for an app or a deployment slot. + * + * @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 {HostNameBindingCollection} - 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 HostNameBindingCollection} 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. + */ + listHostNameBindingsNext(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._listHostNameBindingsNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listHostNameBindingsNext(nextPageLink, options, optionalCallback); + } + } + + /** + * @summary Gets all scale-out instances of an app. + * + * Gets all scale-out instances of an app. + * + * @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. + */ + listInstanceIdentifiersNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listInstanceIdentifiersNext(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 all scale-out instances of an app. + * + * Gets all scale-out instances of an app. + * + * @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 {WebAppInstanceCollection} - 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 WebAppInstanceCollection} 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. + */ + listInstanceIdentifiersNext(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._listInstanceIdentifiersNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listInstanceIdentifiersNext(nextPageLink, options, optionalCallback); + } + } + + /** + * @summary Get list of processes for a web site, or a deployment slot, or for + * a specific scaled-out instance in a web site. + * + * Get list of processes for a web site, or a deployment slot, or for a + * specific scaled-out instance in a web site. + * + * @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. + */ + listInstanceProcessesNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listInstanceProcessesNext(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 Get list of processes for a web site, or a deployment slot, or for + * a specific scaled-out instance in a web site. + * + * Get list of processes for a web site, or a deployment slot, or for a + * specific scaled-out instance in a web site. + * + * @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 {ProcessInfoCollection} - 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 ProcessInfoCollection} 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. + */ + listInstanceProcessesNext(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._listInstanceProcessesNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listInstanceProcessesNext(nextPageLink, options, optionalCallback); + } + } + + /** + * @summary List module information for a process by its ID for a specific + * scaled-out instance in a web site. + * + * List module information for a process by its ID for a specific scaled-out + * instance in a web site. + * + * @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. + */ + listInstanceProcessModulesNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listInstanceProcessModulesNext(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 List module information for a process by its ID for a specific + * scaled-out instance in a web site. + * + * List module information for a process by its ID for a specific scaled-out + * instance in a web site. + * + * @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 {ProcessModuleInfoCollection} - 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 ProcessModuleInfoCollection} 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. + */ + listInstanceProcessModulesNext(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._listInstanceProcessModulesNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listInstanceProcessModulesNext(nextPageLink, options, optionalCallback); + } + } + + /** + * @summary List the threads in a process by its ID for a specific scaled-out + * instance in a web site. + * + * List the threads in a process by its ID for a specific scaled-out instance + * in a web site. + * + * @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. + */ + listInstanceProcessThreadsNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listInstanceProcessThreadsNext(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 List the threads in a process by its ID for a specific scaled-out + * instance in a web site. + * + * List the threads in a process by its ID for a specific scaled-out instance + * in a web site. + * + * @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 {ProcessThreadInfoCollection} - 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 ProcessThreadInfoCollection} 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. + */ + listInstanceProcessThreadsNext(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._listInstanceProcessThreadsNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listInstanceProcessThreadsNext(nextPageLink, options, optionalCallback); + } + } + + /** + * @summary Gets all metric definitions of an app (or deployment slot, if + * specified). + * + * Gets all metric definitions of an app (or deployment slot, if specified). + * + * @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. + */ + listMetricDefinitionsNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listMetricDefinitionsNext(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 all metric definitions of an app (or deployment slot, if + * specified). + * + * Gets all metric definitions of an app (or deployment slot, if specified). + * + * @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 {ResourceMetricDefinitionCollection} - 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 ResourceMetricDefinitionCollection} 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. + */ + listMetricDefinitionsNext(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._listMetricDefinitionsNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listMetricDefinitionsNext(nextPageLink, options, optionalCallback); + } + } + + /** + * @summary Gets performance metrics of an app (or deployment slot, if + * specified). + * + * Gets performance metrics of an app (or deployment slot, if specified). + * + * @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. + */ + listMetricsNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listMetricsNext(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 performance metrics of an app (or deployment slot, if + * specified). + * + * Gets performance metrics of an app (or deployment slot, if specified). + * + * @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 {ResourceMetricCollection} - 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 ResourceMetricCollection} 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. + */ + listMetricsNext(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._listMetricsNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listMetricsNext(nextPageLink, options, optionalCallback); + } + } + + /** + * @summary Gets perfmon counters for web app. + * + * Gets perfmon counters for web app. + * + * @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. + */ + listPerfMonCountersNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listPerfMonCountersNext(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 perfmon counters for web app. + * + * Gets perfmon counters for web app. + * + * @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 {PerfMonCounterCollection} - 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 PerfMonCounterCollection} 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. + */ + listPerfMonCountersNext(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._listPerfMonCountersNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listPerfMonCountersNext(nextPageLink, options, optionalCallback); + } + } + + /** + * @summary Get list of processes for a web site, or a deployment slot, or for + * a specific scaled-out instance in a web site. + * + * Get list of processes for a web site, or a deployment slot, or for a + * specific scaled-out instance in a web site. + * + * @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. + */ + listProcessesNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listProcessesNext(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 Get list of processes for a web site, or a deployment slot, or for + * a specific scaled-out instance in a web site. + * + * Get list of processes for a web site, or a deployment slot, or for a + * specific scaled-out instance in a web site. + * + * @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 {ProcessInfoCollection} - 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 ProcessInfoCollection} 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. + */ + listProcessesNext(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._listProcessesNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listProcessesNext(nextPageLink, options, optionalCallback); + } + } + + /** + * @summary List module information for a process by its ID for a specific + * scaled-out instance in a web site. + * + * List module information for a process by its ID for a specific scaled-out + * instance in a web site. + * + * @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. + */ + listProcessModulesNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listProcessModulesNext(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 List module information for a process by its ID for a specific + * scaled-out instance in a web site. + * + * List module information for a process by its ID for a specific scaled-out + * instance in a web site. + * + * @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 {ProcessModuleInfoCollection} - 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 ProcessModuleInfoCollection} 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. + */ + listProcessModulesNext(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._listProcessModulesNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listProcessModulesNext(nextPageLink, options, optionalCallback); + } + } + + /** + * @summary List the threads in a process by its ID for a specific scaled-out + * instance in a web site. + * + * List the threads in a process by its ID for a specific scaled-out instance + * in a web site. + * + * @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. + */ + listProcessThreadsNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listProcessThreadsNext(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 List the threads in a process by its ID for a specific scaled-out + * instance in a web site. + * + * List the threads in a process by its ID for a specific scaled-out instance + * in a web site. + * + * @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 {ProcessThreadInfoCollection} - 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 ProcessThreadInfoCollection} 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. + */ + listProcessThreadsNext(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._listProcessThreadsNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listProcessThreadsNext(nextPageLink, options, optionalCallback); + } + } + + /** + * @summary Get public certificates for an app or a deployment slot. + * + * Get public certificates for an app or a deployment slot. + * + * @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. + */ + listPublicCertificatesNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listPublicCertificatesNext(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 Get public certificates for an app or a deployment slot. + * + * Get public certificates for an app or a deployment slot. + * + * @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 {PublicCertificateCollection} - 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 PublicCertificateCollection} 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. + */ + listPublicCertificatesNext(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._listPublicCertificatesNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listPublicCertificatesNext(nextPageLink, options, optionalCallback); + } + } + + /** + * @summary Get list of siteextensions for a web site, or a deployment slot. + * + * Get list of siteextensions for a web site, or a deployment slot. + * + * @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. + */ + listSiteExtensionsNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listSiteExtensionsNext(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 Get list of siteextensions for a web site, or a deployment slot. + * + * Get list of siteextensions for a web site, or a deployment slot. + * + * @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 {SiteExtensionInfoCollection} - 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 SiteExtensionInfoCollection} 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. + */ + listSiteExtensionsNext(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._listSiteExtensionsNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listSiteExtensionsNext(nextPageLink, options, optionalCallback); + } + } + + /** + * @summary Gets an app's deployment slots. + * + * Gets an app's deployment slots. + * + * @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. + */ + listSlotsNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listSlotsNext(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 an app's deployment slots. + * + * Gets an app's deployment slots. + * + * @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 {WebAppCollection} - 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 WebAppCollection} 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. + */ + listSlotsNext(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._listSlotsNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listSlotsNext(nextPageLink, options, optionalCallback); + } + } + + /** + * @summary Gets existing backups of an app. + * + * Gets existing backups of an app. + * + * @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. + */ + listBackupsSlotNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listBackupsSlotNext(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 existing backups of an app. + * + * Gets existing backups of an app. + * + * @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 {BackupItemCollection} - 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 BackupItemCollection} 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. + */ + listBackupsSlotNext(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._listBackupsSlotNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listBackupsSlotNext(nextPageLink, options, optionalCallback); + } + } + + /** + * @summary List the configurations of an app + * + * List the configurations of an app + * + * @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. + */ + listConfigurationsSlotNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listConfigurationsSlotNext(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 List the configurations of an app + * + * List the configurations of an app + * + * @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 {SiteConfigResourceCollection} - 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 SiteConfigResourceCollection} 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. + */ + listConfigurationsSlotNext(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._listConfigurationsSlotNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listConfigurationsSlotNext(nextPageLink, options, optionalCallback); + } + } + + /** + * @summary Gets a list of web app configuration snapshots identifiers. Each + * element of the list contains a timestamp and the ID of the snapshot. + * + * Gets a list of web app configuration snapshots identifiers. Each element of + * the list contains a timestamp and the ID of the snapshot. + * + * @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. + */ + listConfigurationSnapshotInfoSlotNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listConfigurationSnapshotInfoSlotNext(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 web app configuration snapshots identifiers. Each + * element of the list contains a timestamp and the ID of the snapshot. + * + * Gets a list of web app configuration snapshots identifiers. Each element of + * the list contains a timestamp and the ID of the snapshot. + * + * @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 {SiteConfigurationSnapshotInfoCollection} - 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 SiteConfigurationSnapshotInfoCollection} 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. + */ + listConfigurationSnapshotInfoSlotNext(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._listConfigurationSnapshotInfoSlotNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listConfigurationSnapshotInfoSlotNext(nextPageLink, options, optionalCallback); + } + } + + /** + * @summary List continuous web jobs for an app, or a deployment slot. + * + * List continuous web jobs for an app, or a deployment slot. + * + * @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. + */ + listContinuousWebJobsSlotNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listContinuousWebJobsSlotNext(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 List continuous web jobs for an app, or a deployment slot. + * + * List continuous web jobs for an app, or a deployment slot. + * + * @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 {ContinuousWebJobCollection} - 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 ContinuousWebJobCollection} 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. + */ + listContinuousWebJobsSlotNext(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._listContinuousWebJobsSlotNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listContinuousWebJobsSlotNext(nextPageLink, options, optionalCallback); + } + } + + /** + * @summary List deployments for an app, or a deployment slot. + * + * List deployments for an app, or a deployment slot. + * + * @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. + */ + listDeploymentsSlotNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listDeploymentsSlotNext(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 List deployments for an app, or a deployment slot. + * + * List deployments for an app, or a deployment slot. + * + * @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 {DeploymentCollection} - 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 DeploymentCollection} 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. + */ + listDeploymentsSlotNext(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._listDeploymentsSlotNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listDeploymentsSlotNext(nextPageLink, options, optionalCallback); + } + } + + /** + * @summary Lists ownership identifiers for domain associated with web app. + * + * Lists ownership identifiers for domain associated with web app. + * + * @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. + */ + listDomainOwnershipIdentifiersSlotNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listDomainOwnershipIdentifiersSlotNext(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 Lists ownership identifiers for domain associated with web app. + * + * Lists ownership identifiers for domain associated with web app. + * + * @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 {IdentifierCollection} - 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 IdentifierCollection} 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. + */ + listDomainOwnershipIdentifiersSlotNext(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._listDomainOwnershipIdentifiersSlotNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listDomainOwnershipIdentifiersSlotNext(nextPageLink, options, optionalCallback); + } + } + + /** + * @summary List the functions for a web site, or a deployment slot. + * + * List the functions for a web site, or a deployment slot. + * + * @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. + */ + listInstanceFunctionsSlotNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listInstanceFunctionsSlotNext(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 List the functions for a web site, or a deployment slot. + * + * List the functions for a web site, or a deployment slot. + * + * @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 {FunctionEnvelopeCollection} - 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 FunctionEnvelopeCollection} 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. + */ + listInstanceFunctionsSlotNext(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._listInstanceFunctionsSlotNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listInstanceFunctionsSlotNext(nextPageLink, options, optionalCallback); + } + } + + /** + * @summary Get hostname bindings for an app or a deployment slot. + * + * Get hostname bindings for an app or a deployment slot. + * + * @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. + */ + listHostNameBindingsSlotNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listHostNameBindingsSlotNext(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 Get hostname bindings for an app or a deployment slot. + * + * Get hostname bindings for an app or a deployment slot. + * + * @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 {HostNameBindingCollection} - 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 HostNameBindingCollection} 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. + */ + listHostNameBindingsSlotNext(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._listHostNameBindingsSlotNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listHostNameBindingsSlotNext(nextPageLink, options, optionalCallback); + } + } + + /** + * @summary Gets all scale-out instances of an app. + * + * Gets all scale-out instances of an app. + * + * @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. + */ + listInstanceIdentifiersSlotNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listInstanceIdentifiersSlotNext(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 all scale-out instances of an app. + * + * Gets all scale-out instances of an app. + * + * @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 {WebAppInstanceCollection} - 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 WebAppInstanceCollection} 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. + */ + listInstanceIdentifiersSlotNext(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._listInstanceIdentifiersSlotNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listInstanceIdentifiersSlotNext(nextPageLink, options, optionalCallback); + } + } + + /** + * @summary Get list of processes for a web site, or a deployment slot, or for + * a specific scaled-out instance in a web site. + * + * Get list of processes for a web site, or a deployment slot, or for a + * specific scaled-out instance in a web site. + * + * @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. + */ + listInstanceProcessesSlotNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listInstanceProcessesSlotNext(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 Get list of processes for a web site, or a deployment slot, or for + * a specific scaled-out instance in a web site. + * + * Get list of processes for a web site, or a deployment slot, or for a + * specific scaled-out instance in a web site. + * + * @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 {ProcessInfoCollection} - 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 ProcessInfoCollection} 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. + */ + listInstanceProcessesSlotNext(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._listInstanceProcessesSlotNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listInstanceProcessesSlotNext(nextPageLink, options, optionalCallback); + } + } + + /** + * @summary List module information for a process by its ID for a specific + * scaled-out instance in a web site. + * + * List module information for a process by its ID for a specific scaled-out + * instance in a web site. + * + * @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. + */ + listInstanceProcessModulesSlotNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listInstanceProcessModulesSlotNext(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 List module information for a process by its ID for a specific + * scaled-out instance in a web site. + * + * List module information for a process by its ID for a specific scaled-out + * instance in a web site. + * + * @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 {ProcessModuleInfoCollection} - 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 ProcessModuleInfoCollection} 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. + */ + listInstanceProcessModulesSlotNext(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._listInstanceProcessModulesSlotNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listInstanceProcessModulesSlotNext(nextPageLink, options, optionalCallback); + } + } + + /** + * @summary List the threads in a process by its ID for a specific scaled-out + * instance in a web site. + * + * List the threads in a process by its ID for a specific scaled-out instance + * in a web site. + * + * @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. + */ + listInstanceProcessThreadsSlotNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listInstanceProcessThreadsSlotNext(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 List the threads in a process by its ID for a specific scaled-out + * instance in a web site. + * + * List the threads in a process by its ID for a specific scaled-out instance + * in a web site. + * + * @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 {ProcessThreadInfoCollection} - 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 ProcessThreadInfoCollection} 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. + */ + listInstanceProcessThreadsSlotNext(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._listInstanceProcessThreadsSlotNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listInstanceProcessThreadsSlotNext(nextPageLink, options, optionalCallback); + } + } + + /** + * @summary Gets all metric definitions of an app (or deployment slot, if + * specified). + * + * Gets all metric definitions of an app (or deployment slot, if specified). + * + * @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. + */ + listMetricDefinitionsSlotNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listMetricDefinitionsSlotNext(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 all metric definitions of an app (or deployment slot, if + * specified). + * + * Gets all metric definitions of an app (or deployment slot, if specified). + * + * @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 {ResourceMetricDefinitionCollection} - 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 ResourceMetricDefinitionCollection} 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. + */ + listMetricDefinitionsSlotNext(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._listMetricDefinitionsSlotNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listMetricDefinitionsSlotNext(nextPageLink, options, optionalCallback); + } + } + + /** + * @summary Gets performance metrics of an app (or deployment slot, if + * specified). + * + * Gets performance metrics of an app (or deployment slot, if specified). + * + * @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. + */ + listMetricsSlotNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listMetricsSlotNext(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 performance metrics of an app (or deployment slot, if + * specified). + * + * Gets performance metrics of an app (or deployment slot, if specified). + * + * @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 {ResourceMetricCollection} - 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 ResourceMetricCollection} 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. + */ + listMetricsSlotNext(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._listMetricsSlotNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listMetricsSlotNext(nextPageLink, options, optionalCallback); + } + } + + /** + * @summary Gets perfmon counters for web app. + * + * Gets perfmon counters for web app. + * + * @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. + */ + listPerfMonCountersSlotNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listPerfMonCountersSlotNext(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 perfmon counters for web app. + * + * Gets perfmon counters for web app. + * + * @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 {PerfMonCounterCollection} - 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 PerfMonCounterCollection} 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. + */ + listPerfMonCountersSlotNext(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._listPerfMonCountersSlotNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listPerfMonCountersSlotNext(nextPageLink, options, optionalCallback); + } + } + + /** + * @summary Get list of processes for a web site, or a deployment slot, or for + * a specific scaled-out instance in a web site. + * + * Get list of processes for a web site, or a deployment slot, or for a + * specific scaled-out instance in a web site. + * + * @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. + */ + listProcessesSlotNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listProcessesSlotNext(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 Get list of processes for a web site, or a deployment slot, or for + * a specific scaled-out instance in a web site. + * + * Get list of processes for a web site, or a deployment slot, or for a + * specific scaled-out instance in a web site. + * + * @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 {ProcessInfoCollection} - 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 ProcessInfoCollection} 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. + */ + listProcessesSlotNext(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._listProcessesSlotNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listProcessesSlotNext(nextPageLink, options, optionalCallback); + } + } + + /** + * @summary List module information for a process by its ID for a specific + * scaled-out instance in a web site. + * + * List module information for a process by its ID for a specific scaled-out + * instance in a web site. + * + * @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. + */ + listProcessModulesSlotNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listProcessModulesSlotNext(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 List module information for a process by its ID for a specific + * scaled-out instance in a web site. + * + * List module information for a process by its ID for a specific scaled-out + * instance in a web site. + * + * @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 {ProcessModuleInfoCollection} - 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 ProcessModuleInfoCollection} 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. + */ + listProcessModulesSlotNext(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._listProcessModulesSlotNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listProcessModulesSlotNext(nextPageLink, options, optionalCallback); + } + } + + /** + * @summary List the threads in a process by its ID for a specific scaled-out + * instance in a web site. + * + * List the threads in a process by its ID for a specific scaled-out instance + * in a web site. + * + * @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. + */ + listProcessThreadsSlotNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listProcessThreadsSlotNext(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 List the threads in a process by its ID for a specific scaled-out + * instance in a web site. + * + * List the threads in a process by its ID for a specific scaled-out instance + * in a web site. + * + * @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 {ProcessThreadInfoCollection} - 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 ProcessThreadInfoCollection} 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. + */ + listProcessThreadsSlotNext(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._listProcessThreadsSlotNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listProcessThreadsSlotNext(nextPageLink, options, optionalCallback); + } + } + + /** + * @summary Get public certificates for an app or a deployment slot. + * + * Get public certificates for an app or a deployment slot. + * + * @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. + */ + listPublicCertificatesSlotNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listPublicCertificatesSlotNext(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 Get public certificates for an app or a deployment slot. + * + * Get public certificates for an app or a deployment slot. + * + * @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 {PublicCertificateCollection} - 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 PublicCertificateCollection} 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. + */ + listPublicCertificatesSlotNext(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._listPublicCertificatesSlotNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listPublicCertificatesSlotNext(nextPageLink, options, optionalCallback); + } + } + + /** + * @summary Get list of siteextensions for a web site, or a deployment slot. + * + * Get list of siteextensions for a web site, or a deployment slot. + * + * @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. + */ + listSiteExtensionsSlotNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listSiteExtensionsSlotNext(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 Get list of siteextensions for a web site, or a deployment slot. + * + * Get list of siteextensions for a web site, or a deployment slot. + * + * @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 {SiteExtensionInfoCollection} - 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 SiteExtensionInfoCollection} 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. + */ + listSiteExtensionsSlotNext(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._listSiteExtensionsSlotNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listSiteExtensionsSlotNext(nextPageLink, options, optionalCallback); + } + } + + /** + * @summary Get the difference in configuration settings between two web app + * slots. + * + * Get the difference in configuration settings between two web app slots. + * + * @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. + */ + listSlotDifferencesSlotNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listSlotDifferencesSlotNext(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 Get the difference in configuration settings between two web app + * slots. + * + * Get the difference in configuration settings between two web app slots. + * + * @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 {SlotDifferenceCollection} - 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 SlotDifferenceCollection} 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. + */ + listSlotDifferencesSlotNext(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._listSlotDifferencesSlotNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listSlotDifferencesSlotNext(nextPageLink, options, optionalCallback); + } + } + + /** + * @summary Returns all Snapshots to the user. + * + * Returns all Snapshots to the user. + * + * @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. + */ + listSnapshotsSlotNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listSnapshotsSlotNext(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 Returns all Snapshots to the user. + * + * Returns all Snapshots to the user. + * + * @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 {SnapshotCollection} - 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 SnapshotCollection} 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. + */ + listSnapshotsSlotNext(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._listSnapshotsSlotNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listSnapshotsSlotNext(nextPageLink, options, optionalCallback); + } + } + + /** + * @summary List triggered web jobs for an app, or a deployment slot. + * + * List triggered web jobs for an app, or a deployment slot. + * + * @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. + */ + listTriggeredWebJobsSlotNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listTriggeredWebJobsSlotNext(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 List triggered web jobs for an app, or a deployment slot. + * + * List triggered web jobs for an app, or a deployment slot. + * + * @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 {TriggeredWebJobCollection} - 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 TriggeredWebJobCollection} 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. + */ + listTriggeredWebJobsSlotNext(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._listTriggeredWebJobsSlotNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listTriggeredWebJobsSlotNext(nextPageLink, options, optionalCallback); + } + } + + /** + * @summary List a triggered web job's history for an app, or a deployment + * slot. + * + * List a triggered web job's history for an app, or a deployment slot. + * + * @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. + */ + listTriggeredWebJobHistorySlotNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listTriggeredWebJobHistorySlotNext(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 List a triggered web job's history for an app, or a deployment + * slot. + * + * List a triggered web job's history for an app, or a deployment slot. + * + * @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 {TriggeredJobHistoryCollection} - 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 TriggeredJobHistoryCollection} 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. + */ + listTriggeredWebJobHistorySlotNext(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._listTriggeredWebJobHistorySlotNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listTriggeredWebJobHistorySlotNext(nextPageLink, options, optionalCallback); + } + } + + /** + * @summary Gets the quota usage information of an app (or deployment slot, if + * specified). + * + * Gets the quota usage information of an app (or deployment slot, if + * specified). + * + * @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. + */ + listUsagesSlotNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listUsagesSlotNext(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 the quota usage information of an app (or deployment slot, if + * specified). + * + * Gets the quota usage information of an app (or deployment slot, if + * specified). + * + * @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 {CsmUsageQuotaCollection} - 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 CsmUsageQuotaCollection} 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. + */ + listUsagesSlotNext(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._listUsagesSlotNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listUsagesSlotNext(nextPageLink, options, optionalCallback); + } + } + + /** + * @summary List webjobs for an app, or a deployment slot. + * + * List webjobs for an app, or a deployment slot. + * + * @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. + */ + listWebJobsSlotNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listWebJobsSlotNext(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 List webjobs for an app, or a deployment slot. + * + * List webjobs for an app, or a deployment slot. + * + * @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 {WebJobCollection} - 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 WebJobCollection} 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. + */ + listWebJobsSlotNext(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._listWebJobsSlotNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listWebJobsSlotNext(nextPageLink, options, optionalCallback); + } + } + + /** + * @summary Get the difference in configuration settings between two web app + * slots. + * + * Get the difference in configuration settings between two web app slots. + * + * @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. + */ + listSlotDifferencesFromProductionNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listSlotDifferencesFromProductionNext(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 Get the difference in configuration settings between two web app + * slots. + * + * Get the difference in configuration settings between two web app slots. + * + * @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 {SlotDifferenceCollection} - 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 SlotDifferenceCollection} 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. + */ + listSlotDifferencesFromProductionNext(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._listSlotDifferencesFromProductionNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listSlotDifferencesFromProductionNext(nextPageLink, options, optionalCallback); + } + } + + /** + * @summary Returns all Snapshots to the user. + * + * Returns all Snapshots to the user. + * + * @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. + */ + listSnapshotsNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listSnapshotsNext(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 Returns all Snapshots to the user. + * + * Returns all Snapshots to the user. + * + * @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 {SnapshotCollection} - 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 SnapshotCollection} 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. + */ + listSnapshotsNext(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._listSnapshotsNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listSnapshotsNext(nextPageLink, options, optionalCallback); + } + } + + /** + * @summary List triggered web jobs for an app, or a deployment slot. + * + * List triggered web jobs for an app, or a deployment slot. + * + * @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. + */ + listTriggeredWebJobsNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listTriggeredWebJobsNext(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 List triggered web jobs for an app, or a deployment slot. + * + * List triggered web jobs for an app, or a deployment slot. + * + * @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 {TriggeredWebJobCollection} - 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 TriggeredWebJobCollection} 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. + */ + listTriggeredWebJobsNext(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._listTriggeredWebJobsNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listTriggeredWebJobsNext(nextPageLink, options, optionalCallback); + } + } + + /** + * @summary List a triggered web job's history for an app, or a deployment + * slot. + * + * List a triggered web job's history for an app, or a deployment slot. + * + * @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. + */ + listTriggeredWebJobHistoryNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listTriggeredWebJobHistoryNext(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 List a triggered web job's history for an app, or a deployment + * slot. + * + * List a triggered web job's history for an app, or a deployment slot. + * + * @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 {TriggeredJobHistoryCollection} - 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 TriggeredJobHistoryCollection} 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. + */ + listTriggeredWebJobHistoryNext(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._listTriggeredWebJobHistoryNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listTriggeredWebJobHistoryNext(nextPageLink, options, optionalCallback); + } + } + + /** + * @summary Gets the quota usage information of an app (or deployment slot, if + * specified). + * + * Gets the quota usage information of an app (or deployment slot, if + * specified). + * + * @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. + */ + listUsagesNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listUsagesNext(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 the quota usage information of an app (or deployment slot, if + * specified). + * + * Gets the quota usage information of an app (or deployment slot, if + * specified). + * + * @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 {CsmUsageQuotaCollection} - 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 CsmUsageQuotaCollection} 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. + */ + listUsagesNext(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._listUsagesNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listUsagesNext(nextPageLink, options, optionalCallback); + } + } + + /** + * @summary List webjobs for an app, or a deployment slot. + * + * List webjobs for an app, or a deployment slot. + * + * @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. + */ + listWebJobsNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listWebJobsNext(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 List webjobs for an app, or a deployment slot. + * + * List webjobs for an app, or a deployment slot. + * + * @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 {WebJobCollection} - 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 WebJobCollection} 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. + */ + listWebJobsNext(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._listWebJobsNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listWebJobsNext(nextPageLink, options, optionalCallback); + } + } + +} + +module.exports = WebApps; diff --git a/lib/services/websiteManagement2/lib/webSiteManagementClient.d.ts b/lib/services/websiteManagement2/lib/webSiteManagementClient.d.ts new file mode 100644 index 0000000000..be353a305c --- /dev/null +++ b/lib/services/websiteManagement2/lib/webSiteManagementClient.d.ts @@ -0,0 +1,1516 @@ +/* + * 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. + */ + +import { ServiceClient, ServiceClientOptions, ServiceCallback, HttpOperationResponse, ServiceClientCredentials } from 'ms-rest'; +import { AzureServiceClient, AzureServiceClientOptions } from 'ms-rest-azure'; +import * as models from "./models"; +import * as operations from "./operations"; + +export default class WebSiteManagementClient extends AzureServiceClient { + /** + * Initializes a new instance of the WebSiteManagementClient class. + * @constructor + * + * @class + * @param {credentials} credentials - Credentials needed for the client to connect to Azure. + * + * @param {string} subscriptionId - Your Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000). + * + * @param {string} [baseUri] - The base URI of the service. + * + * @param {object} [options] - The parameter options + * + * @param {Array} [options.filters] - Filters to be added to the request pipeline + * + * @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] - 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: ServiceClientCredentials, subscriptionId: string, baseUri?: string, options?: AzureServiceClientOptions); + + credentials: ServiceClientCredentials; + + subscriptionId: string; + + apiVersion: string; + + acceptLanguage: string; + + longRunningOperationRetryTimeout: number; + + generateClientRequestId: boolean; + + // Operation groups + appServiceCertificateOrders: operations.AppServiceCertificateOrders; + certificateRegistrationProvider: operations.CertificateRegistrationProvider; + domains: operations.Domains; + topLevelDomains: operations.TopLevelDomains; + domainRegistrationProvider: operations.DomainRegistrationProvider; + certificates: operations.Certificates; + deletedWebApps: operations.DeletedWebApps; + diagnostics: operations.Diagnostics; + provider: operations.Provider; + recommendations: operations.Recommendations; + webApps: operations.WebApps; + appServiceEnvironments: operations.AppServiceEnvironments; + appServicePlans: operations.AppServicePlans; + resourceHealthMetadataOperations: operations.ResourceHealthMetadataOperations; + + + /** + * @summary Gets publishing user + * + * Gets publishing user + * + * @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. + */ + getPublishingUserWithHttpOperationResponse(options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets publishing user + * + * Gets publishing user + * + * @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 {User} - 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. + * + * {User} [result] - The deserialized result object if an error did not occur. + * See {@link User} 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. + */ + getPublishingUser(options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getPublishingUser(callback: ServiceCallback): void; + getPublishingUser(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Updates publishing user + * + * Updates publishing user + * + * @param {object} userDetails Details of publishing user + * + * @param {string} userDetails.publishingUserName Username used for publishing. + * + * @param {string} [userDetails.publishingPassword] Password used for + * publishing. + * + * @param {string} [userDetails.publishingPasswordHash] Password hash used for + * publishing. + * + * @param {string} [userDetails.publishingPasswordHashSalt] Password hash salt + * used for publishing. + * + * @param {string} [userDetails.scmUri] Url of SCM site. + * + * @param {string} [userDetails.kind] Kind of resource. + * + * @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. + */ + updatePublishingUserWithHttpOperationResponse(userDetails: models.User, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Updates publishing user + * + * Updates publishing user + * + * @param {object} userDetails Details of publishing user + * + * @param {string} userDetails.publishingUserName Username used for publishing. + * + * @param {string} [userDetails.publishingPassword] Password used for + * publishing. + * + * @param {string} [userDetails.publishingPasswordHash] Password hash used for + * publishing. + * + * @param {string} [userDetails.publishingPasswordHashSalt] Password hash salt + * used for publishing. + * + * @param {string} [userDetails.scmUri] Url of SCM site. + * + * @param {string} [userDetails.kind] Kind of resource. + * + * @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 {User} - 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. + * + * {User} [result] - The deserialized result object if an error did not occur. + * See {@link User} 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. + */ + updatePublishingUser(userDetails: models.User, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + updatePublishingUser(userDetails: models.User, callback: ServiceCallback): void; + updatePublishingUser(userDetails: models.User, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Gets the source controls available for Azure websites. + * + * Gets the source controls available for Azure websites. + * + * @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. + */ + listSourceControlsWithHttpOperationResponse(options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets the source controls available for Azure websites. + * + * Gets the source controls available for Azure websites. + * + * @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 {SourceControlCollection} - 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. + * + * {SourceControlCollection} [result] - The deserialized result object if an error did not occur. + * See {@link SourceControlCollection} 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. + */ + listSourceControls(options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listSourceControls(callback: ServiceCallback): void; + listSourceControls(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Gets source control token + * + * Gets source control token + * + * @param {string} sourceControlType Type of source control + * + * @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. + */ + getSourceControlWithHttpOperationResponse(sourceControlType: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets source control token + * + * Gets source control token + * + * @param {string} sourceControlType Type of source control + * + * @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 {SourceControl} - 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. + * + * {SourceControl} [result] - The deserialized result object if an error did not occur. + * See {@link SourceControl} 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. + */ + getSourceControl(sourceControlType: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getSourceControl(sourceControlType: string, callback: ServiceCallback): void; + getSourceControl(sourceControlType: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Updates source control token + * + * Updates source control token + * + * @param {string} sourceControlType Type of source control + * + * @param {object} requestMessage Source control token information + * + * @param {string} [requestMessage.token] OAuth access token. + * + * @param {string} [requestMessage.tokenSecret] OAuth access token secret. + * + * @param {string} [requestMessage.refreshToken] OAuth refresh token. + * + * @param {date} [requestMessage.expirationTime] OAuth token expiration. + * + * @param {string} [requestMessage.kind] Kind of resource. + * + * @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. + */ + updateSourceControlWithHttpOperationResponse(sourceControlType: string, requestMessage: models.SourceControl, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Updates source control token + * + * Updates source control token + * + * @param {string} sourceControlType Type of source control + * + * @param {object} requestMessage Source control token information + * + * @param {string} [requestMessage.token] OAuth access token. + * + * @param {string} [requestMessage.tokenSecret] OAuth access token secret. + * + * @param {string} [requestMessage.refreshToken] OAuth refresh token. + * + * @param {date} [requestMessage.expirationTime] OAuth token expiration. + * + * @param {string} [requestMessage.kind] Kind of resource. + * + * @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 {SourceControl} - 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. + * + * {SourceControl} [result] - The deserialized result object if an error did not occur. + * See {@link SourceControl} 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. + */ + updateSourceControl(sourceControlType: string, requestMessage: models.SourceControl, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + updateSourceControl(sourceControlType: string, requestMessage: models.SourceControl, callback: ServiceCallback): void; + updateSourceControl(sourceControlType: string, requestMessage: models.SourceControl, options: { 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 {object} [options] Optional Parameters. + * + * @param {string} [options.billingLocation] Azure Location of billable + * resource + * + * @param {string} [options.osType] App Service OS type meters used for + * + * @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. + */ + listBillingMetersWithHttpOperationResponse(options?: { billingLocation? : string, osType? : 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 {string} [options.osType] App Service OS type meters used for + * + * @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. + */ + listBillingMeters(options?: { billingLocation? : string, osType? : string, customHeaders? : { [headerName: string]: string; } }): Promise; + listBillingMeters(callback: ServiceCallback): void; + listBillingMeters(options: { billingLocation? : string, osType? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Check if a resource name is available. + * + * Check if a resource name is available. + * + * @param {string} name Resource name to verify. + * + * @param {string} type Resource type used for verification. Possible values + * include: 'Site', 'Slot', 'HostingEnvironment', 'PublishingUser', + * 'Microsoft.Web/sites', 'Microsoft.Web/sites/slots', + * 'Microsoft.Web/hostingEnvironments', 'Microsoft.Web/publishingUsers' + * + * @param {object} [options] Optional Parameters. + * + * @param {boolean} [options.isFqdn] Is fully qualified domain name. + * + * @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(name: string, type: string, options?: { isFqdn? : boolean, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Check if a resource name is available. + * + * Check if a resource name is available. + * + * @param {string} name Resource name to verify. + * + * @param {string} type Resource type used for verification. Possible values + * include: 'Site', 'Slot', 'HostingEnvironment', 'PublishingUser', + * 'Microsoft.Web/sites', 'Microsoft.Web/sites/slots', + * 'Microsoft.Web/hostingEnvironments', 'Microsoft.Web/publishingUsers' + * + * @param {object} [options] Optional Parameters. + * + * @param {boolean} [options.isFqdn] Is fully qualified domain name. + * + * @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 {ResourceNameAvailability} - 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. + * + * {ResourceNameAvailability} [result] - The deserialized result object if an error did not occur. + * See {@link ResourceNameAvailability} 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(name: string, type: string, options?: { isFqdn? : boolean, customHeaders? : { [headerName: string]: string; } }): Promise; + checkNameAvailability(name: string, type: string, callback: ServiceCallback): void; + checkNameAvailability(name: string, type: string, options: { isFqdn? : boolean, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Gets list of available geo regions plus ministamps + * + * Gets list of available geo regions plus ministamps + * + * @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. + */ + getSubscriptionDeploymentLocationsWithHttpOperationResponse(options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets list of available geo regions plus ministamps + * + * Gets list of available geo regions plus ministamps + * + * @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 {DeploymentLocations} - 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. + * + * {DeploymentLocations} [result] - The deserialized result object if an error did not occur. + * See {@link DeploymentLocations} 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. + */ + getSubscriptionDeploymentLocations(options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getSubscriptionDeploymentLocations(callback: ServiceCallback): void; + getSubscriptionDeploymentLocations(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Get a list of available geographical regions. + * + * Get a list of available geographical regions. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.sku] Name of SKU used to filter the regions. + * Possible values include: 'Free', 'Shared', 'Basic', 'Standard', 'Premium', + * 'Dynamic', 'Isolated', 'PremiumV2' + * + * @param {boolean} [options.linuxWorkersEnabled] Specify true if + * you want to filter to only regions that support Linux workers. + * + * @param {boolean} [options.xenonWorkersEnabled] Specify true if + * you want to filter to only regions that support Xenon workers. + * + * @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. + */ + listGeoRegionsWithHttpOperationResponse(options?: { sku? : string, linuxWorkersEnabled? : boolean, xenonWorkersEnabled? : boolean, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get a list of available geographical regions. + * + * Get a list of available geographical regions. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.sku] Name of SKU used to filter the regions. + * Possible values include: 'Free', 'Shared', 'Basic', 'Standard', 'Premium', + * 'Dynamic', 'Isolated', 'PremiumV2' + * + * @param {boolean} [options.linuxWorkersEnabled] Specify true if + * you want to filter to only regions that support Linux workers. + * + * @param {boolean} [options.xenonWorkersEnabled] Specify true if + * you want to filter to only regions that support Xenon workers. + * + * @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 {GeoRegionCollection} - 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. + * + * {GeoRegionCollection} [result] - The deserialized result object if an error did not occur. + * See {@link GeoRegionCollection} 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. + */ + listGeoRegions(options?: { sku? : string, linuxWorkersEnabled? : boolean, xenonWorkersEnabled? : boolean, customHeaders? : { [headerName: string]: string; } }): Promise; + listGeoRegions(callback: ServiceCallback): void; + listGeoRegions(options: { sku? : string, linuxWorkersEnabled? : boolean, xenonWorkersEnabled? : boolean, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary List all apps that are assigned to a hostname. + * + * List all apps that are assigned to a hostname. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.name] Name of the object. + * + * @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. + */ + listSiteIdentifiersAssignedToHostNameWithHttpOperationResponse(options?: { name? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary List all apps that are assigned to a hostname. + * + * List all apps that are assigned to a hostname. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.name] Name of the object. + * + * @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 {IdentifierCollection} - 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. + * + * {IdentifierCollection} [result] - The deserialized result object if an error did not occur. + * See {@link IdentifierCollection} 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. + */ + listSiteIdentifiersAssignedToHostName(options?: { name? : string, customHeaders? : { [headerName: string]: string; } }): Promise; + listSiteIdentifiersAssignedToHostName(callback: ServiceCallback): void; + listSiteIdentifiersAssignedToHostName(options: { name? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary List all premier add-on offers. + * + * List all premier add-on offers. + * + * @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. + */ + listPremierAddOnOffersWithHttpOperationResponse(options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary List all premier add-on offers. + * + * List all premier add-on offers. + * + * @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 {PremierAddOnOfferCollection} - 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. + * + * {PremierAddOnOfferCollection} [result] - The deserialized result object if an error did not occur. + * See {@link PremierAddOnOfferCollection} 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. + */ + listPremierAddOnOffers(options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listPremierAddOnOffers(callback: ServiceCallback): void; + listPremierAddOnOffers(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary List all SKUs. + * + * List all SKUs. + * + * @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. + */ + listSkusWithHttpOperationResponse(options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary List all SKUs. + * + * List all SKUs. + * + * @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 {SkuInfos} - 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. + * + * {SkuInfos} [result] - The deserialized result object if an error did not occur. + * See {@link SkuInfos} 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. + */ + listSkus(options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listSkus(callback: ServiceCallback): void; + listSkus(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Verifies if this VNET is compatible with an App Service Environment + * by analyzing the Network Security Group rules. + * + * Verifies if this VNET is compatible with an App Service Environment by + * analyzing the Network Security Group rules. + * + * @param {object} parameters VNET information + * + * @param {string} [parameters.vnetResourceGroup] The Resource Group of the + * VNET to be validated + * + * @param {string} [parameters.vnetName] The name of the VNET to be validated + * + * @param {string} [parameters.vnetSubnetName] The subnet name to be validated + * + * @param {string} [parameters.kind] Kind of resource. + * + * @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. + */ + verifyHostingEnvironmentVnetWithHttpOperationResponse(parameters: models.VnetParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Verifies if this VNET is compatible with an App Service Environment + * by analyzing the Network Security Group rules. + * + * Verifies if this VNET is compatible with an App Service Environment by + * analyzing the Network Security Group rules. + * + * @param {object} parameters VNET information + * + * @param {string} [parameters.vnetResourceGroup] The Resource Group of the + * VNET to be validated + * + * @param {string} [parameters.vnetName] The name of the VNET to be validated + * + * @param {string} [parameters.vnetSubnetName] The subnet name to be validated + * + * @param {string} [parameters.kind] Kind of resource. + * + * @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 {VnetValidationFailureDetails} - 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. + * + * {VnetValidationFailureDetails} [result] - The deserialized result object if an error did not occur. + * See {@link VnetValidationFailureDetails} 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. + */ + verifyHostingEnvironmentVnet(parameters: models.VnetParameters, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + verifyHostingEnvironmentVnet(parameters: models.VnetParameters, callback: ServiceCallback): void; + verifyHostingEnvironmentVnet(parameters: models.VnetParameters, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Move resources between resource groups. + * + * Move resources between resource groups. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {object} moveResourceEnvelope Object that represents the resource to + * move. + * + * @param {string} [moveResourceEnvelope.targetResourceGroup] + * + * @param {array} [moveResourceEnvelope.resources] + * + * @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. + */ + moveWithHttpOperationResponse(resourceGroupName: string, moveResourceEnvelope: models.CsmMoveResourceEnvelope, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Move resources between resource groups. + * + * Move resources between resource groups. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {object} moveResourceEnvelope Object that represents the resource to + * move. + * + * @param {string} [moveResourceEnvelope.targetResourceGroup] + * + * @param {array} [moveResourceEnvelope.resources] + * + * @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 {null} - 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. + * + * {null} [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. + */ + move(resourceGroupName: string, moveResourceEnvelope: models.CsmMoveResourceEnvelope, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + move(resourceGroupName: string, moveResourceEnvelope: models.CsmMoveResourceEnvelope, callback: ServiceCallback): void; + move(resourceGroupName: string, moveResourceEnvelope: models.CsmMoveResourceEnvelope, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Validate if a resource can be created. + * + * Validate if a resource can be created. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {object} validateRequest Request with the resources to validate. + * + * @param {string} validateRequest.name Resource name to verify. + * + * @param {string} validateRequest.type Resource type used for verification. + * Possible values include: 'ServerFarm', 'Site' + * + * @param {string} validateRequest.location Expected location of the resource. + * + * @param {string} [validateRequest.serverFarmId] ARM resource ID of an App + * Service plan that would host the app. + * + * @param {string} [validateRequest.skuName] Name of the target SKU for the App + * Service plan. + * + * @param {boolean} [validateRequest.needLinuxWorkers] true if App + * Service plan is for Linux workers; otherwise, false. + * + * @param {boolean} [validateRequest.isSpot] true if App Service + * plan is for Spot instances; otherwise, false. + * + * @param {number} [validateRequest.capacity] Target capacity of the App + * Service plan (number of VM's). + * + * @param {string} [validateRequest.hostingEnvironment] Name of App Service + * Environment where app or App Service plan should be created. + * + * @param {boolean} [validateRequest.isXenon] true if App Service + * plan is running as a windows container + * + * @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. + */ + validateWithHttpOperationResponse(resourceGroupName: string, validateRequest: models.ValidateRequest, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Validate if a resource can be created. + * + * Validate if a resource can be created. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {object} validateRequest Request with the resources to validate. + * + * @param {string} validateRequest.name Resource name to verify. + * + * @param {string} validateRequest.type Resource type used for verification. + * Possible values include: 'ServerFarm', 'Site' + * + * @param {string} validateRequest.location Expected location of the resource. + * + * @param {string} [validateRequest.serverFarmId] ARM resource ID of an App + * Service plan that would host the app. + * + * @param {string} [validateRequest.skuName] Name of the target SKU for the App + * Service plan. + * + * @param {boolean} [validateRequest.needLinuxWorkers] true if App + * Service plan is for Linux workers; otherwise, false. + * + * @param {boolean} [validateRequest.isSpot] true if App Service + * plan is for Spot instances; otherwise, false. + * + * @param {number} [validateRequest.capacity] Target capacity of the App + * Service plan (number of VM's). + * + * @param {string} [validateRequest.hostingEnvironment] Name of App Service + * Environment where app or App Service plan should be created. + * + * @param {boolean} [validateRequest.isXenon] true if App Service + * plan is running as a windows container + * + * @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 {ValidateResponse} - 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. + * + * {ValidateResponse} [result] - The deserialized result object if an error did not occur. + * See {@link ValidateResponse} 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. + */ + validate(resourceGroupName: string, validateRequest: models.ValidateRequest, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + validate(resourceGroupName: string, validateRequest: models.ValidateRequest, callback: ServiceCallback): void; + validate(resourceGroupName: string, validateRequest: models.ValidateRequest, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Validate whether a resource can be moved. + * + * Validate whether a resource can be moved. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {object} moveResourceEnvelope Object that represents the resource to + * move. + * + * @param {string} [moveResourceEnvelope.targetResourceGroup] + * + * @param {array} [moveResourceEnvelope.resources] + * + * @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. + */ + validateMoveWithHttpOperationResponse(resourceGroupName: string, moveResourceEnvelope: models.CsmMoveResourceEnvelope, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Validate whether a resource can be moved. + * + * Validate whether a resource can be moved. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {object} moveResourceEnvelope Object that represents the resource to + * move. + * + * @param {string} [moveResourceEnvelope.targetResourceGroup] + * + * @param {array} [moveResourceEnvelope.resources] + * + * @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 {null} - 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. + * + * {null} [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. + */ + validateMove(resourceGroupName: string, moveResourceEnvelope: models.CsmMoveResourceEnvelope, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + validateMove(resourceGroupName: string, moveResourceEnvelope: models.CsmMoveResourceEnvelope, callback: ServiceCallback): void; + validateMove(resourceGroupName: string, moveResourceEnvelope: models.CsmMoveResourceEnvelope, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Gets the source controls available for Azure websites. + * + * Gets the source controls available for Azure websites. + * + * @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. + */ + listSourceControlsNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets the source controls available for Azure websites. + * + * Gets the source controls available for Azure websites. + * + * @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 {SourceControlCollection} - 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. + * + * {SourceControlCollection} [result] - The deserialized result object if an error did not occur. + * See {@link SourceControlCollection} 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. + */ + listSourceControlsNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listSourceControlsNext(nextPageLink: string, callback: ServiceCallback): void; + listSourceControlsNext(nextPageLink: string, options: { 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. + */ + listBillingMetersNextWithHttpOperationResponse(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. + */ + listBillingMetersNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listBillingMetersNext(nextPageLink: string, callback: ServiceCallback): void; + listBillingMetersNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Get a list of available geographical regions. + * + * Get a list of available geographical regions. + * + * @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. + */ + listGeoRegionsNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get a list of available geographical regions. + * + * Get a list of available geographical regions. + * + * @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 {GeoRegionCollection} - 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. + * + * {GeoRegionCollection} [result] - The deserialized result object if an error did not occur. + * See {@link GeoRegionCollection} 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. + */ + listGeoRegionsNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listGeoRegionsNext(nextPageLink: string, callback: ServiceCallback): void; + listGeoRegionsNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary List all apps that are assigned to a hostname. + * + * List all apps that are assigned to a hostname. + * + * @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. + */ + listSiteIdentifiersAssignedToHostNameNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary List all apps that are assigned to a hostname. + * + * List all apps that are assigned to a hostname. + * + * @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 {IdentifierCollection} - 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. + * + * {IdentifierCollection} [result] - The deserialized result object if an error did not occur. + * See {@link IdentifierCollection} 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. + */ + listSiteIdentifiersAssignedToHostNameNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listSiteIdentifiersAssignedToHostNameNext(nextPageLink: string, callback: ServiceCallback): void; + listSiteIdentifiersAssignedToHostNameNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary List all premier add-on offers. + * + * List all premier add-on offers. + * + * @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. + */ + listPremierAddOnOffersNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary List all premier add-on offers. + * + * List all premier add-on offers. + * + * @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 {PremierAddOnOfferCollection} - 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. + * + * {PremierAddOnOfferCollection} [result] - The deserialized result object if an error did not occur. + * See {@link PremierAddOnOfferCollection} 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. + */ + listPremierAddOnOffersNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listPremierAddOnOffersNext(nextPageLink: string, callback: ServiceCallback): void; + listPremierAddOnOffersNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + +export { WebSiteManagementClient, models as WebSiteManagementModels }; diff --git a/lib/services/websiteManagement2/lib/webSiteManagementClient.js b/lib/services/websiteManagement2/lib/webSiteManagementClient.js new file mode 100644 index 0000000000..17634c5dd7 --- /dev/null +++ b/lib/services/websiteManagement2/lib/webSiteManagementClient.js @@ -0,0 +1,5282 @@ +/* + * 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. + */ + +/* jshint latedef:false */ +/* jshint forin:false */ +/* jshint noempty:false */ + +'use strict'; + +const msRest = require('ms-rest'); +const msRestAzure = require('ms-rest-azure'); +const ServiceClient = msRestAzure.AzureServiceClient; +const WebResource = msRest.WebResource; + +const models = require('./models'); +const operations = require('./operations'); + + +/** + * @summary Gets publishing user + * + * Gets publishing user + * + * @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 User} 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 _getPublishingUser(options, callback) { + /* jshint validthis: true */ + let client = this; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (this.apiVersion === null || this.apiVersion === undefined || typeof this.apiVersion.valueOf() !== 'string') { + throw new Error('this.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.acceptLanguage !== null && this.acceptLanguage !== undefined && typeof this.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'providers/Microsoft.Web/publishingUsers/web'; + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.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.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.acceptLanguage !== undefined && this.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['User']().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 Updates publishing user + * + * Updates publishing user + * + * @param {object} userDetails Details of publishing user + * + * @param {string} userDetails.publishingUserName Username used for publishing. + * + * @param {string} [userDetails.publishingPassword] Password used for + * publishing. + * + * @param {string} [userDetails.publishingPasswordHash] Password hash used for + * publishing. + * + * @param {string} [userDetails.publishingPasswordHashSalt] Password hash salt + * used for publishing. + * + * @param {string} [userDetails.scmUri] Url of SCM site. + * + * @param {string} [userDetails.kind] Kind of resource. + * + * @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 User} 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 _updatePublishingUser(userDetails, options, callback) { + /* jshint validthis: true */ + let client = this; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (userDetails === null || userDetails === undefined) { + throw new Error('userDetails cannot be null or undefined.'); + } + if (this.apiVersion === null || this.apiVersion === undefined || typeof this.apiVersion.valueOf() !== 'string') { + throw new Error('this.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.acceptLanguage !== null && this.acceptLanguage !== undefined && typeof this.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'providers/Microsoft.Web/publishingUsers/web'; + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'PUT'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.acceptLanguage !== undefined && this.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.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 (userDetails !== null && userDetails !== undefined) { + let requestModelMapper = new client.models['User']().mapper(); + requestModel = client.serialize(requestModelMapper, userDetails, 'userDetails'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(userDetails, 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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['User']().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 the source controls available for Azure websites. + * + * Gets the source controls available for Azure websites. + * + * @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 SourceControlCollection} 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 _listSourceControls(options, callback) { + /* jshint validthis: true */ + let client = this; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (this.apiVersion === null || this.apiVersion === undefined || typeof this.apiVersion.valueOf() !== 'string') { + throw new Error('this.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.acceptLanguage !== null && this.acceptLanguage !== undefined && typeof this.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'providers/Microsoft.Web/sourcecontrols'; + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.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.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.acceptLanguage !== undefined && this.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['SourceControlCollection']().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 source control token + * + * Gets source control token + * + * @param {string} sourceControlType Type of source control + * + * @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 SourceControl} 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 _getSourceControl(sourceControlType, options, callback) { + /* jshint validthis: true */ + let client = this; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (sourceControlType === null || sourceControlType === undefined || typeof sourceControlType.valueOf() !== 'string') { + throw new Error('sourceControlType cannot be null or undefined and it must be of type string.'); + } + if (this.apiVersion === null || this.apiVersion === undefined || typeof this.apiVersion.valueOf() !== 'string') { + throw new Error('this.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.acceptLanguage !== null && this.acceptLanguage !== undefined && typeof this.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'providers/Microsoft.Web/sourcecontrols/{sourceControlType}'; + requestUrl = requestUrl.replace('{sourceControlType}', encodeURIComponent(sourceControlType)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.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.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.acceptLanguage !== undefined && this.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['SourceControl']().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 Updates source control token + * + * Updates source control token + * + * @param {string} sourceControlType Type of source control + * + * @param {object} requestMessage Source control token information + * + * @param {string} [requestMessage.token] OAuth access token. + * + * @param {string} [requestMessage.tokenSecret] OAuth access token secret. + * + * @param {string} [requestMessage.refreshToken] OAuth refresh token. + * + * @param {date} [requestMessage.expirationTime] OAuth token expiration. + * + * @param {string} [requestMessage.kind] Kind of resource. + * + * @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 SourceControl} 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 _updateSourceControl(sourceControlType, requestMessage, options, callback) { + /* jshint validthis: true */ + let client = this; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (sourceControlType === null || sourceControlType === undefined || typeof sourceControlType.valueOf() !== 'string') { + throw new Error('sourceControlType cannot be null or undefined and it must be of type string.'); + } + if (requestMessage === null || requestMessage === undefined) { + throw new Error('requestMessage cannot be null or undefined.'); + } + if (this.apiVersion === null || this.apiVersion === undefined || typeof this.apiVersion.valueOf() !== 'string') { + throw new Error('this.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.acceptLanguage !== null && this.acceptLanguage !== undefined && typeof this.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'providers/Microsoft.Web/sourcecontrols/{sourceControlType}'; + requestUrl = requestUrl.replace('{sourceControlType}', encodeURIComponent(sourceControlType)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'PUT'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.acceptLanguage !== undefined && this.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.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 (requestMessage !== null && requestMessage !== undefined) { + let requestModelMapper = new client.models['SourceControl']().mapper(); + requestModel = client.serialize(requestModelMapper, requestMessage, 'requestMessage'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(requestMessage, 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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['SourceControl']().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 {object} [options] Optional Parameters. + * + * @param {string} [options.billingLocation] Azure Location of billable + * resource + * + * @param {string} [options.osType] App Service OS type meters used for + * + * @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 _listBillingMeters(options, callback) { + /* jshint validthis: true */ + let client = this; + 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 osType = (options && options.osType !== undefined) ? options.osType : undefined; + // Validate + try { + if (billingLocation !== null && billingLocation !== undefined && typeof billingLocation.valueOf() !== 'string') { + throw new Error('billingLocation must be of type string.'); + } + if (osType !== null && osType !== undefined && typeof osType.valueOf() !== 'string') { + throw new Error('osType must be of type string.'); + } + if (this.subscriptionId === null || this.subscriptionId === undefined || typeof this.subscriptionId.valueOf() !== 'string') { + throw new Error('this.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.apiVersion === null || this.apiVersion === undefined || typeof this.apiVersion.valueOf() !== 'string') { + throw new Error('this.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.acceptLanguage !== null && this.acceptLanguage !== undefined && typeof this.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/providers/Microsoft.Web/billingMeters'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.subscriptionId)); + let queryParameters = []; + if (billingLocation !== null && billingLocation !== undefined) { + queryParameters.push('billingLocation=' + encodeURIComponent(billingLocation)); + } + if (osType !== null && osType !== undefined) { + queryParameters.push('osType=' + encodeURIComponent(osType)); + } + queryParameters.push('api-version=' + encodeURIComponent(this.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.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.acceptLanguage !== undefined && this.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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 Check if a resource name is available. + * + * Check if a resource name is available. + * + * @param {string} name Resource name to verify. + * + * @param {string} type Resource type used for verification. Possible values + * include: 'Site', 'Slot', 'HostingEnvironment', 'PublishingUser', + * 'Microsoft.Web/sites', 'Microsoft.Web/sites/slots', + * 'Microsoft.Web/hostingEnvironments', 'Microsoft.Web/publishingUsers' + * + * @param {object} [options] Optional Parameters. + * + * @param {boolean} [options.isFqdn] Is fully qualified domain name. + * + * @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 ResourceNameAvailability} 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(name, type, options, callback) { + /* jshint validthis: true */ + let client = this; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let isFqdn = (options && options.isFqdn !== undefined) ? options.isFqdn : undefined; + // Validate + try { + if (this.subscriptionId === null || this.subscriptionId === undefined || typeof this.subscriptionId.valueOf() !== 'string') { + throw new Error('this.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.apiVersion === null || this.apiVersion === undefined || typeof this.apiVersion.valueOf() !== 'string') { + throw new Error('this.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (type === null || type === undefined || typeof type.valueOf() !== 'string') { + throw new Error('type cannot be null or undefined and it must be of type string.'); + } + if (isFqdn !== null && isFqdn !== undefined && typeof isFqdn !== 'boolean') { + throw new Error('isFqdn must be of type boolean.'); + } + if (this.acceptLanguage !== null && this.acceptLanguage !== undefined && typeof this.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + let request; + if ((name !== null && name !== undefined) || (type !== null && type !== undefined) || (isFqdn !== null && isFqdn !== undefined)) { + request = new client.models['ResourceNameAvailabilityRequest'](); + request.name = name; + request.type = type; + request.isFqdn = isFqdn; + } + + // Construct URL + let baseUrl = this.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/providers/Microsoft.Web/checknameavailability'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.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.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.acceptLanguage !== undefined && this.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.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 (request !== null && request !== undefined) { + let requestModelMapper = new client.models['ResourceNameAvailabilityRequest']().mapper(); + requestModel = client.serialize(requestModelMapper, request, 'request'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(request, 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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['ResourceNameAvailability']().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 list of available geo regions plus ministamps + * + * Gets list of available geo regions plus ministamps + * + * @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 DeploymentLocations} 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 _getSubscriptionDeploymentLocations(options, callback) { + /* jshint validthis: true */ + let client = this; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (this.subscriptionId === null || this.subscriptionId === undefined || typeof this.subscriptionId.valueOf() !== 'string') { + throw new Error('this.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.apiVersion === null || this.apiVersion === undefined || typeof this.apiVersion.valueOf() !== 'string') { + throw new Error('this.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.acceptLanguage !== null && this.acceptLanguage !== undefined && typeof this.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/providers/Microsoft.Web/deploymentLocations'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.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.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.acceptLanguage !== undefined && this.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['DeploymentLocations']().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 Get a list of available geographical regions. + * + * Get a list of available geographical regions. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.sku] Name of SKU used to filter the regions. + * Possible values include: 'Free', 'Shared', 'Basic', 'Standard', 'Premium', + * 'Dynamic', 'Isolated', 'PremiumV2' + * + * @param {boolean} [options.linuxWorkersEnabled] Specify true if + * you want to filter to only regions that support Linux workers. + * + * @param {boolean} [options.xenonWorkersEnabled] Specify true if + * you want to filter to only regions that support Xenon workers. + * + * @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 GeoRegionCollection} 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 _listGeoRegions(options, callback) { + /* jshint validthis: true */ + let client = this; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let sku = (options && options.sku !== undefined) ? options.sku : undefined; + let linuxWorkersEnabled = (options && options.linuxWorkersEnabled !== undefined) ? options.linuxWorkersEnabled : undefined; + let xenonWorkersEnabled = (options && options.xenonWorkersEnabled !== undefined) ? options.xenonWorkersEnabled : undefined; + // Validate + try { + if (sku !== null && sku !== undefined && typeof sku.valueOf() !== 'string') { + throw new Error('sku must be of type string.'); + } + if (linuxWorkersEnabled !== null && linuxWorkersEnabled !== undefined && typeof linuxWorkersEnabled !== 'boolean') { + throw new Error('linuxWorkersEnabled must be of type boolean.'); + } + if (xenonWorkersEnabled !== null && xenonWorkersEnabled !== undefined && typeof xenonWorkersEnabled !== 'boolean') { + throw new Error('xenonWorkersEnabled must be of type boolean.'); + } + if (this.subscriptionId === null || this.subscriptionId === undefined || typeof this.subscriptionId.valueOf() !== 'string') { + throw new Error('this.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.apiVersion === null || this.apiVersion === undefined || typeof this.apiVersion.valueOf() !== 'string') { + throw new Error('this.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.acceptLanguage !== null && this.acceptLanguage !== undefined && typeof this.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/providers/Microsoft.Web/geoRegions'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.subscriptionId)); + let queryParameters = []; + if (sku !== null && sku !== undefined) { + queryParameters.push('sku=' + encodeURIComponent(sku)); + } + if (linuxWorkersEnabled !== null && linuxWorkersEnabled !== undefined) { + queryParameters.push('linuxWorkersEnabled=' + encodeURIComponent(linuxWorkersEnabled.toString())); + } + if (xenonWorkersEnabled !== null && xenonWorkersEnabled !== undefined) { + queryParameters.push('xenonWorkersEnabled=' + encodeURIComponent(xenonWorkersEnabled.toString())); + } + queryParameters.push('api-version=' + encodeURIComponent(this.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.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.acceptLanguage !== undefined && this.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['GeoRegionCollection']().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 List all apps that are assigned to a hostname. + * + * List all apps that are assigned to a hostname. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.name] Name of the object. + * + * @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 IdentifierCollection} 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 _listSiteIdentifiersAssignedToHostName(options, callback) { + /* jshint validthis: true */ + let client = this; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let name = (options && options.name !== undefined) ? options.name : undefined; + // Validate + try { + if (this.subscriptionId === null || this.subscriptionId === undefined || typeof this.subscriptionId.valueOf() !== 'string') { + throw new Error('this.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.apiVersion === null || this.apiVersion === undefined || typeof this.apiVersion.valueOf() !== 'string') { + throw new Error('this.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (name !== null && name !== undefined && typeof name.valueOf() !== 'string') { + throw new Error('name must be of type string.'); + } + if (this.acceptLanguage !== null && this.acceptLanguage !== undefined && typeof this.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + let nameIdentifier; + if (name !== null && name !== undefined) { + nameIdentifier = new client.models['NameIdentifier'](); + nameIdentifier.name = name; + } + + // Construct URL + let baseUrl = this.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/providers/Microsoft.Web/listSitesAssignedToHostName'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.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.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.acceptLanguage !== undefined && this.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.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 (nameIdentifier !== null && nameIdentifier !== undefined) { + let requestModelMapper = new client.models['NameIdentifier']().mapper(); + requestModel = client.serialize(requestModelMapper, nameIdentifier, 'nameIdentifier'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(nameIdentifier, 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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['IdentifierCollection']().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 List all premier add-on offers. + * + * List all premier add-on offers. + * + * @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 PremierAddOnOfferCollection} 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 _listPremierAddOnOffers(options, callback) { + /* jshint validthis: true */ + let client = this; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (this.subscriptionId === null || this.subscriptionId === undefined || typeof this.subscriptionId.valueOf() !== 'string') { + throw new Error('this.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.apiVersion === null || this.apiVersion === undefined || typeof this.apiVersion.valueOf() !== 'string') { + throw new Error('this.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.acceptLanguage !== null && this.acceptLanguage !== undefined && typeof this.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/providers/Microsoft.Web/premieraddonoffers'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.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.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.acceptLanguage !== undefined && this.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['PremierAddOnOfferCollection']().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 List all SKUs. + * + * List all SKUs. + * + * @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 SkuInfos} 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 _listSkus(options, callback) { + /* jshint validthis: true */ + let client = this; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (this.subscriptionId === null || this.subscriptionId === undefined || typeof this.subscriptionId.valueOf() !== 'string') { + throw new Error('this.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.apiVersion === null || this.apiVersion === undefined || typeof this.apiVersion.valueOf() !== 'string') { + throw new Error('this.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.acceptLanguage !== null && this.acceptLanguage !== undefined && typeof this.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/providers/Microsoft.Web/skus'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.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.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.acceptLanguage !== undefined && this.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['SkuInfos']().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 Verifies if this VNET is compatible with an App Service Environment + * by analyzing the Network Security Group rules. + * + * Verifies if this VNET is compatible with an App Service Environment by + * analyzing the Network Security Group rules. + * + * @param {object} parameters VNET information + * + * @param {string} [parameters.vnetResourceGroup] The Resource Group of the + * VNET to be validated + * + * @param {string} [parameters.vnetName] The name of the VNET to be validated + * + * @param {string} [parameters.vnetSubnetName] The subnet name to be validated + * + * @param {string} [parameters.kind] Kind of resource. + * + * @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 VnetValidationFailureDetails} 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 _verifyHostingEnvironmentVnet(parameters, options, callback) { + /* jshint validthis: true */ + let client = this; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (parameters === null || parameters === undefined) { + throw new Error('parameters cannot be null or undefined.'); + } + if (this.subscriptionId === null || this.subscriptionId === undefined || typeof this.subscriptionId.valueOf() !== 'string') { + throw new Error('this.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.apiVersion === null || this.apiVersion === undefined || typeof this.apiVersion.valueOf() !== 'string') { + throw new Error('this.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.acceptLanguage !== null && this.acceptLanguage !== undefined && typeof this.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/providers/Microsoft.Web/verifyHostingEnvironmentVnet'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.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.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.acceptLanguage !== undefined && this.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + // Serialize Request + let requestContent = null; + let requestModel = null; + try { + if (parameters !== null && parameters !== undefined) { + let requestModelMapper = new client.models['VnetParameters']().mapper(); + requestModel = client.serialize(requestModelMapper, parameters, 'parameters'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(parameters, null, 2)}.`); + return callback(serializationError); + } + httpRequest.body = requestContent; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['VnetValidationFailureDetails']().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 Move resources between resource groups. + * + * Move resources between resource groups. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {object} moveResourceEnvelope Object that represents the resource to + * move. + * + * @param {string} [moveResourceEnvelope.targetResourceGroup] + * + * @param {array} [moveResourceEnvelope.resources] + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _move(resourceGroupName, moveResourceEnvelope, options, callback) { + /* jshint validthis: true */ + let client = this; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (moveResourceEnvelope === null || moveResourceEnvelope === undefined) { + throw new Error('moveResourceEnvelope cannot be null or undefined.'); + } + if (this.subscriptionId === null || this.subscriptionId === undefined || typeof this.subscriptionId.valueOf() !== 'string') { + throw new Error('this.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.apiVersion === null || this.apiVersion === undefined || typeof this.apiVersion.valueOf() !== 'string') { + throw new Error('this.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.acceptLanguage !== null && this.acceptLanguage !== undefined && typeof this.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/moveResources'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.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.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.acceptLanguage !== undefined && this.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.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 (moveResourceEnvelope !== null && moveResourceEnvelope !== undefined) { + let requestModelMapper = new client.models['CsmMoveResourceEnvelope']().mapper(); + requestModel = client.serialize(requestModelMapper, moveResourceEnvelope, 'moveResourceEnvelope'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(moveResourceEnvelope, 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 !== 204) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + + return callback(null, result, httpRequest, response); + }); +} + +/** + * @summary Validate if a resource can be created. + * + * Validate if a resource can be created. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {object} validateRequest Request with the resources to validate. + * + * @param {string} validateRequest.name Resource name to verify. + * + * @param {string} validateRequest.type Resource type used for verification. + * Possible values include: 'ServerFarm', 'Site' + * + * @param {string} validateRequest.location Expected location of the resource. + * + * @param {string} [validateRequest.serverFarmId] ARM resource ID of an App + * Service plan that would host the app. + * + * @param {string} [validateRequest.skuName] Name of the target SKU for the App + * Service plan. + * + * @param {boolean} [validateRequest.needLinuxWorkers] true if App + * Service plan is for Linux workers; otherwise, false. + * + * @param {boolean} [validateRequest.isSpot] true if App Service + * plan is for Spot instances; otherwise, false. + * + * @param {number} [validateRequest.capacity] Target capacity of the App + * Service plan (number of VM's). + * + * @param {string} [validateRequest.hostingEnvironment] Name of App Service + * Environment where app or App Service plan should be created. + * + * @param {boolean} [validateRequest.isXenon] true if App Service + * plan is running as a windows container + * + * @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 ValidateResponse} 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 _validate(resourceGroupName, validateRequest, options, callback) { + /* jshint validthis: true */ + let client = this; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (validateRequest === null || validateRequest === undefined) { + throw new Error('validateRequest cannot be null or undefined.'); + } + if (this.subscriptionId === null || this.subscriptionId === undefined || typeof this.subscriptionId.valueOf() !== 'string') { + throw new Error('this.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.apiVersion === null || this.apiVersion === undefined || typeof this.apiVersion.valueOf() !== 'string') { + throw new Error('this.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.acceptLanguage !== null && this.acceptLanguage !== undefined && typeof this.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/validate'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.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.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.acceptLanguage !== undefined && this.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.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 (validateRequest !== null && validateRequest !== undefined) { + let requestModelMapper = new client.models['ValidateRequest']().mapper(); + requestModel = client.serialize(requestModelMapper, validateRequest, 'validateRequest'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(validateRequest, 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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['ValidateResponse']().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 Validate whether a resource can be moved. + * + * Validate whether a resource can be moved. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {object} moveResourceEnvelope Object that represents the resource to + * move. + * + * @param {string} [moveResourceEnvelope.targetResourceGroup] + * + * @param {array} [moveResourceEnvelope.resources] + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _validateMove(resourceGroupName, moveResourceEnvelope, options, callback) { + /* jshint validthis: true */ + let client = this; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (moveResourceEnvelope === null || moveResourceEnvelope === undefined) { + throw new Error('moveResourceEnvelope cannot be null or undefined.'); + } + if (this.subscriptionId === null || this.subscriptionId === undefined || typeof this.subscriptionId.valueOf() !== 'string') { + throw new Error('this.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.apiVersion === null || this.apiVersion === undefined || typeof this.apiVersion.valueOf() !== 'string') { + throw new Error('this.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (this.acceptLanguage !== null && this.acceptLanguage !== undefined && typeof this.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/validateMoveResources'; + requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.subscriptionId)); + let queryParameters = []; + queryParameters.push('api-version=' + encodeURIComponent(this.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.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.acceptLanguage !== undefined && this.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.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 (moveResourceEnvelope !== null && moveResourceEnvelope !== undefined) { + let requestModelMapper = new client.models['CsmMoveResourceEnvelope']().mapper(); + requestModel = client.serialize(requestModelMapper, moveResourceEnvelope, 'moveResourceEnvelope'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(moveResourceEnvelope, 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 !== 204) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + + return callback(null, result, httpRequest, response); + }); +} + +/** + * @summary Gets the source controls available for Azure websites. + * + * Gets the source controls available for Azure websites. + * + * @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 SourceControlCollection} 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 _listSourceControlsNext(nextPageLink, options, callback) { + /* jshint validthis: true */ + let client = this; + 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.acceptLanguage !== null && this.acceptLanguage !== undefined && typeof this.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.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.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.acceptLanguage !== undefined && this.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['SourceControlCollection']().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 _listBillingMetersNext(nextPageLink, options, callback) { + /* jshint validthis: true */ + let client = this; + 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.acceptLanguage !== null && this.acceptLanguage !== undefined && typeof this.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.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.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.acceptLanguage !== undefined && this.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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 Get a list of available geographical regions. + * + * Get a list of available geographical regions. + * + * @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 GeoRegionCollection} 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 _listGeoRegionsNext(nextPageLink, options, callback) { + /* jshint validthis: true */ + let client = this; + 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.acceptLanguage !== null && this.acceptLanguage !== undefined && typeof this.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.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.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.acceptLanguage !== undefined && this.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['GeoRegionCollection']().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 List all apps that are assigned to a hostname. + * + * List all apps that are assigned to a hostname. + * + * @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 IdentifierCollection} 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 _listSiteIdentifiersAssignedToHostNameNext(nextPageLink, options, callback) { + /* jshint validthis: true */ + let client = this; + 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.acceptLanguage !== null && this.acceptLanguage !== undefined && typeof this.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.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 = 'POST'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.acceptLanguage !== undefined && this.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['IdentifierCollection']().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 List all premier add-on offers. + * + * List all premier add-on offers. + * + * @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 PremierAddOnOfferCollection} 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 _listPremierAddOnOffersNext(nextPageLink, options, callback) { + /* jshint validthis: true */ + let client = this; + 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.acceptLanguage !== null && this.acceptLanguage !== undefined && typeof this.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.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.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.acceptLanguage !== undefined && this.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.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) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().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['PremierAddOnOfferCollection']().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 WebSiteManagementClient. */ +class WebSiteManagementClient extends ServiceClient { + /** + * Create a WebSiteManagementClient. + * @param {credentials} credentials - Credentials needed for the client to connect to Azure. + * @param {string} subscriptionId - Your Azure subscription ID. This is a GUID-formatted string (e.g. 00000000-0000-0000-0000-000000000000). + * @param {string} [baseUri] - The base URI of the service. + * @param {object} [options] - The parameter options + * @param {Array} [options.filters] - Filters to be added to the request pipeline + * @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] - 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) { + throw new Error('\'credentials\' cannot be null.'); + } + if (subscriptionId === null || subscriptionId === undefined) { + throw new Error('\'subscriptionId\' cannot be null.'); + } + + if (!options) options = {}; + + super(credentials, options); + + this.apiVersion = '2018-02-01'; + this.acceptLanguage = 'en-US'; + this.longRunningOperationRetryTimeout = 30; + this.generateClientRequestId = true; + this.baseUri = baseUri; + if (!this.baseUri) { + this.baseUri = 'https://management.azure.com'; + } + this.credentials = credentials; + this.subscriptionId = subscriptionId; + + let packageInfo = this.getPackageJsonInfo(__dirname); + this.addUserAgentInfo(`${packageInfo.name}/${packageInfo.version}`); + if(options.acceptLanguage !== null && options.acceptLanguage !== undefined) { + this.acceptLanguage = options.acceptLanguage; + } + if(options.longRunningOperationRetryTimeout !== null && options.longRunningOperationRetryTimeout !== undefined) { + this.longRunningOperationRetryTimeout = options.longRunningOperationRetryTimeout; + } + if(options.generateClientRequestId !== null && options.generateClientRequestId !== undefined) { + this.generateClientRequestId = options.generateClientRequestId; + } + this.appServiceCertificateOrders = new operations.AppServiceCertificateOrders(this); + this.certificateRegistrationProvider = new operations.CertificateRegistrationProvider(this); + this.domains = new operations.Domains(this); + this.topLevelDomains = new operations.TopLevelDomains(this); + this.domainRegistrationProvider = new operations.DomainRegistrationProvider(this); + this.certificates = new operations.Certificates(this); + this.deletedWebApps = new operations.DeletedWebApps(this); + this.diagnostics = new operations.Diagnostics(this); + this.provider = new operations.Provider(this); + this.recommendations = new operations.Recommendations(this); + this.webApps = new operations.WebApps(this); + this.appServiceEnvironments = new operations.AppServiceEnvironments(this); + this.appServicePlans = new operations.AppServicePlans(this); + this.resourceHealthMetadataOperations = new operations.ResourceHealthMetadataOperations(this); + this.models = models; + this._getPublishingUser = _getPublishingUser; + this._updatePublishingUser = _updatePublishingUser; + this._listSourceControls = _listSourceControls; + this._getSourceControl = _getSourceControl; + this._updateSourceControl = _updateSourceControl; + this._listBillingMeters = _listBillingMeters; + this._checkNameAvailability = _checkNameAvailability; + this._getSubscriptionDeploymentLocations = _getSubscriptionDeploymentLocations; + this._listGeoRegions = _listGeoRegions; + this._listSiteIdentifiersAssignedToHostName = _listSiteIdentifiersAssignedToHostName; + this._listPremierAddOnOffers = _listPremierAddOnOffers; + this._listSkus = _listSkus; + this._verifyHostingEnvironmentVnet = _verifyHostingEnvironmentVnet; + this._move = _move; + this._validate = _validate; + this._validateMove = _validateMove; + this._listSourceControlsNext = _listSourceControlsNext; + this._listBillingMetersNext = _listBillingMetersNext; + this._listGeoRegionsNext = _listGeoRegionsNext; + this._listSiteIdentifiersAssignedToHostNameNext = _listSiteIdentifiersAssignedToHostNameNext; + this._listPremierAddOnOffersNext = _listPremierAddOnOffersNext; + msRest.addSerializationMixin(this); + } + + /** + * @summary Gets publishing user + * + * Gets publishing user + * + * @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. + */ + getPublishingUserWithHttpOperationResponse(options) { + let client = this; + let self = this; + return new Promise((resolve, reject) => { + self._getPublishingUser(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 publishing user + * + * Gets publishing user + * + * @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 {User} - 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 User} 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. + */ + getPublishingUser(options, optionalCallback) { + let client = this; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._getPublishingUser(options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getPublishingUser(options, optionalCallback); + } + } + + /** + * @summary Updates publishing user + * + * Updates publishing user + * + * @param {object} userDetails Details of publishing user + * + * @param {string} userDetails.publishingUserName Username used for publishing. + * + * @param {string} [userDetails.publishingPassword] Password used for + * publishing. + * + * @param {string} [userDetails.publishingPasswordHash] Password hash used for + * publishing. + * + * @param {string} [userDetails.publishingPasswordHashSalt] Password hash salt + * used for publishing. + * + * @param {string} [userDetails.scmUri] Url of SCM site. + * + * @param {string} [userDetails.kind] Kind of resource. + * + * @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. + */ + updatePublishingUserWithHttpOperationResponse(userDetails, options) { + let client = this; + let self = this; + return new Promise((resolve, reject) => { + self._updatePublishingUser(userDetails, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Updates publishing user + * + * Updates publishing user + * + * @param {object} userDetails Details of publishing user + * + * @param {string} userDetails.publishingUserName Username used for publishing. + * + * @param {string} [userDetails.publishingPassword] Password used for + * publishing. + * + * @param {string} [userDetails.publishingPasswordHash] Password hash used for + * publishing. + * + * @param {string} [userDetails.publishingPasswordHashSalt] Password hash salt + * used for publishing. + * + * @param {string} [userDetails.scmUri] Url of SCM site. + * + * @param {string} [userDetails.kind] Kind of resource. + * + * @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 {User} - 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 User} 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. + */ + updatePublishingUser(userDetails, options, optionalCallback) { + let client = this; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._updatePublishingUser(userDetails, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._updatePublishingUser(userDetails, options, optionalCallback); + } + } + + /** + * @summary Gets the source controls available for Azure websites. + * + * Gets the source controls available for Azure websites. + * + * @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. + */ + listSourceControlsWithHttpOperationResponse(options) { + let client = this; + let self = this; + return new Promise((resolve, reject) => { + self._listSourceControls(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 the source controls available for Azure websites. + * + * Gets the source controls available for Azure websites. + * + * @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 {SourceControlCollection} - 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 SourceControlCollection} 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. + */ + listSourceControls(options, optionalCallback) { + let client = this; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._listSourceControls(options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listSourceControls(options, optionalCallback); + } + } + + /** + * @summary Gets source control token + * + * Gets source control token + * + * @param {string} sourceControlType Type of source control + * + * @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. + */ + getSourceControlWithHttpOperationResponse(sourceControlType, options) { + let client = this; + let self = this; + return new Promise((resolve, reject) => { + self._getSourceControl(sourceControlType, 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 source control token + * + * Gets source control token + * + * @param {string} sourceControlType Type of source control + * + * @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 {SourceControl} - 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 SourceControl} 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. + */ + getSourceControl(sourceControlType, options, optionalCallback) { + let client = this; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._getSourceControl(sourceControlType, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getSourceControl(sourceControlType, options, optionalCallback); + } + } + + /** + * @summary Updates source control token + * + * Updates source control token + * + * @param {string} sourceControlType Type of source control + * + * @param {object} requestMessage Source control token information + * + * @param {string} [requestMessage.token] OAuth access token. + * + * @param {string} [requestMessage.tokenSecret] OAuth access token secret. + * + * @param {string} [requestMessage.refreshToken] OAuth refresh token. + * + * @param {date} [requestMessage.expirationTime] OAuth token expiration. + * + * @param {string} [requestMessage.kind] Kind of resource. + * + * @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. + */ + updateSourceControlWithHttpOperationResponse(sourceControlType, requestMessage, options) { + let client = this; + let self = this; + return new Promise((resolve, reject) => { + self._updateSourceControl(sourceControlType, requestMessage, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Updates source control token + * + * Updates source control token + * + * @param {string} sourceControlType Type of source control + * + * @param {object} requestMessage Source control token information + * + * @param {string} [requestMessage.token] OAuth access token. + * + * @param {string} [requestMessage.tokenSecret] OAuth access token secret. + * + * @param {string} [requestMessage.refreshToken] OAuth refresh token. + * + * @param {date} [requestMessage.expirationTime] OAuth token expiration. + * + * @param {string} [requestMessage.kind] Kind of resource. + * + * @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 {SourceControl} - 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 SourceControl} 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. + */ + updateSourceControl(sourceControlType, requestMessage, options, optionalCallback) { + let client = this; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._updateSourceControl(sourceControlType, requestMessage, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._updateSourceControl(sourceControlType, requestMessage, options, optionalCallback); + } + } + + /** + * @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 {string} [options.osType] App Service OS type meters used for + * + * @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. + */ + listBillingMetersWithHttpOperationResponse(options) { + let client = this; + let self = this; + return new Promise((resolve, reject) => { + self._listBillingMeters(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 {string} [options.osType] App Service OS type meters used for + * + * @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. + */ + listBillingMeters(options, optionalCallback) { + let client = this; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._listBillingMeters(options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listBillingMeters(options, optionalCallback); + } + } + + /** + * @summary Check if a resource name is available. + * + * Check if a resource name is available. + * + * @param {string} name Resource name to verify. + * + * @param {string} type Resource type used for verification. Possible values + * include: 'Site', 'Slot', 'HostingEnvironment', 'PublishingUser', + * 'Microsoft.Web/sites', 'Microsoft.Web/sites/slots', + * 'Microsoft.Web/hostingEnvironments', 'Microsoft.Web/publishingUsers' + * + * @param {object} [options] Optional Parameters. + * + * @param {boolean} [options.isFqdn] Is fully qualified domain name. + * + * @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(name, type, options) { + let client = this; + let self = this; + return new Promise((resolve, reject) => { + self._checkNameAvailability(name, type, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Check if a resource name is available. + * + * Check if a resource name is available. + * + * @param {string} name Resource name to verify. + * + * @param {string} type Resource type used for verification. Possible values + * include: 'Site', 'Slot', 'HostingEnvironment', 'PublishingUser', + * 'Microsoft.Web/sites', 'Microsoft.Web/sites/slots', + * 'Microsoft.Web/hostingEnvironments', 'Microsoft.Web/publishingUsers' + * + * @param {object} [options] Optional Parameters. + * + * @param {boolean} [options.isFqdn] Is fully qualified domain name. + * + * @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 {ResourceNameAvailability} - 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 ResourceNameAvailability} 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(name, type, options, optionalCallback) { + let client = this; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._checkNameAvailability(name, type, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._checkNameAvailability(name, type, options, optionalCallback); + } + } + + /** + * @summary Gets list of available geo regions plus ministamps + * + * Gets list of available geo regions plus ministamps + * + * @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. + */ + getSubscriptionDeploymentLocationsWithHttpOperationResponse(options) { + let client = this; + let self = this; + return new Promise((resolve, reject) => { + self._getSubscriptionDeploymentLocations(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 list of available geo regions plus ministamps + * + * Gets list of available geo regions plus ministamps + * + * @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 {DeploymentLocations} - 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 DeploymentLocations} 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. + */ + getSubscriptionDeploymentLocations(options, optionalCallback) { + let client = this; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._getSubscriptionDeploymentLocations(options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getSubscriptionDeploymentLocations(options, optionalCallback); + } + } + + /** + * @summary Get a list of available geographical regions. + * + * Get a list of available geographical regions. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.sku] Name of SKU used to filter the regions. + * Possible values include: 'Free', 'Shared', 'Basic', 'Standard', 'Premium', + * 'Dynamic', 'Isolated', 'PremiumV2' + * + * @param {boolean} [options.linuxWorkersEnabled] Specify true if + * you want to filter to only regions that support Linux workers. + * + * @param {boolean} [options.xenonWorkersEnabled] Specify true if + * you want to filter to only regions that support Xenon workers. + * + * @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. + */ + listGeoRegionsWithHttpOperationResponse(options) { + let client = this; + let self = this; + return new Promise((resolve, reject) => { + self._listGeoRegions(options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Get a list of available geographical regions. + * + * Get a list of available geographical regions. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.sku] Name of SKU used to filter the regions. + * Possible values include: 'Free', 'Shared', 'Basic', 'Standard', 'Premium', + * 'Dynamic', 'Isolated', 'PremiumV2' + * + * @param {boolean} [options.linuxWorkersEnabled] Specify true if + * you want to filter to only regions that support Linux workers. + * + * @param {boolean} [options.xenonWorkersEnabled] Specify true if + * you want to filter to only regions that support Xenon workers. + * + * @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 {GeoRegionCollection} - 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 GeoRegionCollection} 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. + */ + listGeoRegions(options, optionalCallback) { + let client = this; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._listGeoRegions(options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listGeoRegions(options, optionalCallback); + } + } + + /** + * @summary List all apps that are assigned to a hostname. + * + * List all apps that are assigned to a hostname. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.name] Name of the object. + * + * @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. + */ + listSiteIdentifiersAssignedToHostNameWithHttpOperationResponse(options) { + let client = this; + let self = this; + return new Promise((resolve, reject) => { + self._listSiteIdentifiersAssignedToHostName(options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary List all apps that are assigned to a hostname. + * + * List all apps that are assigned to a hostname. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.name] Name of the object. + * + * @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 {IdentifierCollection} - 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 IdentifierCollection} 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. + */ + listSiteIdentifiersAssignedToHostName(options, optionalCallback) { + let client = this; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._listSiteIdentifiersAssignedToHostName(options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listSiteIdentifiersAssignedToHostName(options, optionalCallback); + } + } + + /** + * @summary List all premier add-on offers. + * + * List all premier add-on offers. + * + * @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. + */ + listPremierAddOnOffersWithHttpOperationResponse(options) { + let client = this; + let self = this; + return new Promise((resolve, reject) => { + self._listPremierAddOnOffers(options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary List all premier add-on offers. + * + * List all premier add-on offers. + * + * @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 {PremierAddOnOfferCollection} - 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 PremierAddOnOfferCollection} 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. + */ + listPremierAddOnOffers(options, optionalCallback) { + let client = this; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._listPremierAddOnOffers(options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listPremierAddOnOffers(options, optionalCallback); + } + } + + /** + * @summary List all SKUs. + * + * List all SKUs. + * + * @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. + */ + listSkusWithHttpOperationResponse(options) { + let client = this; + let self = this; + return new Promise((resolve, reject) => { + self._listSkus(options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary List all SKUs. + * + * List all SKUs. + * + * @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 {SkuInfos} - 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 SkuInfos} 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. + */ + listSkus(options, optionalCallback) { + let client = this; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._listSkus(options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listSkus(options, optionalCallback); + } + } + + /** + * @summary Verifies if this VNET is compatible with an App Service Environment + * by analyzing the Network Security Group rules. + * + * Verifies if this VNET is compatible with an App Service Environment by + * analyzing the Network Security Group rules. + * + * @param {object} parameters VNET information + * + * @param {string} [parameters.vnetResourceGroup] The Resource Group of the + * VNET to be validated + * + * @param {string} [parameters.vnetName] The name of the VNET to be validated + * + * @param {string} [parameters.vnetSubnetName] The subnet name to be validated + * + * @param {string} [parameters.kind] Kind of resource. + * + * @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. + */ + verifyHostingEnvironmentVnetWithHttpOperationResponse(parameters, options) { + let client = this; + let self = this; + return new Promise((resolve, reject) => { + self._verifyHostingEnvironmentVnet(parameters, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Verifies if this VNET is compatible with an App Service Environment + * by analyzing the Network Security Group rules. + * + * Verifies if this VNET is compatible with an App Service Environment by + * analyzing the Network Security Group rules. + * + * @param {object} parameters VNET information + * + * @param {string} [parameters.vnetResourceGroup] The Resource Group of the + * VNET to be validated + * + * @param {string} [parameters.vnetName] The name of the VNET to be validated + * + * @param {string} [parameters.vnetSubnetName] The subnet name to be validated + * + * @param {string} [parameters.kind] Kind of resource. + * + * @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 {VnetValidationFailureDetails} - 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 VnetValidationFailureDetails} 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. + */ + verifyHostingEnvironmentVnet(parameters, options, optionalCallback) { + let client = this; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._verifyHostingEnvironmentVnet(parameters, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._verifyHostingEnvironmentVnet(parameters, options, optionalCallback); + } + } + + /** + * @summary Move resources between resource groups. + * + * Move resources between resource groups. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {object} moveResourceEnvelope Object that represents the resource to + * move. + * + * @param {string} [moveResourceEnvelope.targetResourceGroup] + * + * @param {array} [moveResourceEnvelope.resources] + * + * @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. + */ + moveWithHttpOperationResponse(resourceGroupName, moveResourceEnvelope, options) { + let client = this; + let self = this; + return new Promise((resolve, reject) => { + self._move(resourceGroupName, moveResourceEnvelope, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Move resources between resource groups. + * + * Move resources between resource groups. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {object} moveResourceEnvelope Object that represents the resource to + * move. + * + * @param {string} [moveResourceEnvelope.targetResourceGroup] + * + * @param {array} [moveResourceEnvelope.resources] + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + move(resourceGroupName, moveResourceEnvelope, options, optionalCallback) { + let client = this; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._move(resourceGroupName, moveResourceEnvelope, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._move(resourceGroupName, moveResourceEnvelope, options, optionalCallback); + } + } + + /** + * @summary Validate if a resource can be created. + * + * Validate if a resource can be created. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {object} validateRequest Request with the resources to validate. + * + * @param {string} validateRequest.name Resource name to verify. + * + * @param {string} validateRequest.type Resource type used for verification. + * Possible values include: 'ServerFarm', 'Site' + * + * @param {string} validateRequest.location Expected location of the resource. + * + * @param {string} [validateRequest.serverFarmId] ARM resource ID of an App + * Service plan that would host the app. + * + * @param {string} [validateRequest.skuName] Name of the target SKU for the App + * Service plan. + * + * @param {boolean} [validateRequest.needLinuxWorkers] true if App + * Service plan is for Linux workers; otherwise, false. + * + * @param {boolean} [validateRequest.isSpot] true if App Service + * plan is for Spot instances; otherwise, false. + * + * @param {number} [validateRequest.capacity] Target capacity of the App + * Service plan (number of VM's). + * + * @param {string} [validateRequest.hostingEnvironment] Name of App Service + * Environment where app or App Service plan should be created. + * + * @param {boolean} [validateRequest.isXenon] true if App Service + * plan is running as a windows container + * + * @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. + */ + validateWithHttpOperationResponse(resourceGroupName, validateRequest, options) { + let client = this; + let self = this; + return new Promise((resolve, reject) => { + self._validate(resourceGroupName, validateRequest, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Validate if a resource can be created. + * + * Validate if a resource can be created. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {object} validateRequest Request with the resources to validate. + * + * @param {string} validateRequest.name Resource name to verify. + * + * @param {string} validateRequest.type Resource type used for verification. + * Possible values include: 'ServerFarm', 'Site' + * + * @param {string} validateRequest.location Expected location of the resource. + * + * @param {string} [validateRequest.serverFarmId] ARM resource ID of an App + * Service plan that would host the app. + * + * @param {string} [validateRequest.skuName] Name of the target SKU for the App + * Service plan. + * + * @param {boolean} [validateRequest.needLinuxWorkers] true if App + * Service plan is for Linux workers; otherwise, false. + * + * @param {boolean} [validateRequest.isSpot] true if App Service + * plan is for Spot instances; otherwise, false. + * + * @param {number} [validateRequest.capacity] Target capacity of the App + * Service plan (number of VM's). + * + * @param {string} [validateRequest.hostingEnvironment] Name of App Service + * Environment where app or App Service plan should be created. + * + * @param {boolean} [validateRequest.isXenon] true if App Service + * plan is running as a windows container + * + * @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 {ValidateResponse} - 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 ValidateResponse} 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. + */ + validate(resourceGroupName, validateRequest, options, optionalCallback) { + let client = this; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._validate(resourceGroupName, validateRequest, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._validate(resourceGroupName, validateRequest, options, optionalCallback); + } + } + + /** + * @summary Validate whether a resource can be moved. + * + * Validate whether a resource can be moved. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {object} moveResourceEnvelope Object that represents the resource to + * move. + * + * @param {string} [moveResourceEnvelope.targetResourceGroup] + * + * @param {array} [moveResourceEnvelope.resources] + * + * @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. + */ + validateMoveWithHttpOperationResponse(resourceGroupName, moveResourceEnvelope, options) { + let client = this; + let self = this; + return new Promise((resolve, reject) => { + self._validateMove(resourceGroupName, moveResourceEnvelope, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Validate whether a resource can be moved. + * + * Validate whether a resource can be moved. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {object} moveResourceEnvelope Object that represents the resource to + * move. + * + * @param {string} [moveResourceEnvelope.targetResourceGroup] + * + * @param {array} [moveResourceEnvelope.resources] + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + validateMove(resourceGroupName, moveResourceEnvelope, options, optionalCallback) { + let client = this; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._validateMove(resourceGroupName, moveResourceEnvelope, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._validateMove(resourceGroupName, moveResourceEnvelope, options, optionalCallback); + } + } + + /** + * @summary Gets the source controls available for Azure websites. + * + * Gets the source controls available for Azure websites. + * + * @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. + */ + listSourceControlsNextWithHttpOperationResponse(nextPageLink, options) { + let client = this; + let self = this; + return new Promise((resolve, reject) => { + self._listSourceControlsNext(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 the source controls available for Azure websites. + * + * Gets the source controls available for Azure websites. + * + * @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 {SourceControlCollection} - 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 SourceControlCollection} 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. + */ + listSourceControlsNext(nextPageLink, options, optionalCallback) { + let client = this; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._listSourceControlsNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listSourceControlsNext(nextPageLink, 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. + */ + listBillingMetersNextWithHttpOperationResponse(nextPageLink, options) { + let client = this; + let self = this; + return new Promise((resolve, reject) => { + self._listBillingMetersNext(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. + */ + listBillingMetersNext(nextPageLink, options, optionalCallback) { + let client = this; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._listBillingMetersNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listBillingMetersNext(nextPageLink, options, optionalCallback); + } + } + + /** + * @summary Get a list of available geographical regions. + * + * Get a list of available geographical regions. + * + * @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. + */ + listGeoRegionsNextWithHttpOperationResponse(nextPageLink, options) { + let client = this; + let self = this; + return new Promise((resolve, reject) => { + self._listGeoRegionsNext(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 Get a list of available geographical regions. + * + * Get a list of available geographical regions. + * + * @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 {GeoRegionCollection} - 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 GeoRegionCollection} 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. + */ + listGeoRegionsNext(nextPageLink, options, optionalCallback) { + let client = this; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._listGeoRegionsNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listGeoRegionsNext(nextPageLink, options, optionalCallback); + } + } + + /** + * @summary List all apps that are assigned to a hostname. + * + * List all apps that are assigned to a hostname. + * + * @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. + */ + listSiteIdentifiersAssignedToHostNameNextWithHttpOperationResponse(nextPageLink, options) { + let client = this; + let self = this; + return new Promise((resolve, reject) => { + self._listSiteIdentifiersAssignedToHostNameNext(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 List all apps that are assigned to a hostname. + * + * List all apps that are assigned to a hostname. + * + * @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 {IdentifierCollection} - 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 IdentifierCollection} 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. + */ + listSiteIdentifiersAssignedToHostNameNext(nextPageLink, options, optionalCallback) { + let client = this; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._listSiteIdentifiersAssignedToHostNameNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listSiteIdentifiersAssignedToHostNameNext(nextPageLink, options, optionalCallback); + } + } + + /** + * @summary List all premier add-on offers. + * + * List all premier add-on offers. + * + * @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. + */ + listPremierAddOnOffersNextWithHttpOperationResponse(nextPageLink, options) { + let client = this; + let self = this; + return new Promise((resolve, reject) => { + self._listPremierAddOnOffersNext(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 List all premier add-on offers. + * + * List all premier add-on offers. + * + * @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 {PremierAddOnOfferCollection} - 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 PremierAddOnOfferCollection} 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. + */ + listPremierAddOnOffersNext(nextPageLink, options, optionalCallback) { + let client = this; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._listPremierAddOnOffersNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listPremierAddOnOffersNext(nextPageLink, options, optionalCallback); + } + } + +} + +module.exports = WebSiteManagementClient; +module.exports['default'] = WebSiteManagementClient; +module.exports.WebSiteManagementClient = WebSiteManagementClient; +module.exports.WebSiteManagementModels = models; diff --git a/lib/services/websiteManagement2/package.json b/lib/services/websiteManagement2/package.json new file mode 100644 index 0000000000..b96b773f26 --- /dev/null +++ b/lib/services/websiteManagement2/package.json @@ -0,0 +1,25 @@ +{ + "name": "azure-arm-website", + "author": "Microsoft Corporation", + "description": "WebSiteManagementClient Library with typescript type definitions for node", + "version": "4.0.0", + "dependencies": { + "ms-rest": "^2.3.3", + "ms-rest-azure": "^2.5.5" + }, + "keywords": [ + "node", + "azure" + ], + "license": "MIT", + "main": "./lib/webSiteManagementClient.js", + "types": "./lib/webSiteManagementClient.d.ts", + "homepage": "https://github.com/azure/azure-sdk-for-node/tree/master/lib/services/websiteManagement2", + "repository": { + "type": "git", + "url": "https://github.com/azure/azure-sdk-for-node.git" + }, + "bugs": { + "url": "https://github.com/azure/azure-sdk-for-node/issues" + } +}